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.
Files changed (47) hide show
  1. {libsql-0.1.8 → libsql-0.1.10}/Cargo.lock +13 -13
  2. {libsql-0.1.8 → libsql-0.1.10}/Cargo.toml +3 -2
  3. {libsql-0.1.8 → libsql-0.1.10}/PKG-INFO +1 -1
  4. {libsql-0.1.8 → libsql-0.1.10}/pyproject.toml +1 -1
  5. {libsql-0.1.8 → libsql-0.1.10}/src/lib.rs +13 -5
  6. {libsql-0.1.8 → libsql-0.1.10}/.github/workflows/CI.yml +0 -0
  7. {libsql-0.1.8 → libsql-0.1.10}/.github/workflows/pr-tests.yml +0 -0
  8. {libsql-0.1.8 → libsql-0.1.10}/.gitignore +0 -0
  9. {libsql-0.1.8 → libsql-0.1.10}/CONTRIBUTING.md +0 -0
  10. {libsql-0.1.8 → libsql-0.1.10}/LICENSE.md +0 -0
  11. {libsql-0.1.8 → libsql-0.1.10}/README.md +0 -0
  12. {libsql-0.1.8 → libsql-0.1.10}/build.rs +0 -0
  13. {libsql-0.1.8 → libsql-0.1.10}/docs/api.md +0 -0
  14. {libsql-0.1.8 → libsql-0.1.10}/example.py +0 -0
  15. {libsql-0.1.8 → libsql-0.1.10}/examples/batch/.gitignore +0 -0
  16. {libsql-0.1.8 → libsql-0.1.10}/examples/batch/README.md +0 -0
  17. {libsql-0.1.8 → libsql-0.1.10}/examples/batch/main.py +0 -0
  18. {libsql-0.1.8 → libsql-0.1.10}/examples/encryption/.gitignore +0 -0
  19. {libsql-0.1.8 → libsql-0.1.10}/examples/encryption/README.md +0 -0
  20. {libsql-0.1.8 → libsql-0.1.10}/examples/encryption/main.py +0 -0
  21. {libsql-0.1.8 → libsql-0.1.10}/examples/execute_script.py +0 -0
  22. {libsql-0.1.8 → libsql-0.1.10}/examples/local/.gitignore +0 -0
  23. {libsql-0.1.8 → libsql-0.1.10}/examples/local/README.md +0 -0
  24. {libsql-0.1.8 → libsql-0.1.10}/examples/local/main.py +0 -0
  25. {libsql-0.1.8 → libsql-0.1.10}/examples/memory/README.md +0 -0
  26. {libsql-0.1.8 → libsql-0.1.10}/examples/memory/main.py +0 -0
  27. {libsql-0.1.8 → libsql-0.1.10}/examples/remote/README.md +0 -0
  28. {libsql-0.1.8 → libsql-0.1.10}/examples/remote/main.py +0 -0
  29. {libsql-0.1.8 → libsql-0.1.10}/examples/remote_connect.py +0 -0
  30. {libsql-0.1.8 → libsql-0.1.10}/examples/sqlalchemy/dialect.py +0 -0
  31. {libsql-0.1.8 → libsql-0.1.10}/examples/sqlalchemy/example.py +0 -0
  32. {libsql-0.1.8 → libsql-0.1.10}/examples/statements.sql +0 -0
  33. {libsql-0.1.8 → libsql-0.1.10}/examples/sync/.gitignore +0 -0
  34. {libsql-0.1.8 → libsql-0.1.10}/examples/sync/README.md +0 -0
  35. {libsql-0.1.8 → libsql-0.1.10}/examples/sync/main.py +0 -0
  36. {libsql-0.1.8 → libsql-0.1.10}/examples/sync_write.py +0 -0
  37. {libsql-0.1.8 → libsql-0.1.10}/examples/transaction/.gitignore +0 -0
  38. {libsql-0.1.8 → libsql-0.1.10}/examples/transaction/README.md +0 -0
  39. {libsql-0.1.8 → libsql-0.1.10}/examples/transaction/main.py +0 -0
  40. {libsql-0.1.8 → libsql-0.1.10}/examples/vector/.gitignore +0 -0
  41. {libsql-0.1.8 → libsql-0.1.10}/examples/vector/README.md +0 -0
  42. {libsql-0.1.8 → libsql-0.1.10}/examples/vector/main.py +0 -0
  43. {libsql-0.1.8 → libsql-0.1.10}/examples/vector.py +0 -0
  44. {libsql-0.1.8 → libsql-0.1.10}/perf-libsql.py +0 -0
  45. {libsql-0.1.8 → libsql-0.1.10}/perf-sqlite3.py +0 -0
  46. {libsql-0.1.8 → libsql-0.1.10}/shell.nix +0 -0
  47. {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.19"
835
+ version = "0.9.21"
836
836
  source = "registry+https://github.com/rust-lang/crates.io-index"
837
- checksum = "c92f460194a673c29e82520a061a82f83892faca9ce6881db93d591cd38cb3dc"
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.19"
875
+ version = "0.9.21"
876
876
  source = "registry+https://github.com/rust-lang/crates.io-index"
877
- checksum = "64691b229b9d5c0754115f59a0e5c0d1bcc102bfe402b96f2bbf9d5150a4ab3c"
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.19"
887
+ version = "0.9.21"
888
888
  source = "registry+https://github.com/rust-lang/crates.io-index"
889
- checksum = "c18b78daf4af8603c048f584faada18c8970f4f3af16df0c3319a92c90d0d696"
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.19"
899
+ version = "0.9.21"
900
900
  source = "registry+https://github.com/rust-lang/crates.io-index"
901
- checksum = "c502ebc6fd1a7ba1b686c47226016fb8e913080c4021491bda33ca33c6fa1ab4"
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.19"
931
+ version = "0.9.21"
932
932
  source = "registry+https://github.com/rust-lang/crates.io-index"
933
- checksum = "9e7b9ab82fa6122efe2b2fe066043d6330aa4a7aa656b4ec0df9768ffd1ea6a0"
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.19"
945
+ version = "0.9.21"
946
946
  source = "registry+https://github.com/rust-lang/crates.io-index"
947
- checksum = "aa911faee7c1e039a44aeced5e61b5106fb714782e26d89216c87c83eb1ce410"
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.8"
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.8"
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.19", features = ["encryption"] }
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libsql
3
- Version: 0.1.8
3
+ Version: 0.1.10
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "libsql"
7
- version = "0.1.8"
7
+ version = "0.1.10"
8
8
  requires-python = ">=3.7"
9
9
  classifiers = [
10
10
  "Programming Language :: Rust",
@@ -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::new_remote_replica(
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(encryption_config) = encryption_config {
156
- builder = builder.encryption_config(encryption_config);
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