-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow some named inline column constraints in
CREATE TABLE
statemen…
…ts (#559) Allow some named inline column constraints in `CREATE TABLE` statements. SQL like this can be converted to a pgroll `OpCreateTable`: ```sql CREATE TABLE foo(a int CONSTRAINT my_check CHECK (a > 0)) CREATE TABLE foo(a int CONSTRAINT my_fk REFERENCES bar(b)) ``` The previous behaviour was to allow only the unnamed forms of these constraints: ```sql CREATE TABLE foo(a int CHECK (a > 0)) CREATE TABLE foo(a int REFERENCES bar(b)) ``` Named inline column constraints remain unsupported for `DEFAULT`, `NULL`, `NOT NULL`, `UNIQUE` and `PRIMARY KEY` constraints and will fall back to a raw SQL operation.
- Loading branch information
1 parent
783d282
commit ca094f5
Showing
3 changed files
with
80 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters