File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -52,20 +52,13 @@ impl TursoConnection {
5252 let params: Vec < Value > = stmt. binds . clone ( ) ;
5353 let result = self . conn . execute ( & stmt. sql , params) . await ;
5454
55- // TODO: this is a workaround for handling unexpected rows during execution, means it should be a query not an execute
55+ // TODO: Workaround: some statements (like PRAGMA) return rows but are called via execute()
5656 let rows_affected = match result {
5757 Ok ( res) => res,
58- Err ( e) => match e {
59- turso:: Error :: SqlExecutionFailure ( msg) => match msg. as_str ( ) {
60- "unexpected row during execution" => {
61- return self . query ( stmt) . await ;
62- }
63- _ => {
64- return Err ( turso:: Error :: SqlExecutionFailure ( msg) ) ;
65- }
66- } ,
67- _ => return Err ( e) ,
68- } ,
58+ Err ( turso:: Error :: Misuse ( msg) ) if msg. contains ( "unexpected row" ) => {
59+ return self . query ( stmt) . await ;
60+ }
61+ Err ( e) => return Err ( e) ,
6962 } ;
7063
7164 Ok ( TursoResult {
You can’t perform that action at this time.
0 commit comments