mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-29 22:14:23 +01:00
Merge 'Fix cloning database with autoincrement primary keys' from
Ignore `sqlite_sequence` when dumping tables during cloning. Fixes #3640. Reviewed-by: Preston Thorpe <preston@turso.tech> Closes #3651
This commit is contained in:
@@ -1453,6 +1453,10 @@ impl Limbo {
|
||||
StepResult::Row => {
|
||||
let row = rows.row().unwrap();
|
||||
let name: &str = row.get::<&str>(0)?;
|
||||
// Skip sqlite_sequence table
|
||||
if name == "sqlite_sequence" {
|
||||
continue;
|
||||
}
|
||||
let ddl: &str = row.get::<&str>(1)?;
|
||||
writeln!(out, "{ddl};")?;
|
||||
Self::dump_table_from_conn(&conn, out, name, &mut progress)?;
|
||||
@@ -1567,7 +1571,6 @@ impl Limbo {
|
||||
if !has_seq {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
writeln!(out, "DELETE FROM sqlite_sequence;")?;
|
||||
if let Some(mut rows) = conn.query("SELECT name, seq FROM sqlite_sequence")? {
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user