diff --git a/extensions/kvstore/src/lib.rs b/extensions/kvstore/src/lib.rs index 45f8d0cad..a9de7c71d 100644 --- a/extensions/kvstore/src/lib.rs +++ b/extensions/kvstore/src/lib.rs @@ -16,13 +16,12 @@ register_extension! { #[derive(VTabModuleDerive, Default)] pub struct KVStoreVTab; -/// The cursor holds a snapshot of (rowid, key, value) in memory. +/// the cursor holds a snapshot of (rowid, key, value) in memory. pub struct KVStoreCursor { rows: Vec<(i64, String, String)>, index: Option, } -/// Implementing the VTabModule trait for KVStoreVTab impl VTabModule for KVStoreVTab { type VCursor = KVStoreCursor; const VTAB_KIND: VTabKind = VTabKind::VirtualTable; diff --git a/testing/extensions.py b/testing/extensions.py index 6e203d416..8bff11bc2 100755 --- a/testing/extensions.py +++ b/testing/extensions.py @@ -531,6 +531,15 @@ def test_kv(pipe): returns_null, "can delete from empty table without error", ) + for i in range(100): + write_to_pipe(pipe, f"insert into t values ('key{i}', 'val{i}');") + run_test( + pipe, "select count(*) from t;", lambda res: "100" == res, "can insert 100 rows" + ) + run_test(pipe, "delete from t limit 96;", returns_null, "can delete 96 rows") + run_test( + pipe, "select count(*) from t;", lambda res: "4" == res, "four rows remain" + ) def main():