Skip to content

Add support for column default values parsing #23

@julioz

Description

@julioz

So far, dbml-parser doesn't properly handle column defaults defined in DBML, as such:

Table users {
    id integer [primary key]
    username varchar(255) [not null, unique]
    full_name varchar(255) [not null]
    gender varchar(1) [default: 'm']
    created_at timestamp [default: `now()`]
    rating integer [default: 10]
}

You can set default value as:

number value starts blank: default: 123 or default: 123.456
string value starts with single quotes: default: 'some string value'
expression value is wrapped with parenthesis: default: now() - interval '5 days'``
boolean (true/false/null): default: false or `default: null`

Metadata

Metadata

Assignees

No one assigned

    Labels

    DBML ParserWork related to the DBML Parsing componenthacktoberfestCheck out https://hacktoberfest.digitalocean.com and contribute!

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions