adjust schema

This commit is contained in:
Nikita Sivukhin
2025-07-06 22:30:57 +04:00
parent 62c1e38805
commit a10d423aac
2 changed files with 6 additions and 9 deletions

View File

@@ -43,7 +43,7 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
use crate::storage::{header_accessor, wal::DummyWAL};
use crate::translate::optimizer::optimize_plan;
use crate::translate::pragma::TURSO_CDC_TABLE_NAME;
use crate::translate::pragma::TURSO_CDC_DEFAULT_TABLE_NAME;
use crate::util::{OpenMode, OpenOptions};
use crate::vtab::VirtualTable;
use core::str;
@@ -447,7 +447,7 @@ impl CaptureDataChangesMode {
pub fn parse(value: &str) -> Result<CaptureDataChangesMode> {
let (mode, table) = value
.split_once(",")
.unwrap_or((value, TURSO_CDC_TABLE_NAME));
.unwrap_or((value, TURSO_CDC_DEFAULT_TABLE_NAME));
match mode {
"off" => Ok(CaptureDataChangesMode::Off),
"rowid-only" => Ok(CaptureDataChangesMode::RowidOnly { table: table.to_string() }),

View File

@@ -465,7 +465,7 @@ fn update_cache_size(
Ok(())
}
pub const TURSO_CDC_TABLE_NAME: &str = "turso_cdc";
pub const TURSO_CDC_DEFAULT_TABLE_NAME: &str = "turso_cdc";
fn turso_cdc_table_columns() -> Vec<ColumnDefinition> {
vec![
ast::ColumnDefinition {
@@ -479,7 +479,7 @@ fn turso_cdc_table_columns() -> Vec<ColumnDefinition> {
constraint: ast::ColumnConstraint::PrimaryKey {
order: None,
conflict_clause: None,
auto_increment: false,
auto_increment: true,
},
}],
},
@@ -508,11 +508,8 @@ fn turso_cdc_table_columns() -> Vec<ColumnDefinition> {
constraints: vec![],
},
ast::ColumnDefinition {
col_name: ast::Name("row_key".to_string()),
col_type: Some(ast::Type {
name: "BLOB".to_string(),
size: None,
}),
col_name: ast::Name("id".to_string()),
col_type: None,
constraints: vec![],
},
]