diff --git a/CHANGELOG.md b/CHANGELOG.md index f589d33..c32a10d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,22 @@ -------------------------------------------------------------------------------- +## [0.5.2](https://github.com/Spxg/sqlite-wasm-rs/compare/0.5.1...0.5.2) + +### Added + +* Introduced the `rsqlite-vfs` crate. + [#156](https://github.com/Spxg/sqlite-wasm-rs/pull/156) + +### Fixed + +### Changed + +* Bump SQLite Version to 3.51.2 and SQLite3MC Version to 2.2.7. + [#168](https://github.com/Spxg/sqlite-wasm-rs/pull/168) + +-------------------------------------------------------------------------------- + ## [0.5.1](https://github.com/Spxg/sqlite-wasm-rs/compare/0.5.0...0.5.1) ### Added diff --git a/Cargo.toml b/Cargo.toml index 70ac187..bc5f047 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sqlite-wasm-rs" links = "wsqlite3" -version = "0.5.1" +version = "0.5.2" authors = ["Spxg "] repository = "https://github.com/Spxg/sqlite-wasm-rs" description = "`wasm32-unknown-unknown` bindings to the libsqlite3 library." @@ -14,9 +14,9 @@ rust-version.workspace = true include.workspace = true [dependencies] +rsqlite-vfs = "0.1.0" wasm-bindgen = { version = "0.2.104", default-features = false } js-sys = { version = "0.3.81", default-features = false } -rsqlite-vfs = { path = "crates/rsqlite-vfs" } [features] # SQLite3MultipleCiphers diff --git a/README.md b/README.md index 17e7a09..f85c40a 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,12 @@ fn open_db() { ```toml [dependencies] -sqlite-wasm-vfs = "0.1" +sqlite-wasm-vfs = "0.2" ``` The following vfs have been implemented: -* [`memory`](./src/vfs/memory.rs): as the default vfs, no additional conditions are required, store the database in memory. +* [`memory`](./crates/rsqlite-vfs/src/memvfs.rs): as the default vfs, no additional conditions are required, store the database in memory. * [`sahpool`](./crates/sqlite-wasm-vfs/src/sahpool.rs): ported from sqlite-wasm, store the database in opfs. * [`relaxed-idb`](./crates/sqlite-wasm-vfs/src/relaxed_idb.rs): store the database in blocks in indexed db. diff --git a/crates/rsqlite-vfs/Cargo.toml b/crates/rsqlite-vfs/Cargo.toml index f51fa75..1e27ffa 100644 --- a/crates/rsqlite-vfs/Cargo.toml +++ b/crates/rsqlite-vfs/Cargo.toml @@ -6,6 +6,9 @@ edition.workspace = true license.workspace = true rust-version.workspace = true include.workspace = true +keywords = ["sqlite", "vfs"] +description = "Helping to implement SQLite VFS." +categories = ["development-tools::ffi", "wasm", "database"] [dependencies] hashbrown = { version = "0.16.1", default-features = false, features = ["default-hasher"] } diff --git a/extensions/sqlite-vec/README.md b/extensions/sqlite-vec/README.md index 56b34ce..9dfe771 100644 --- a/extensions/sqlite-vec/README.md +++ b/extensions/sqlite-vec/README.md @@ -7,22 +7,29 @@ ```toml [dependencies] sqlite-wasm-vec = "0.1" + +[dev-dependencies] +wasm-bindgen-test = "0.3.55" rusqlite = "0.38.0" ``` ```rust use sqlite_wasm_vec::sqlite3_vec_init; use rusqlite::{ffi::sqlite3_auto_extension, Connection}; +use wasm_bindgen_test::wasm_bindgen_test; -#[test] -fn vec_version() -> String { +#[wasm_bindgen_test] +fn test_rusqlite_auto_extension() { unsafe { sqlite3_auto_extension(Some(std::mem::transmute(sqlite3_vec_init as *const ()))); } let conn = Connection::open_in_memory().unwrap(); - conn.query_row("select vec_version()", [], |x| x.get(0)) - .unwrap() + let result: String = conn + .query_row("select vec_version()", [], |x| x.get(0)) + .unwrap(); + + assert!(result.starts_with("v")); } ```