Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for column default values parsing #23

Open
julioz opened this issue May 19, 2020 · 0 comments
Open

Add support for column default values parsing #23

julioz opened this issue May 19, 2020 · 0 comments
Labels
DBML Parser Work related to the DBML Parsing component hacktoberfest Check out https://hacktoberfest.digitalocean.com and contribute!

Comments

@julioz
Copy link
Owner

julioz commented May 19, 2020

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`

@julioz julioz changed the title Add support for column default values Add support for column default values parsing May 19, 2020
@julioz julioz added the DBML Parser Work related to the DBML Parsing component label Jun 4, 2020
@julioz julioz added the hacktoberfest Check out https://hacktoberfest.digitalocean.com and contribute! label Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DBML Parser Work related to the DBML Parsing component hacktoberfest Check out https://hacktoberfest.digitalocean.com and contribute!
Projects
None yet
Development

No branches or pull requests

1 participant