We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b67e65 commit 072bd9bCopy full SHA for 072bd9b
src/lib/database_drivers/libsql.rs
@@ -44,7 +44,7 @@ impl DatabaseDriver for LibSQLDriver {
44
fn execute<'a>(
45
&'a mut self,
46
query: &'a str,
47
- _run_in_transaction: bool,
+ run_in_transaction: bool,
48
) -> Pin<Box<dyn Future<Output = Result<(), anyhow::Error>> + '_>> {
49
let fut = async move {
50
let queries = query
@@ -53,7 +53,18 @@ impl DatabaseDriver for LibSQLDriver {
53
.map(Statement::new)
54
.collect::<Vec<Statement>>();
55
56
- self.db.batch(queries).await?;
+ if run_in_transaction {
57
+ self.db.batch(queries).await?;
58
+ } else {
59
+ for query in queries {
60
+ match self.db.execute(query).await {
61
+ Ok(_) => {}
62
+ Err(e) => {
63
+ bail!("{:?}", e);
64
+ }
65
66
67
68
69
Ok(())
70
};
0 commit comments