add todo comments

This commit is contained in:
yggverse 2024-11-14 14:17:43 +02:00
parent 57a8b5091f
commit c83248741b

View File

@ -29,7 +29,7 @@ impl Database {
/// Get bookmark records from database with optional filter by `request` /// Get bookmark records from database with optional filter by `request`
pub fn records(&self, request: Option<&str>) -> Result<Vec<Table>, Error> { pub fn records(&self, request: Option<&str>) -> Result<Vec<Table>, Error> {
let readable = self.connection.read().unwrap(); let readable = self.connection.read().unwrap(); // @TODO
let tx = readable.unchecked_transaction()?; let tx = readable.unchecked_transaction()?;
select(&tx, *self.profile_id, request) select(&tx, *self.profile_id, request)
} }
@ -40,7 +40,7 @@ impl Database {
/// * return last insert ID on success /// * return last insert ID on success
pub fn add(&self, time: DateTime, request: String) -> Result<i64, Error> { pub fn add(&self, time: DateTime, request: String) -> Result<i64, Error> {
// Begin new transaction // Begin new transaction
let mut writable = self.connection.write().unwrap(); let mut writable = self.connection.write().unwrap(); // @TODO
let tx = writable.transaction()?; let tx = writable.transaction()?;
// Create new record // Create new record
@ -59,8 +59,8 @@ impl Database {
/// Delete bookmark record from database /// Delete bookmark record from database
pub fn delete(&self, id: i64) -> Result<(), Error> { pub fn delete(&self, id: i64) -> Result<(), Error> {
// Begin new transaction // Begin new transaction
let mut writable = self.connection.write().unwrap(); let mut writable = self.connection.write().unwrap(); // @TODO
let tx = writable.transaction().unwrap(); let tx = writable.transaction()?;
// Delete record by ID // Delete record by ID
match delete(&tx, id) { match delete(&tx, id) {