rename pragma to unsable_capture_data_changes_conn

This commit is contained in:
Nikita Sivukhin
2025-07-06 22:32:42 +04:00
parent a10d423aac
commit 1ee475f04a
3 changed files with 5 additions and 5 deletions

View File

@@ -77,7 +77,7 @@ pub fn pragma_for(pragma: PragmaName) -> Pragma {
PragmaFlags::NeedSchema | PragmaFlags::ReadOnly | PragmaFlags::Result0,
&["message"],
),
CaptureDataChanges => Pragma::new(
UnstableCaptureDataChangesConn => Pragma::new(
PragmaFlags::NeedSchema | PragmaFlags::Result0 | PragmaFlags::SchemaReq,
&["mode", "table"],
),

View File

@@ -208,7 +208,7 @@ fn update_pragma(
Ok(program)
}
PragmaName::IntegrityCheck => unreachable!("integrity_check cannot be set"),
PragmaName::CaptureDataChanges => {
PragmaName::UnstableCaptureDataChangesConn => {
let value = parse_string(&value)?;
// todo(sivukhin): ideally, we should consistently update capture_data_changes connection flag only after successfull execution of schema change statement
// but for now, let's keep it as is...
@@ -382,7 +382,7 @@ fn query_pragma(
PragmaName::IntegrityCheck => {
translate_integrity_check(schema, &mut program)?;
}
PragmaName::CaptureDataChanges => {
PragmaName::UnstableCaptureDataChangesConn => {
let pragma = pragma_for(pragma);
let second_column = program.alloc_register();
let opts = connection.get_capture_data_changes();

View File

@@ -1747,8 +1747,6 @@ pub enum PragmaName {
AutoVacuum,
/// `cache_size` pragma
CacheSize,
/// enable capture-changes logic for the connection
CaptureDataChanges,
/// Run integrity check on the database file
IntegrityCheck,
/// `journal_mode` pragma
@@ -1763,6 +1761,8 @@ pub enum PragmaName {
SchemaVersion,
/// returns information about the columns of a table
TableInfo,
/// enable capture-changes logic for the connection
UnstableCaptureDataChangesConn,
/// Returns the user version of the database file.
UserVersion,
/// trigger a checkpoint to run on database(s) if WAL is enabled