Skip to content

[Bug]: Export to SQL does not quote default value of text fields #4081

Closed

Description

@sboydlns

What did you do?

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,

DB4S Version

3.13.1

What OS are you seeing the problem on?

Windows

OS version

Windows 11

Relevant log output

Prevention against duplicate issues

  • I have searched for similar issues

Activity

  1. chrisjlocke commented on Jan 6, 2026

    @chrisjlocke
    Member

    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.

  2. sboydlns commented on Jan 6, 2026

    @sboydlns
    Author

    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.

  3. added a commit that references this issue on Feb 9, 2026
    cc5cc52
  4. added a commit that references this issue on Oct 19, 2026
    2178856
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions