libsql 0.1.8__tar.gz → 0.1.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {libsql-0.1.8 → libsql-0.1.10}/Cargo.lock +13 -13
- {libsql-0.1.8 → libsql-0.1.10}/Cargo.toml +3 -2
- {libsql-0.1.8 → libsql-0.1.10}/PKG-INFO +1 -1
- {libsql-0.1.8 → libsql-0.1.10}/pyproject.toml +1 -1
- {libsql-0.1.8 → libsql-0.1.10}/src/lib.rs +13 -5
- {libsql-0.1.8 → libsql-0.1.10}/.github/workflows/CI.yml +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/.github/workflows/pr-tests.yml +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/.gitignore +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/CONTRIBUTING.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/LICENSE.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/README.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/build.rs +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/docs/api.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/example.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/batch/.gitignore +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/batch/README.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/batch/main.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/encryption/.gitignore +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/encryption/README.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/encryption/main.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/execute_script.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/local/.gitignore +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/local/README.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/local/main.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/memory/README.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/memory/main.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/remote/README.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/remote/main.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/remote_connect.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/sqlalchemy/dialect.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/sqlalchemy/example.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/statements.sql +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/sync/.gitignore +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/sync/README.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/sync/main.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/sync_write.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/transaction/.gitignore +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/transaction/README.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/transaction/main.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/vector/.gitignore +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/vector/README.md +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/vector/main.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/examples/vector.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/perf-libsql.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/perf-sqlite3.py +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/shell.nix +0 -0
- {libsql-0.1.8 → libsql-0.1.10}/tests/test_suite.py +0 -0
|
@@ -832,9 +832,9 @@ dependencies = [
|
|
|
832
832
|
|
|
833
833
|
[[package]]
|
|
834
834
|
name = "libsql"
|
|
835
|
-
version = "0.9.
|
|
835
|
+
version = "0.9.21"
|
|
836
836
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
837
|
-
checksum = "
|
|
837
|
+
checksum = "cfe6433aeb55f357fad8a2504ba221cc712072c406fc8531a6ee852e40f88b86"
|
|
838
838
|
dependencies = [
|
|
839
839
|
"anyhow",
|
|
840
840
|
"async-stream",
|
|
@@ -872,9 +872,9 @@ dependencies = [
|
|
|
872
872
|
|
|
873
873
|
[[package]]
|
|
874
874
|
name = "libsql-ffi"
|
|
875
|
-
version = "0.9.
|
|
875
|
+
version = "0.9.21"
|
|
876
876
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
877
|
-
checksum = "
|
|
877
|
+
checksum = "c0861417fd61c30c1bf286dc4a528771a95f4c83e55592eae0064431d17abfe2"
|
|
878
878
|
dependencies = [
|
|
879
879
|
"bindgen",
|
|
880
880
|
"cc",
|
|
@@ -884,9 +884,9 @@ dependencies = [
|
|
|
884
884
|
|
|
885
885
|
[[package]]
|
|
886
886
|
name = "libsql-hrana"
|
|
887
|
-
version = "0.9.
|
|
887
|
+
version = "0.9.21"
|
|
888
888
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
889
|
-
checksum = "
|
|
889
|
+
checksum = "b7064534a514c59f219120987f1ec5a279bd3245cfac25e7e0c47148cfd1dd19"
|
|
890
890
|
dependencies = [
|
|
891
891
|
"base64 0.21.7",
|
|
892
892
|
"bytes",
|
|
@@ -896,9 +896,9 @@ dependencies = [
|
|
|
896
896
|
|
|
897
897
|
[[package]]
|
|
898
898
|
name = "libsql-rusqlite"
|
|
899
|
-
version = "0.9.
|
|
899
|
+
version = "0.9.21"
|
|
900
900
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
901
|
-
checksum = "
|
|
901
|
+
checksum = "f6ac1084b9af3e62242282aa09894df6c970561ef3c5334f23044ff3a13e447e"
|
|
902
902
|
dependencies = [
|
|
903
903
|
"bitflags 2.6.0",
|
|
904
904
|
"fallible-iterator 0.2.0",
|
|
@@ -928,9 +928,9 @@ dependencies = [
|
|
|
928
928
|
|
|
929
929
|
[[package]]
|
|
930
930
|
name = "libsql-sys"
|
|
931
|
-
version = "0.9.
|
|
931
|
+
version = "0.9.21"
|
|
932
932
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
933
|
-
checksum = "
|
|
933
|
+
checksum = "a2b091e184462fa3d6bbb32f29911babd3c4493857155db98c67bc55e1c85362"
|
|
934
934
|
dependencies = [
|
|
935
935
|
"bytes",
|
|
936
936
|
"libsql-ffi",
|
|
@@ -942,9 +942,9 @@ dependencies = [
|
|
|
942
942
|
|
|
943
943
|
[[package]]
|
|
944
944
|
name = "libsql_replication"
|
|
945
|
-
version = "0.9.
|
|
945
|
+
version = "0.9.21"
|
|
946
946
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
947
|
-
checksum = "
|
|
947
|
+
checksum = "0f0aad4d9f4c6c153d15e85aeb0d0e201fa2f2155c63abd6e995b945815f6d78"
|
|
948
948
|
dependencies = [
|
|
949
949
|
"aes",
|
|
950
950
|
"async-stream",
|
|
@@ -1260,7 +1260,7 @@ dependencies = [
|
|
|
1260
1260
|
|
|
1261
1261
|
[[package]]
|
|
1262
1262
|
name = "pylibsql"
|
|
1263
|
-
version = "0.1.
|
|
1263
|
+
version = "0.1.10"
|
|
1264
1264
|
dependencies = [
|
|
1265
1265
|
"libsql",
|
|
1266
1266
|
"pyo3",
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "pylibsql"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.10"
|
|
4
4
|
edition = "2024"
|
|
5
|
+
readme = "README.md"
|
|
5
6
|
|
|
6
7
|
[lib]
|
|
7
8
|
crate-type = ["cdylib"]
|
|
8
9
|
|
|
9
10
|
[dependencies]
|
|
10
11
|
pyo3 = "0.25.1"
|
|
11
|
-
libsql = { version = "0.9.
|
|
12
|
+
libsql = { version = "0.9.21", features = ["encryption"] }
|
|
12
13
|
tokio = { version = "1.47.0", features = [ "rt-multi-thread" ] }
|
|
13
14
|
tracing-subscriber = "0.3.19"
|
|
14
15
|
|
|
@@ -49,7 +49,7 @@ fn is_remote_path(path: &str) -> bool {
|
|
|
49
49
|
|
|
50
50
|
#[pyfunction]
|
|
51
51
|
#[cfg(not(Py_3_12))]
|
|
52
|
-
#[pyo3(signature = (database, timeout=5.0, isolation_level="DEFERRED".to_string(), _check_same_thread=true, _uri=false, sync_url=None, sync_interval=None, auth_token="", encryption_key=None))]
|
|
52
|
+
#[pyo3(signature = (database, timeout=5.0, isolation_level="DEFERRED".to_string(), _check_same_thread=true, _uri=false, sync_url=None, sync_interval=None, offline=false, auth_token="", encryption_key=None))]
|
|
53
53
|
fn connect(
|
|
54
54
|
py: Python<'_>,
|
|
55
55
|
database: String,
|
|
@@ -59,6 +59,7 @@ fn connect(
|
|
|
59
59
|
_uri: bool,
|
|
60
60
|
sync_url: Option<String>,
|
|
61
61
|
sync_interval: Option<f64>,
|
|
62
|
+
offline: bool,
|
|
62
63
|
auth_token: &str,
|
|
63
64
|
encryption_key: Option<String>,
|
|
64
65
|
) -> PyResult<Connection> {
|
|
@@ -71,6 +72,7 @@ fn connect(
|
|
|
71
72
|
_uri,
|
|
72
73
|
sync_url,
|
|
73
74
|
sync_interval,
|
|
75
|
+
offline,
|
|
74
76
|
auth_token,
|
|
75
77
|
encryption_key,
|
|
76
78
|
)?;
|
|
@@ -79,7 +81,7 @@ fn connect(
|
|
|
79
81
|
|
|
80
82
|
#[pyfunction]
|
|
81
83
|
#[cfg(Py_3_12)]
|
|
82
|
-
#[pyo3(signature = (database, timeout=5.0, isolation_level="DEFERRED".to_string(), _check_same_thread=true, _uri=false, sync_url=None, sync_interval=None, auth_token="", encryption_key=None, autocommit = LEGACY_TRANSACTION_CONTROL))]
|
|
84
|
+
#[pyo3(signature = (database, timeout=5.0, isolation_level="DEFERRED".to_string(), _check_same_thread=true, _uri=false, sync_url=None, sync_interval=None, offline=false, auth_token="", encryption_key=None, autocommit = LEGACY_TRANSACTION_CONTROL))]
|
|
83
85
|
fn connect(
|
|
84
86
|
py: Python<'_>,
|
|
85
87
|
database: String,
|
|
@@ -89,6 +91,7 @@ fn connect(
|
|
|
89
91
|
_uri: bool,
|
|
90
92
|
sync_url: Option<String>,
|
|
91
93
|
sync_interval: Option<f64>,
|
|
94
|
+
offline: bool,
|
|
92
95
|
auth_token: &str,
|
|
93
96
|
encryption_key: Option<String>,
|
|
94
97
|
autocommit: i32,
|
|
@@ -102,6 +105,7 @@ fn connect(
|
|
|
102
105
|
_uri,
|
|
103
106
|
sync_url,
|
|
104
107
|
sync_interval,
|
|
108
|
+
offline,
|
|
105
109
|
auth_token,
|
|
106
110
|
encryption_key,
|
|
107
111
|
)?;
|
|
@@ -126,6 +130,7 @@ fn _connect_core(
|
|
|
126
130
|
_uri: bool,
|
|
127
131
|
sync_url: Option<String>,
|
|
128
132
|
sync_interval: Option<f64>,
|
|
133
|
+
offline: bool,
|
|
129
134
|
auth_token: &str,
|
|
130
135
|
encryption_key: Option<String>,
|
|
131
136
|
) -> PyResult<Connection> {
|
|
@@ -147,17 +152,20 @@ fn _connect_core(
|
|
|
147
152
|
match sync_url {
|
|
148
153
|
Some(sync_url) => {
|
|
149
154
|
let sync_interval = sync_interval.map(|i| std::time::Duration::from_secs_f64(i));
|
|
150
|
-
let mut builder = libsql_core::Builder::
|
|
155
|
+
let mut builder = libsql_core::Builder::new_synced_database(
|
|
151
156
|
database,
|
|
152
157
|
sync_url,
|
|
153
158
|
auth_token.to_string(),
|
|
154
159
|
);
|
|
155
|
-
if let Some(
|
|
156
|
-
|
|
160
|
+
if let Some(_) = encryption_config {
|
|
161
|
+
return Err(PyValueError::new_err(
|
|
162
|
+
"encryption is not supported for synced databases",
|
|
163
|
+
));
|
|
157
164
|
}
|
|
158
165
|
if let Some(sync_interval) = sync_interval {
|
|
159
166
|
builder = builder.sync_interval(sync_interval);
|
|
160
167
|
}
|
|
168
|
+
builder = builder.remote_writes(!offline);
|
|
161
169
|
let fut = builder.build();
|
|
162
170
|
tokio::pin!(fut);
|
|
163
171
|
let result = rt.block_on(check_signals(py, fut));
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|