Use double quotes not braces for tables and columns (#678)

Closes #677
This commit is contained in:
Simon Willison 2025-11-23 20:43:26 -08:00 committed by GitHub
commit fb93452ea8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 910 additions and 849 deletions

View file

@ -167,13 +167,13 @@ def test_memory_dump(extra_args):
expected = (
"BEGIN TRANSACTION;\n"
'CREATE TABLE IF NOT EXISTS "stdin" (\n'
" [id] INTEGER,\n"
" [name] TEXT\n"
' "id" INTEGER,\n'
' "name" TEXT\n'
");\n"
"INSERT INTO \"stdin\" VALUES(1,'Cleo');\n"
"INSERT INTO \"stdin\" VALUES(2,'Bants');\n"
"CREATE VIEW t1 AS select * from [stdin];\n"
"CREATE VIEW t AS select * from [stdin];\n"
'CREATE VIEW "t1" AS select * from "stdin";\n'
'CREATE VIEW "t" AS select * from "stdin";\n'
"COMMIT;"
)
# Using sqlite-dump it won't have IF NOT EXISTS
@ -191,11 +191,11 @@ def test_memory_schema(extra_args):
assert result.exit_code == 0
assert result.output.strip() == (
'CREATE TABLE "stdin" (\n'
" [id] INTEGER,\n"
" [name] TEXT\n"
' "id" INTEGER,\n'
' "name" TEXT\n'
");\n"
"CREATE VIEW t1 AS select * from [stdin];\n"
"CREATE VIEW t AS select * from [stdin];"
'CREATE VIEW "t1" AS select * from "stdin";\n'
'CREATE VIEW "t" AS select * from "stdin";'
)
@ -285,16 +285,16 @@ def test_memory_two_files_with_same_stem(tmpdir):
assert result.exit_code == 0
assert result.output == (
'CREATE TABLE "data" (\n'
" [id] INTEGER,\n"
" [name] TEXT\n"
' "id" INTEGER,\n'
' "name" TEXT\n'
");\n"
"CREATE VIEW t1 AS select * from [data];\n"
"CREATE VIEW t AS select * from [data];\n"
'CREATE VIEW "t1" AS select * from "data";\n'
'CREATE VIEW "t" AS select * from "data";\n'
'CREATE TABLE "data_2" (\n'
" [id] INTEGER,\n"
" [name] TEXT\n"
' "id" INTEGER,\n'
' "name" TEXT\n'
");\n"
"CREATE VIEW t2 AS select * from [data_2];\n"
'CREATE VIEW "t2" AS select * from "data_2";\n'
)