Skip to content

Generation of default string values is not properly quoted. #64

Description

@eakoli

When a column has a default value of type string, the generated sql is incorrect. The string is output as a literal, as opposed to a string.

e.g.

Table "example" {
   "id" integer [pk, not null]
   "value" varchar(255) [not null, default: 'something']
}

Will generate the following sql:

CREATE TABLE "example" (
  "id" integer PRIMARY KEY NOT NULL,
  "value" varchar NOT NULL DEFAULT something
)

Where it should quote something as

- "value" varchar NOT NULL DEFAULT something
+ "value" varchar NOT NULL DEFAULT 'something'

This seems to work correctly when outputting the DBML from the models, which has extra checks to test for string values and encode them correctly.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions