From 65668a46e4531caf7c50d18263bca79e14d404b0 Mon Sep 17 00:00:00 2001 From: gwenn Date: Sat, 26 Feb 2022 09:55:17 +0100 Subject: [PATCH] Add constants introduced by SQLite 3.38.0 SQLITE_STMTSTATUS_FILTER_MISS SQLITE_STMTSTATUS_FILTER_HIT SQLITE_INDEX_CONSTRAINT_LIMIT SQLITE_INDEX_CONSTRAINT_OFFSET --- src/config.rs | 8 ++++---- src/statement.rs | 4 ++++ src/util/sqlite_string.rs | 8 ++++---- src/vtab/mod.rs | 4 ++++ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/config.rs b/src/config.rs index 7024b12..b59e5ef 100644 --- a/src/config.rs +++ b/src/config.rs @@ -95,10 +95,10 @@ impl Connection { /// Make configuration changes to a database connection /// - /// - `SQLITE_DBCONFIG_ENABLE_FKEY`: `false` to disable FK enforcement, `true` - /// to enable FK enforcement - /// - `SQLITE_DBCONFIG_ENABLE_TRIGGER`: `false` to disable triggers, `true` to - /// enable triggers + /// - `SQLITE_DBCONFIG_ENABLE_FKEY`: `false` to disable FK enforcement, + /// `true` to enable FK enforcement + /// - `SQLITE_DBCONFIG_ENABLE_TRIGGER`: `false` to disable triggers, `true` + /// to enable triggers /// - `SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER`: `false` to disable /// `fts3_tokenizer()`, `true` to enable `fts3_tokenizer()` /// - `SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE`: `false` (the default) to enable diff --git a/src/statement.rs b/src/statement.rs index 35f608f..60abd90 100644 --- a/src/statement.rs +++ b/src/statement.rs @@ -946,6 +946,10 @@ pub enum StatementStatus { RePrepare = 5, /// Equivalent to SQLITE_STMTSTATUS_RUN Run = 6, + /// Equivalent to SQLITE_STMTSTATUS_FILTER_MISS + FilterMiss = 7, + /// Equivalent to SQLITE_STMTSTATUS_FILTER_HIT + FilterHit = 8, /// Equivalent to SQLITE_STMTSTATUS_MEMUSED MemUsed = 99, } diff --git a/src/util/sqlite_string.rs b/src/util/sqlite_string.rs index 3cdf109..da261ba 100644 --- a/src/util/sqlite_string.rs +++ b/src/util/sqlite_string.rs @@ -95,10 +95,10 @@ impl SqliteMallocString { /// If `s` contains internal NULs, we'll replace them with /// `NUL_REPLACE_CHAR`. /// - /// Except for `debug_assert`s which may trigger during testing, this function - /// never panics. If we hit integer overflow or the allocation fails, we - /// call `handle_alloc_error` which aborts the program after calling a - /// global hook. + /// Except for `debug_assert`s which may trigger during testing, this + /// function never panics. If we hit integer overflow or the allocation + /// fails, we call `handle_alloc_error` which aborts the program after + /// calling a global hook. /// /// This means it's safe to use in extern "C" functions even outside of /// `catch_unwind`. diff --git a/src/vtab/mod.rs b/src/vtab/mod.rs index 0e9881f..bdb6509 100644 --- a/src/vtab/mod.rs +++ b/src/vtab/mod.rs @@ -281,6 +281,8 @@ pub enum IndexConstraintOp { SQLITE_INDEX_CONSTRAINT_ISNOTNULL, // 3.21.0 SQLITE_INDEX_CONSTRAINT_ISNULL, // 3.21.0 SQLITE_INDEX_CONSTRAINT_IS, // 3.21.0 + SQLITE_INDEX_CONSTRAINT_LIMIT, // 3.38.0 + SQLITE_INDEX_CONSTRAINT_OFFSET, // 3.38.0 SQLITE_INDEX_CONSTRAINT_FUNCTION(u8), // 3.25.0 } @@ -301,6 +303,8 @@ impl From for IndexConstraintOp { 70 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_ISNOTNULL, 71 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_ISNULL, 72 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_IS, + 73 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_LIMIT, + 74 => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_OFFSET, v => IndexConstraintOp::SQLITE_INDEX_CONSTRAINT_FUNCTION(v), } }