mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 17:14:20 +01:00
24 lines
529 B
Rust
24 lines
529 B
Rust
use turso_parser::ast::Name;
|
|
|
|
use crate::{
|
|
vdbe::{builder::ProgramBuilder, insn::Insn},
|
|
Result,
|
|
};
|
|
|
|
pub fn translate_rollback(
|
|
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)
|
|
}
|