File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -76,9 +76,7 @@ impl Connection {
76
76
// disabled so that we can sync our changes back to a remote
77
77
// server.
78
78
conn. query ( "PRAGMA journal_mode = WAL" , Params :: None ) ?;
79
- unsafe {
80
- ffi:: libsql_wal_disable_checkpoint ( conn. raw ) ;
81
- }
79
+ conn. wal_disable_checkpoint ( ) ?;
82
80
}
83
81
Ok ( conn)
84
82
}
@@ -554,6 +552,16 @@ impl Connection {
554
552
Ok ( buf)
555
553
}
556
554
555
+ fn wal_disable_checkpoint ( & self ) -> Result < ( ) > {
556
+ let rc = unsafe { libsql_sys:: ffi:: libsql_wal_disable_checkpoint ( self . handle ( ) ) } ;
557
+ if rc != 0 {
558
+ return Err ( crate :: errors:: Error :: SqliteFailure (
559
+ rc as std:: ffi:: c_int ,
560
+ format ! ( "wal_disable_checkpoint failed" ) ,
561
+ ) ) ;
562
+ }
563
+ Ok ( ( ) )
564
+ }
557
565
fn wal_insert_begin ( & self ) -> Result < ( ) > {
558
566
let rc = unsafe { libsql_sys:: ffi:: libsql_wal_insert_begin ( self . handle ( ) ) } ;
559
567
if rc != 0 {
You can’t perform that action at this time.
0 commit comments