diff --git a/Cargo.lock b/Cargo.lock index 50ba6a2..ae7c478 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -646,8 +646,8 @@ dependencies = [ [[package]] name = "libsql" -version = "0.2.0-alpha.1" -source = "git+https://github.com/tursodatabase/libsql/?rev=52814a9841792330d290f950f2c49f49f6c77e42#52814a9841792330d290f950f2c49f49f6c77e42" +version = "0.2.0" +source = "git+https://github.com/tursodatabase/libsql/?rev=b01500237f2a1cd137681ef1d86edf482e848c29#b01500237f2a1cd137681ef1d86edf482e848c29" dependencies = [ "anyhow", "async-stream", @@ -661,15 +661,16 @@ dependencies = [ "http", "hyper", "hyper-rustls", - "libsql-replication", + "libsql-sqlite3-parser", "libsql-sys", + "libsql_replication", "parking_lot", "serde", "serde_json", - "sqlite3-parser", "thiserror", "tokio", "tokio-stream", + "tokio-util", "tonic", "tonic-web", "tower", @@ -682,7 +683,7 @@ dependencies = [ [[package]] name = "libsql-ffi" version = "0.1.0" -source = "git+https://github.com/tursodatabase/libsql/?rev=52814a9841792330d290f950f2c49f49f6c77e42#52814a9841792330d290f950f2c49f49f6c77e42" +source = "git+https://github.com/tursodatabase/libsql/?rev=b01500237f2a1cd137681ef1d86edf482e848c29#b01500237f2a1cd137681ef1d86edf482e848c29" dependencies = [ "bindgen", "cc", @@ -699,17 +700,64 @@ dependencies = [ ] [[package]] -name = "libsql-replication" -version = "0.1.0" -source = "git+https://github.com/tursodatabase/libsql/?rev=52814a9841792330d290f950f2c49f49f6c77e42#52814a9841792330d290f950f2c49f49f6c77e42" +name = "libsql-rusqlite" +version = "0.29.0" +source = "git+https://github.com/tursodatabase/libsql/?rev=b01500237f2a1cd137681ef1d86edf482e848c29#b01500237f2a1cd137681ef1d86edf482e848c29" +dependencies = [ + "bitflags 2.4.1", + "fallible-iterator 0.2.0", + "fallible-streaming-iterator", + "hashlink", + "libsql-ffi", + "smallvec", +] + +[[package]] +name = "libsql-sqlite3-parser" +version = "0.11.1" +source = "git+https://github.com/tursodatabase/libsql/?rev=b01500237f2a1cd137681ef1d86edf482e848c29#b01500237f2a1cd137681ef1d86edf482e848c29" +dependencies = [ + "bitflags 2.4.1", + "cc", + "fallible-iterator 0.3.0", + "indexmap 2.1.0", + "log", + "memchr", + "phf", + "phf_codegen", + "phf_shared", + "smallvec", + "uncased", +] + +[[package]] +name = "libsql-sys" +version = "0.3.0" +source = "git+https://github.com/tursodatabase/libsql/?rev=b01500237f2a1cd137681ef1d86edf482e848c29#b01500237f2a1cd137681ef1d86edf482e848c29" +dependencies = [ + "base64", + "bytes", + "libsql-ffi", + "libsql-rusqlite", + "once_cell", + "prost", + "serde", + "tracing", + "zerocopy", +] + +[[package]] +name = "libsql_replication" +version = "0.2.0" +source = "git+https://github.com/tursodatabase/libsql/?rev=b01500237f2a1cd137681ef1d86edf482e848c29#b01500237f2a1cd137681ef1d86edf482e848c29" dependencies = [ "async-stream", "async-trait", "bytes", + "libsql-rusqlite", "libsql-sys", "parking_lot", "prost", - "rusqlite", "serde", "thiserror", "tokio", @@ -721,18 +769,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "libsql-sys" -version = "0.2.14" -source = "git+https://github.com/tursodatabase/libsql/?rev=52814a9841792330d290f950f2c49f49f6c77e42#52814a9841792330d290f950f2c49f49f6c77e42" -dependencies = [ - "libsql-ffi", - "once_cell", - "rusqlite", - "tracing", - "zerocopy", -] - [[package]] name = "linux-raw-sys" version = "0.4.12" @@ -1170,19 +1206,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rusqlite" -version = "0.29.0" -source = "git+https://github.com/tursodatabase/libsql/?rev=52814a9841792330d290f950f2c49f49f6c77e42#52814a9841792330d290f950f2c49f49f6c77e42" -dependencies = [ - "bitflags 2.4.1", - "fallible-iterator 0.2.0", - "fallible-streaming-iterator", - "hashlink", - "libsql-ffi", - "smallvec", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -1403,24 +1426,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "sqlite3-parser" -version = "0.11.0" -source = "git+https://github.com/tursodatabase/libsql/?rev=52814a9841792330d290f950f2c49f49f6c77e42#52814a9841792330d290f950f2c49f49f6c77e42" -dependencies = [ - "bitflags 2.4.1", - "cc", - "fallible-iterator 0.3.0", - "indexmap 2.1.0", - "log", - "memchr", - "phf", - "phf_codegen", - "phf_shared", - "smallvec", - "uncased", -] - [[package]] name = "syn" version = "1.0.109" diff --git a/Cargo.toml b/Cargo.toml index c544943..1fcbc51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,6 @@ crate-type = ["cdylib"] [dependencies] pyo3 = "0.19.0" -libsql = { git = "https://github.com/tursodatabase/libsql/", rev = "52814a9841792330d290f950f2c49f49f6c77e42" } +libsql = { git = "https://github.com/tursodatabase/libsql/", rev = "b01500237f2a1cd137681ef1d86edf482e848c29" } tokio = { version = "1.29.1", features = [ "rt-multi-thread" ] } tracing-subscriber = "0.3" diff --git a/src/lib.rs b/src/lib.rs index 939f6a7..dd0a783 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,6 +43,7 @@ fn connect( auth_token, Some(ver), true, + None, ); let result = rt.block_on(fut); result.map_err(to_py_err)? @@ -220,7 +221,7 @@ impl Cursor { let mut rows = self_.rows.borrow_mut(); match rows.as_mut() { Some(rows) => { - let row = rows.next().map_err(to_py_err)?; + let row = self_.rt.block_on(rows.next()).map_err(to_py_err)?; match row { Some(row) => { let row = convert_row(self_.py(), row, rows.column_count())?; @@ -244,7 +245,7 @@ impl Cursor { // done before iterating. if !*self_.done.borrow() { for _ in 0..size { - let row = rows.next().map_err(to_py_err)?; + let row = self_.rt.block_on(rows.next()).map_err(to_py_err)?; match row { Some(row) => { let row = convert_row(self_.py(), row, rows.column_count())?; @@ -269,7 +270,7 @@ impl Cursor { Some(rows) => { let mut elements: Vec> = vec![]; loop { - let row = rows.next().map_err(to_py_err)?; + let row = self_.rt.block_on(rows.next()).map_err(to_py_err)?; match row { Some(row) => { let row = convert_row(self_.py(), row, rows.column_count())?;