pgsql-ast-parser
pgsql-ast-parser copied to clipboard
Yet another simple Postgres SQL parser
Based on: https://pkg-size.dev/pgsql-ast-parser It seems that most of the bigness is from including the `src/` folder, although this probably has no runtime effect. Does `src/` need to be included? I...
Attempt to fix #162 by implementing the remaining unary operators. I had to tweak the lexer to keep tests passing. Not 100% about my approach there, but it's working for...
https://www.postgresql.org/docs/12/sql-select.html ``` SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] [ * | expression [ [ AS ] output_name ] [, ...] ] [...
I am trying to parse the following query: DROP SCHEMA ex; and I receive the next error: Syntax error at line 1 col 13: 1 DROP SCHEMA ex; Unexpected word...
``` Error: Syntax error at line 1 col 12: 1 ALTER VIEW THEAA RENAME TO new_view_name; ^ Unexpected word token: "theaa". I did not expect any more input. Here is...
Adds support for postgres `IS DISTINCT FROM` and `IS NOT DISTINCT FROM` operators. I'm not familiar with nearley, so let me know if there's a better approach for this. This...
hi, it seems like some stuff is going wrong with cast-ed jsonb dereferencing: ```ts import * as pgsqlAstParser from 'pgsql-ast-parser' const input = `select json->'foo'::text->>'bar'::text as bar from json_table` const...
I checked out [postgres/postgres](https://github.com/postgres/postgres) today (commit 4d93bbd), and tried using this parser to see which of the included SQL files it could parse. The postgres source code could provide a...
Fixes #165 I would have liked to have set up the interfaces so that if `database` is defined, then surely `schema` is defined, but it's not straightforward with TypeScript. Instead,...
The following SQL fails to parse: ```sql SELECT my_database.my_schema.my_table.my_column FROM my_database.my_schema.my_table; ``` Also: ```sql COMMENT ON COLUMN my_database.my_schema.my_table.my_column IS 'my_comment'; ```