pg-query-parser icon indicating copy to clipboard operation
pg-query-parser copied to clipboard

added functionality

Open pyramation opened this issue 8 years ago • 4 comments

It’s not complete, but has a lot more functionality than before. I implemented

CreateStmt
ConstraintStmt
Constraint
ReferenceConstraint
ExclusionConstraint
FunctionParameter
CreateFunctionStmt
CreateSchemaStmt
TransactionStmt

On a high level you can now

  • create basic functions that return types, returns table, returns trigger, and setoff.
  • create tables with check, defaults, exclude, foreign key, nulls, unique constraints, including basic on delete, on update

Limitations

  • ON UPDATE and ON DELETE only have RESTRICT and CASCADE (should be easy to add more)
  • TransactionStmt is limited to BEGIN and COMMIT (needs ROLLBACK, etc)
  • Although the cases I tested work (even passing check() in test.js), there are some tests not passing from the upstream. I think we need to implement a few more items like TEMP tables, INHERITS, etc., for those to pass.

this could possibly help close https://github.com/zhm/pg-query-parser/issues/8

pyramation avatar Aug 16 '17 01:08 pyramation

@zhm I'd love to see this go in master ;) we're passing now, cheers!

pyramation avatar Mar 01 '18 06:03 pyramation

There are some merge conflicts now, care to address them?

mitar avatar Aug 18 '19 05:08 mitar

@zhm I'd love to see this go in master ;) we're passing now, cheers!

@pyramation - this could be merge-able if you could fix the conflicts. This package is pretty awesome and I hope we could keep it moving forward if possible.

ReinsBrain avatar Feb 19 '21 18:02 ReinsBrain

@zhm I'd love to see this go in master ;) we're passing now, cheers!

@pyramation - this could be merge-able if you could fix the conflicts. This package is pretty awesome and I hope we could keep it moving forward if possible.

@ReinsBrain I've moved all development over to https://github.com/pyramation/pgsql-parser which is much more maintained and active

pyramation avatar Feb 23 '21 06:02 pyramation