add "updates" column for cdc table

This commit is contained in:
Nikita Sivukhin
2025-08-11 12:44:04 +04:00
parent a9fdaa8305
commit 5d0ada9fb9
12 changed files with 226 additions and 9 deletions

View File

@@ -43,6 +43,41 @@ fn test_schema_reprepare() {
assert_eq!(row, (20, 30));
}
#[test]
fn test_schema_reprepare_write() {
let tmp_db = TempDatabase::new_empty(false);
let conn1 = tmp_db.connect_limbo();
conn1.execute("CREATE TABLE t(x, y, z)").unwrap();
let conn2 = tmp_db.connect_limbo();
let mut stmt = conn2.prepare("INSERT INTO t(y, z) VALUES (1, 2)").unwrap();
let mut stmt2 = conn2.prepare("INSERT INTO t(y, z) VALUES (3, 4)").unwrap();
conn1.execute("ALTER TABLE t DROP COLUMN x").unwrap();
loop {
match stmt.step().unwrap() {
turso_core::StepResult::Done => {
break;
}
turso_core::StepResult::IO => {
stmt.run_once().unwrap();
}
step => panic!("unexpected step result {step:?}"),
}
}
loop {
match stmt2.step().unwrap() {
turso_core::StepResult::Done => {
break;
}
turso_core::StepResult::IO => {
stmt2.run_once().unwrap();
}
step => panic!("unexpected step result {step:?}"),
}
}
}
#[test]
#[ignore]
fn test_create_multiple_connections() -> anyhow::Result<()> {