mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
Test that extra_check feature works with RETURNING statements (#932)
Test that extra_check feature works with RETURNING statements
This commit is contained in:
parent
517ef2beae
commit
6c956bb270
13
src/lib.rs
13
src/lib.rs
@ -1921,4 +1921,17 @@ mod test {
|
|||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(feature = "bundled")] // SQLite >= 3.35.0
|
||||||
|
fn test_returning() -> Result<()> {
|
||||||
|
let db = checked_memory_handle();
|
||||||
|
db.execute_batch("CREATE TABLE foo(x INTEGER PRIMARY KEY)")?;
|
||||||
|
let row_id =
|
||||||
|
db.query_row::<i64, _, _>("INSERT INTO foo DEFAULT VALUES RETURNING ROWID", [], |r| {
|
||||||
|
r.get(0)
|
||||||
|
})?;
|
||||||
|
assert_eq!(row_id, 1);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user