mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-09 02:04:22 +01:00
make all run_once be run under statement or connection so that rollback is called
This commit is contained in:
@@ -13,12 +13,12 @@ use turso_core::Connection;
|
||||
#[derive(Clone)]
|
||||
pub struct TursoConnection {
|
||||
pub(crate) conn: Arc<Connection>,
|
||||
pub(crate) io: Arc<dyn turso_core::IO>,
|
||||
pub(crate) _io: Arc<dyn turso_core::IO>,
|
||||
}
|
||||
|
||||
impl TursoConnection {
|
||||
pub fn new(conn: Arc<Connection>, io: Arc<dyn turso_core::IO>) -> Self {
|
||||
TursoConnection { conn, io }
|
||||
TursoConnection { conn, _io: io }
|
||||
}
|
||||
|
||||
#[allow(clippy::wrong_self_convention)]
|
||||
|
||||
@@ -76,7 +76,7 @@ pub extern "system" fn Java_tech_turso_core_TursoStatement_step<'local>(
|
||||
};
|
||||
}
|
||||
StepResult::IO => {
|
||||
if let Err(e) = stmt.connection.io.run_once() {
|
||||
if let Err(e) = stmt.stmt.run_once() {
|
||||
set_err_msg_and_throw_exception(&mut env, obj, TURSO_ETC, e.to_string());
|
||||
return to_turso_step_result(&mut env, STEP_RESULT_ID_ERROR, None);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user