test,ci: validate version of sqlite and fix ci

This commit is contained in:
oxalica 2024-09-17 22:49:43 -04:00
parent 4108212f34
commit 7b0ca8aa16
2 changed files with 22 additions and 2 deletions

View file

@ -131,4 +131,15 @@ impl ConnectionExt for Connection {}
fn init_sql_valid() {
let conn = Connection::open_in_memory().unwrap();
conn.execute_batch(INIT_SQL).unwrap();
// Instantiate view to check syntax and availability of `unixepoch()`.
// It requires sqlite >= 3.38.0 (2022-02-22) which is not available by default on GitHub CI.
let ret = conn
.query_row(
"SELECT COUNT(*) FROM `valid_user_act_key`",
params![],
|row| row.get::<_, i64>(0),
)
.unwrap();
assert_eq!(ret, 0);
}