Skip to content

Commit c088689

Browse files
committed
Fixed build
1 parent 05a954a commit c088689

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/binding.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)