Skip to content

Commit 7ec6a30

Browse files
authored
fix db import command to match new sqlite3 output in line mode (#1035)
this was breaking `turso db import` because the new `.mode line` uses `key: value` instead of `key = value`
2 parents 9ec5224 + bf2ec4d commit 7ec6a30

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

internal/cmd/group_flag.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,16 @@ func sqliteFileIntegrityChecks(file string, cipher string) error {
297297
}
298298

299299
settings := string(output)
300-
if !strings.Contains(settings, "j = wal") {
300+
if !strings.Contains(settings, "j: wal") && !strings.Contains(settings, "j = wal") {
301301
return fmt.Errorf("database is not in WAL mode. Set it with 'sqlite3 %s 'PRAGMA journal_mode = WAL'", file)
302302
}
303-
304-
if !strings.Contains(settings, "p = 4096") {
303+
if !strings.Contains(settings, "p: 4096") && !strings.Contains(settings, "p = 4096") {
305304
return fmt.Errorf("database must use 4KB page size. you can set it with 'sqlite3 %s 'PRAGMA page_size = 4096; VACUUM;' Note that this is not possible to do if your database is already in WAL mode", file)
306305
}
307-
if !strings.Contains(settings, "a = 0") {
306+
if !strings.Contains(settings, "a: 0") && !strings.Contains(settings, "a = 0") {
308307
return fmt.Errorf("database must have autovacuum disabled. you can set it with 'sqlite3 %s 'PRAGMA auto_vacuum = 0;'", file)
309308
}
310-
if !strings.Contains(settings, "e = UTF-8") {
309+
if !strings.Contains(settings, "e: UTF-8") && !strings.Contains(settings, "e = UTF-8") {
311310
return fmt.Errorf("database must use UTF-8 encoding. you can set it with 'sqlite3 %s 'PRAGMA encoding = 'UTF-8' ", file)
312311
}
313312

0 commit comments

Comments
 (0)