mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-11 19:24:21 +01:00
adjust schema
This commit is contained in:
@@ -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() }),
|
||||
|
||||
@@ -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![],
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user