You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Export to SQL does not quote default value of text fields #4081
I exported a database to an SQL file. In the CREATE TABLE statement for tables with TEXT fields having default values, the default value is not quoted. For example,
CREATE TABLE IF NOT EXISTS "content" (
...
"WishlistedDate" TEXT DEFAULT 0000-00-00T00:00:00.000,
...
);
What did you expect to see?
"WishlistedDate" TEXT DEFAULT "0000-00-00T00:00:00.000",
The failure to quote the value causes an error when the file is re-imported.
What did you see instead?
"WishlistedDate" TEXT DEFAULT 0000-00-00T00:00:00.000,
And what happens if you quote the 0000-00-00T00:00:00.000 in single quotes, eg, '0000-00-00T00:00:00.000'?
If you've specified text as a data type, and entering text, then enclose that string in single quotes.
If the default was 'two fat bananas' then you'd put that in single quotes too.
If I manually edit the generated SQL file and quote the default value I can import the file with out issues. But that is not really the point. The Export command should generate valid SQL, which it is not doing in the case.
Activity
chrisjlocke commentedon Jan 6, 2026
And what happens if you quote the 0000-00-00T00:00:00.000 in single quotes, eg, '0000-00-00T00:00:00.000'?
If you've specified text as a data type, and entering text, then enclose that string in single quotes.
If the default was 'two fat bananas' then you'd put that in single quotes too.
sboydlns commentedon Jan 6, 2026
If I manually edit the generated SQL file and quote the default value I can import the file with out issues. But that is not really the point. The Export command should generate valid SQL, which it is not doing in the case.
Fix sqlitebrowser#4081: Quote DEFAULT values in TEXT fields when expo…
Keep double-quoted DEFAULT values quoted when writing table SQL