mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-20 01:44:19 +01:00
27 lines
617 B
Rust
27 lines
617 B
Rust
use turso_sqlite3_parser::ast::Name;
|
|
|
|
use crate::{
|
|
schema::Schema,
|
|
vdbe::{builder::ProgramBuilder, insn::Insn},
|
|
Result, SymbolTable,
|
|
};
|
|
|
|
pub fn translate_rollback(
|
|
_schema: &Schema,
|
|
_syms: &SymbolTable,
|
|
mut program: ProgramBuilder,
|
|
txn_name: Option<Name>,
|
|
savepoint_name: Option<Name>,
|
|
) -> Result<ProgramBuilder> {
|
|
assert!(
|
|
txn_name.is_none() && savepoint_name.is_none(),
|
|
"txn_name and savepoint not supported yet"
|
|
);
|
|
program.emit_insn(Insn::AutoCommit {
|
|
auto_commit: true,
|
|
rollback: true,
|
|
});
|
|
program.rollback();
|
|
Ok(program)
|
|
}
|