Skip to content

Commit c708528

Browse files
committed
Update example to do integrity check after sync
1 parent 9a65514 commit c708528

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libsql/examples/remote_sync.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ async fn main() {
4848
print!("Syncing with remote database...");
4949
db.sync().await.unwrap();
5050
println!(" done");
51-
51+
{
52+
let mut stmt = conn.prepare("PRAGMA integrity_check").await.unwrap();
53+
let mut rows = stmt.query(()).await.unwrap();
54+
let result: String = rows.next().await.unwrap().unwrap().get(0).unwrap();
55+
assert_eq!(result, "ok", "integrity check failed after sync");
56+
println!("Integrity check passed after sync");
57+
}
5258
conn.execute(
5359
r#"
5460
CREATE TABLE IF NOT EXISTS guest_book_entries (

0 commit comments

Comments
 (0)