Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
trevyn committed Jul 23, 2024
1 parent 18eb379 commit 879f0a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions turbosql/src/lib_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ pub type Blob = Vec<u8>;
pub trait Turbosql {
/// Inserts this row into the database. `rowid` must be `None`. On success, returns the new `rowid`.
fn insert(&self) -> Result<i64, Error>;
/// Inserts this row into the database, and updates the `rowid` of the struct to match the rowid newly inserted into the database. `rowid` must be `None`. On success, returns the new `rowid`.
fn insert_mut(&mut self) -> Result<i64, Error>;
/// Inserts all rows in the slice into the database. All `rowid`s must be `None`. On success, returns `Ok(())`.
fn insert_batch<T: AsRef<Self>>(rows: &[T]) -> Result<(), Error>;
/// Updates this existing row in the database, based on `rowid`, which must be `Some`. All fields are overwritten in the database. On success, returns the number of rows updated, which should be 1.
Expand Down
1 change: 1 addition & 0 deletions turbosql/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ fn integration_test() {

row2.insert_mut().unwrap();
assert_eq!(row2.rowid, Some(3));
execute!("DELETE FROM personintegrationtest WHERE rowid=3").unwrap();

assert_eq!(select!(i64 "1").unwrap(), 1);
// assert_eq!(select!(Vec<i64> "1").unwrap(), vec![1]);
Expand Down

0 comments on commit 879f0a6

Please sign in to comment.