Skip to content

Commit ea16d88

Browse files
committed
Switch to Builder for automatic protocol detection
The Builder API detects the right sync protocol automatically.
1 parent 6688295 commit ea16d88

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ fn _connect_core(
130130
match sync_url {
131131
Some(sync_url) => {
132132
let sync_interval = sync_interval.map(|i| std::time::Duration::from_secs_f64(i));
133-
let fut = libsql::Database::open_with_remote_sync_internal(
134-
database,
135-
sync_url,
136-
auth_token,
137-
Some(ver),
138-
true,
139-
encryption_config,
140-
sync_interval,
141-
);
133+
let mut builder =
134+
libsql::Builder::new_remote_replica(database, sync_url, auth_token.to_string());
135+
if let Some(encryption_config) = encryption_config {
136+
builder = builder.encryption_config(encryption_config);
137+
}
138+
if let Some(sync_interval) = sync_interval {
139+
builder = builder.sync_interval(sync_interval);
140+
}
141+
let fut = builder.build();
142142
tokio::pin!(fut);
143143
let result = rt.block_on(check_signals(py, fut));
144144
result.map_err(to_py_err)?

0 commit comments

Comments
 (0)