Skip to content

Commit

Permalink
fix: arguments (#22)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added serialization and deserialization methods for database
connections
	- Enhanced statement preparation with additional type support

- **Refactor**
	- Updated connection and statement handling to use mutable references
	- Modified method signatures to improve flexibility and type management

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
codabrink authored Jan 14, 2025
1 parent 0aa5305 commit 5cca011
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
19 changes: 12 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ targets = ["wasm32-unknown-unknown"]

[dependencies]
talc = { version = "4.4", default-features = false, features = ["lock_api"] }
diesel = { version = "2.2", features = ["i-implement-a-third-party-backend-and-opt-into-breaking-changes"] }
diesel = { version = "2.2", features = [
"i-implement-a-third-party-backend-and-opt-into-breaking-changes",
] }
diesel_derives = "2.2"
wasm-bindgen = "=0.2.99"
wasm-bindgen-futures = "0.4"
wasm-bindgen = "=0.2.100"
wasm-bindgen-futures = "0.4.50"
js-sys = { version = "0.3" }
tracing = { version = "0.1", default-features = false }
tokio = { version = "1.38", default-features = false, features = ["sync"] }
Expand All @@ -30,16 +32,19 @@ serde-wasm-bindgen = "0.6"
thiserror = "2"

[dev-dependencies]
wasm-bindgen-test = "=0.3.49"
console_error_panic_hook = { version = "0.1"}
wasm-bindgen-test = "=0.3.50"
console_error_panic_hook = { version = "0.1" }
rand = "0.8"
getrandom = { version = "0.2", features = ["js"] }
web-sys = { version = "0.3", features = ["console"] }
chrono = { version = "0.4", features = ["wasmbind", "serde"] }
diesel_migrations = "2.2"
diesel = { version = "2.2", features = ["chrono"]}
diesel = { version = "2.2", features = ["chrono"] }
tracing-wasm = { version = "0.2" }
tracing-subscriber = { version = "0.3", features = ["env-filter", "tracing-log"] }
tracing-subscriber = { version = "0.3", features = [
"env-filter",
"tracing-log",
] }

[patch.crates-io]
diesel = { git = "https://github.com/diesel-rs/diesel", branch = "master" }
Expand Down
5 changes: 3 additions & 2 deletions src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ impl WasmSqliteConnection {
&source,
&WasmSqlite,
&[],
|sql, is_cached| Statement::prepare(raw_connection, sql, is_cached),
instrumentation.as_mut(),
raw_connection,
Statement::prepare,
&mut *instrumentation,
) {
Ok(statement) => statement,
Err(e) => {
Expand Down
3 changes: 2 additions & 1 deletion src/connection/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ impl Statement {
// since the statement pointer might be invalidated if a memory resize
// takes place.
pub fn prepare(
raw_connection: &RawConnection,
raw_connection: &mut RawConnection,
sql: &str,
is_cached: PrepareForCache,
_: &[SqliteType],
) -> QueryResult<Self> {
let sqlite3 = crate::get_sqlite_unchecked();

Expand Down

0 comments on commit 5cca011

Please sign in to comment.