mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-21 00:54:19 +01:00
implement write side of pragma schema_version
It is insane that SQLite even allows this. They actually don't if "defensive mode" is enabled: "It is always safe to read the schema_version, but changing the schema_version can cause problems. For this reason, attempts to change the value of schema_version are a silent no-op when defensive mode is enabled for a database connection. Warning: Misuse of this pragma can result in database corruption." We also update the compat table, which was not updated to reflect the read version of this pragma being implemented.
This commit is contained in:
@@ -133,8 +133,10 @@ fn update_pragma(
|
||||
Ok((program, TransactionMode::Write))
|
||||
}
|
||||
PragmaName::SchemaVersion => {
|
||||
// TODO: Implement updating schema_version
|
||||
todo!("updating schema_version not yet implemented")
|
||||
// SQLite allowing this to be set is an incredibly stupid idea in my view.
|
||||
// In "defensive mode", this is a silent nop. So let's emulate that always.
|
||||
program.emit_insn(Insn::Noop {});
|
||||
Ok((program, TransactionMode::None))
|
||||
}
|
||||
PragmaName::TableInfo => {
|
||||
// because we need control over the write parameter for the transaction,
|
||||
|
||||
Reference in New Issue
Block a user