From e8e583ace650b4368e231c70c7f3c9857bfe7446 Mon Sep 17 00:00:00 2001 From: Jussi Saurio Date: Thu, 16 Oct 2025 14:28:18 +0300 Subject: [PATCH] Default ON CONFLICT behavior should be ROLLBACK --- core/translate/insert.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/translate/insert.rs b/core/translate/insert.rs index f989953f6..64bd29ed6 100644 --- a/core/translate/insert.rs +++ b/core/translate/insert.rs @@ -232,7 +232,7 @@ pub fn translate_insert( &table, &mut body, connection, - on_conflict.unwrap_or(ResolveType::Abort), + on_conflict.unwrap_or(ResolveType::Rollback), )?; if inserting_multiple_rows && btree_table.has_autoincrement { @@ -976,7 +976,10 @@ fn bind_insert( next: None, })); } - ResolveType::Abort => {} + ResolveType::Rollback => { + // This is the current default behavior for INSERT in tursodb - the transaction will be rolled back if the insert fails. + // In SQLite, the default is ABORT and we should use that one once we support subtransactions. + } _ => { crate::bail_parse_error!( "INSERT OR {} is only supported with UPSERT",