pg-query-parser
pg-query-parser copied to clipboard
added functionality
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()intest.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
@zhm I'd love to see this go in master ;) we're passing now, cheers!
There are some merge conflicts now, care to address them?
@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.
@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