File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,9 +76,7 @@ impl Connection {
7676 // disabled so that we can sync our changes back to a remote
7777 // server.
7878 conn. query ( "PRAGMA journal_mode = WAL" , Params :: None ) ?;
79- unsafe {
80- ffi:: libsql_wal_disable_checkpoint ( conn. raw ) ;
81- }
79+ conn. wal_disable_checkpoint ( ) ?;
8280 }
8381 Ok ( conn)
8482 }
@@ -554,6 +552,16 @@ impl Connection {
554552 Ok ( buf)
555553 }
556554
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+ }
557565 fn wal_insert_begin ( & self ) -> Result < ( ) > {
558566 let rc = unsafe { libsql_sys:: ffi:: libsql_wal_insert_begin ( self . handle ( ) ) } ;
559567 if rc != 0 {
You can’t perform that action at this time.
0 commit comments