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

Support deferrable unique constraint for PostgreSQL #186

Merged
merged 4 commits into from
Jan 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip: Enable to parse DEFERRABLE and INITIALLY DEFERRED
yuku committed Jan 21, 2022
commit 52f48098309451c377ae129669d0a0ed42e405b1
26 changes: 16 additions & 10 deletions sqlparser/ast.go
Original file line number Diff line number Diff line change
@@ -1314,16 +1314,22 @@ const (
)

type IndexSpec struct {
Name ColIdent
Type ColIdent
Unique bool
Primary bool
Constraint bool
Clustered bool // for MSSQL
Included []ColIdent
Where *Where
Options []*IndexOption
Partition *IndexPartition // for MSSQL
Name ColIdent
Type ColIdent
Unique bool
Primary bool
Constraint bool
Clustered bool // for MSSQL
Included []ColIdent
Where *Where
Options []*IndexOption
Partition *IndexPartition // for MSSQL
ConstraintOptions *ConstraintOptions
}

type ConstraintOptions struct {
Deferrable bool // for Postgres
InitiallyDeferred bool // for Postgres
}

// VindexSpec defines a vindex for a CREATE VINDEX or DROP VINDEX statement
Loading