Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cljoly committed Mar 19, 2024
1 parent bda1e4f commit 850dbb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion examples/async/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ async fn main() {
// Apply some PRAGMA. These are often better applied outside of migrations, as some needs to be
// executed for each connection (like `foreign_keys`) or to be executed outside transactions
// (`journal_mode` is a noop in a transaction).
async_conn
async_conn
.call(|conn| Ok(conn.pragma_update(None, "journal_mode", "WAL")))
.await
.unwrap()
.unwrap();
async_conn
.call(|conn| Ok(conn.pragma_update(None, "foreign_keys", "ON")))
Expand Down
10 changes: 4 additions & 6 deletions rusqlite_migration_tests/tests/multiline_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ fn main_test() {
let mut ms = vec![M::up(
r#"
CREATE TABLE friend (name TEXT PRIMARY KEY, email TEXT) WITHOUT ROWID;
PRAGMA journal_mode = WAL;
PRAGMA foreign_keys = ON;
ALTER TABLE friend ADD COLUMN birthday TEXT;
ALTER TABLE friend ADD COLUMN notes TEXT;
"#,
)];

Expand All @@ -31,10 +30,9 @@ fn main_test() {
));

conn.pragma_update_and_check(None, "journal_mode", "WAL", |r| {
if let Ok(v) = r.get(0) {
Ok(())
} else {
assert!(false, "unexpected journal_mode after setting it")
match r.get::<_, String>(0) {
Ok(v) if v.to_lowercase() == "wal" => Ok(()),
val => panic!("unexpected journal_mode after setting it: {:?}", val),
}
})
.unwrap();
Expand Down

0 comments on commit 850dbb9

Please sign in to comment.