File tree Expand file tree Collapse file tree 7 files changed +37
-0
lines changed Expand file tree Collapse file tree 7 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ impl Statement {
82
82
unsafe { crate :: ffi:: sqlite3_step ( self . raw_stmt ) }
83
83
}
84
84
85
+ pub fn interrupt ( & self ) {
86
+ unsafe { crate :: ffi:: libsql_stmt_interrupt ( self . raw_stmt ) }
87
+ }
88
+
85
89
pub fn reset ( & self ) -> std:: ffi:: c_int {
86
90
unsafe { crate :: ffi:: sqlite3_reset ( self . raw_stmt ) }
87
91
}
Original file line number Diff line number Diff line change @@ -205,6 +205,12 @@ impl crate::statement::Stmt for crate::hrana::Statement<HttpSender> {
205
205
self . run ( params) . await
206
206
}
207
207
208
+ fn interrupt ( & mut self ) -> crate :: Result < ( ) > {
209
+ Err ( crate :: Error :: Misuse (
210
+ "interrupt is not supported for remote connections" . to_string ( ) ,
211
+ ) )
212
+ }
213
+
208
214
fn reset ( & mut self ) { }
209
215
210
216
fn parameter_count ( & self ) -> usize {
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ impl Stmt for LibsqlStmt {
120
120
stmt. run ( & params)
121
121
}
122
122
123
+ fn interrupt ( & mut self ) -> Result < ( ) > {
124
+ self . 0 . interrupt ( )
125
+ }
126
+
123
127
fn reset ( & mut self ) {
124
128
self . 0 . reset ( ) ;
125
129
}
Original file line number Diff line number Diff line change @@ -134,6 +134,12 @@ impl Statement {
134
134
}
135
135
}
136
136
137
+ /// Interrupt the statement.
138
+ pub fn interrupt ( & self ) -> Result < ( ) > {
139
+ self . inner . interrupt ( ) ;
140
+ Ok ( ( ) )
141
+ }
142
+
137
143
/// Reset the prepared statement to initial state for reuse.
138
144
pub fn reset ( & self ) {
139
145
self . inner . reset ( ) ;
Original file line number Diff line number Diff line change @@ -732,6 +732,12 @@ impl Stmt for RemoteStatement {
732
732
Ok ( ( ) )
733
733
}
734
734
735
+ fn interrupt ( & mut self ) -> Result < ( ) > {
736
+ Err ( Error :: Misuse (
737
+ "interrupt is not supported for remote connections" . to_string ( ) ,
738
+ ) )
739
+ }
740
+
735
741
fn reset ( & mut self ) { }
736
742
737
743
fn parameter_count ( & self ) -> usize {
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ pub(crate) trait Stmt {
14
14
15
15
async fn run ( & mut self , params : & Params ) -> Result < ( ) > ;
16
16
17
+ fn interrupt ( & mut self ) -> Result < ( ) > ;
18
+
17
19
fn reset ( & mut self ) ;
18
20
19
21
fn parameter_count ( & self ) -> usize ;
@@ -60,6 +62,11 @@ impl Statement {
60
62
Ok ( ( ) )
61
63
}
62
64
65
+ /// Interrupt the statement.
66
+ pub fn interrupt ( & mut self ) -> Result < ( ) > {
67
+ self . inner . interrupt ( )
68
+ }
69
+
63
70
/// Execute a query that returns the first [`Row`].
64
71
///
65
72
/// # Errors
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ impl Stmt for SyncedStatement {
40
40
result
41
41
}
42
42
43
+ fn interrupt ( & mut self ) -> Result < ( ) > {
44
+ self . inner . interrupt ( )
45
+ }
46
+
43
47
fn reset ( & mut self ) {
44
48
self . inner . reset ( )
45
49
}
You can’t perform that action at this time.
0 commit comments