DerekStride / tree-sitter-sql

SQL grammar for tree-sitter
http://derek.stride.host/tree-sitter-sql/
MIT License
147 stars 47 forks source link

feat: Add REFERENCES column constraint to CREATE TABLE statements #227

Closed dgmcdona closed 9 months ago

dgmcdona commented 9 months ago

See postgresql CREATE TABLE docs

where column_constraint is:

[ CONSTRAINT constraint_name ]
{ NOT NULL |
  NULL |
  CHECK ( expression ) [ NO INHERIT ] |
  DEFAULT default_expr |
  GENERATED ALWAYS AS ( generation_expr ) STORED |
  GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ] |
  UNIQUE [ NULLS [ NOT ] DISTINCT ] index_parameters |
  PRIMARY KEY index_parameters |
  REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ]
    [ ON DELETE referential_action ] [ ON UPDATE referential_action ] }
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
matthias-Q commented 9 months ago

@DerekStride not sure if I did everything correctly on the release. I have create a release branch which has the updated changelog thats now also on npm. But thats not tracked in the main branch...

DerekStride commented 9 months ago

@matthias-Q hmm, I think I pushed directly to main when I made the first release. Instead we might want to update the script to not create the git tag. That way we can have GitHub create it during the creation of the release.

matthias-Q commented 9 months ago

Hmm, ok. I cannot push to main (which is a good idea). Should we merge the new branch to main in order to keep the changelog & package.json in sync?

DerekStride commented 9 months ago

Yeah, let's do that