Skip to content

Commit 4e5ca0f

Browse files
committed
libsql: Initial offline write support
This patch add initial support for offline writes. To open a local database that can sync to remote server, use the Builder::new_synced_database() API. The protocol on server side is simple: **POST** `/sync/<generation>/<start_frame>/<end_frame>` where request body is the WAL frames.
1 parent 246667c commit 4e5ca0f

File tree

11 files changed

+577
-47
lines changed

11 files changed

+577
-47
lines changed

Cargo.lock

Lines changed: 200 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libsql/Cargo.toml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ fallible-iterator = { version = "0.3", optional = true }
4242

4343
libsql_replication = { version = "0.6", path = "../libsql-replication", optional = true }
4444
async-stream = { version = "0.3.5", optional = true }
45+
reqwest = { version = "0.12.9", default-features = false, features = [ "rustls-tls" ], optional = true }
4546

4647
[dev-dependencies]
4748
criterion = { version = "0.5", features = ["html_reports", "async", "async_futures", "async_tokio"] }
@@ -53,7 +54,7 @@ tempfile = { version = "3.7.0" }
5354
rand = "0.8.5"
5455

5556
[features]
56-
default = ["core", "replication", "remote", "tls"]
57+
default = ["core", "replication", "remote", "sync", "tls"]
5758
core = [
5859
"libsql-sys",
5960
"dep:bitflags",
@@ -91,6 +92,21 @@ replication = [
9192
"dep:futures",
9293
"dep:libsql_replication",
9394
]
95+
sync = [
96+
"core",
97+
"parser",
98+
"serde",
99+
"stream",
100+
"dep:tower",
101+
"dep:hyper",
102+
"dep:http",
103+
"dep:tokio",
104+
"dep:zerocopy",
105+
"dep:bytes",
106+
"dep:tokio",
107+
"dep:futures",
108+
"dep:reqwest",
109+
]
94110
hrana = [
95111
"parser",
96112
"serde",

0 commit comments

Comments
 (0)