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

Handle explicit <column> <data type> NULL constraint specifier #29

Open
jaypipes opened this issue Feb 11, 2018 · 0 comments
Open

Handle explicit <column> <data type> NULL constraint specifier #29

jaypipes opened this issue Feb 11, 2018 · 0 comments
Milestone

Comments

@jaypipes
Copy link
Owner

The NULL constraint specifier is default for the CREATE TABLE statement, however we don't support it. We only support the standard NOT NULL constraint specifier:

jaypipes@uberbox:~/src/github.com/jaypipes/sqltoast/_build$ ./sqltoaster "create table t1 (c1 int not null primary key)"
OK
statements[0]:
  <statement: CREATE TABLE
    table identifier: t1
    column definitions:
      c1 INT NOT NULL
    constraints:
      PRIMARY KEY(c1)>

(took 28831 nanoseconds)
jaypipes@uberbox:~/src/github.com/jaypipes/sqltoast/_build$ ./sqltoaster "create table t1 (id int not null primary key, name varchar(200) null)"
Syntax error.
Expected to find one of (','|')') but found keyword[NULL]
create table t1 (id int not null primary key, name varchar(200) null)
                                                               ^^^^^^
(took 61148 nanoseconds)

Should be a simple fix to ignore the NULL constraint specifier when NOT isn't present.

@jaypipes jaypipes added this to the 0.3 milestone Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant