Skip to content

Commit bdab520

Browse files
committed
libsql-server: WAL sync protocol support
1 parent d378c55 commit bdab520

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libsql-server/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ itertools = "0.10.5"
3737
jsonwebtoken = "9"
3838
libsql = { path = "../libsql/", optional = true }
3939
libsql_replication = { path = "../libsql-replication" }
40+
libsql_sync = { path = "../libsql-sync" }
4041
libsql-wal = { path = "../libsql-wal/" }
4142
libsql-storage = { path = "../libsql-storage", optional = true }
4243
metrics = "0.21.1"

libsql-server/src/rpc/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub mod replica_proxy;
2424
pub mod replication_log;
2525
pub mod replication_log_proxy;
2626
pub mod streaming_exec;
27+
pub mod sync;
2728

2829
pub async fn run_rpc_server<A: crate::net::Accept>(
2930
proxy_service: ProxyService,

libsql-server/src/rpc/sync.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use futures::stream::BoxStream;
2+
use libsql_sync::sync::rpc::wal_sync_server::WalSync;
3+
4+
pub struct SyncService {}
5+
6+
#[tonic::async_trait]
7+
impl WalSync for SyncService {
8+
type FetchDatabaseStream =
9+
BoxStream<'static, Result<libsql_sync::sync::rpc::DatabaseChunk, tonic::Status>>;
10+
11+
async fn fetch_database(
12+
&self,
13+
_request: tonic::Request<libsql_sync::sync::rpc::FetchDatabaseRequest>,
14+
) -> Result<tonic::Response<Self::FetchDatabaseStream>, tonic::Status> {
15+
unimplemented!()
16+
}
17+
18+
async fn pull_wal(
19+
&self,
20+
_request: tonic::Request<libsql_sync::sync::rpc::PullWalRequest>,
21+
) -> Result<tonic::Response<libsql_sync::sync::rpc::PullWalResponse>, tonic::Status> {
22+
unimplemented!()
23+
}
24+
25+
async fn push_wal(
26+
&self,
27+
_request: tonic::Request<libsql_sync::sync::rpc::PushWalRequest>,
28+
) -> Result<tonic::Response<libsql_sync::sync::rpc::PushWalResponse>, tonic::Status> {
29+
unimplemented!()
30+
}
31+
}

0 commit comments

Comments
 (0)