pgsql-ast-parser icon indicating copy to clipboard operation
pgsql-ast-parser copied to clipboard

Yet another simple Postgres SQL parser

Results 62 pgsql-ast-parser issues
Sort by recently updated
recently updated
newest added

When I use Chinese in comments, it threw an error('/* 你好 */', but '-- 你好' can work) ![企业微信截图_4610cfc9-021c-4465-b5c7-1d2bac88bf42](https://github.com/oguimbal/pgsql-ast-parser/assets/23448498/11e71a5b-fde2-4dcb-aef1-e4f21f449eeb)

I'm using `[email protected]` with `sequelize@v6`, and I'm getting the following error from `pg-mem` (probably bubbled up from this package), when I `include` an association via a `through` relationship. Sequelize models...

https://github.com/oguimbal/pgsql-ast-parser/blob/2c84d4ca6d566162c32ff8d0667c8e3bcd94a828/src/lexer.spec.ts#L241-L242 I was wondering about this test case. Shouldn't the lexer detect that as a syntax error? ```sql /* /* */ /* /* */ */ */ ``` Postgresql throws: syntax...

What --- Fix the bug that the expression `42-51` fails to parse, because the tokenizer greedily treats `-51` as being a number token. Closes #133 How --- Move the lexer...

Currently this library does not support [array operations](https://www.postgresql.org/docs/current/functions-comparisons.html#FUNCTIONS-COMPARISONS-ANY-SOME). It parses them fine, and will even render them (albeit incorrectly). I think an example is the best way to show this....

The real postgres parser supports parentheses around a full select expression, or the select expression in a subselect. This adds support to the parser for these parentheses. They don't change...

```sql CREATE OR REPLACE FUNCTION schema_identifier_split(url_path TEXT, OUT scope TEXT, OUT plugin TEXT, OUT name TEXT, OUT version INT) RETURNS SETOF record LANGUAGE plpgsql AS $$ DECLARE parts TEXT[]; BEGIN...

(@seamapi is open to sponsor this repo/fix) Example failing syntax: ``` CREATE RULE override_insert AS ON INSERT TO public.events DO INSTEAD ( INSERT INTO public.events VALUES (NEW.*) RETURNING * );...

Trying to parse a simple query that contains TRIM function. ```pgsql SELECT trim(BOTH 'xyz' FROM 'yxTomxx'); ``` Got an error: ``` Unexpected kw_both token: "both". Instead, I was expecting to...

Unexpected kw_from token: "from". Instead, I was expecting to see one of the following: - A "op_cast" token - A "lbracket" token - A "op_member" token - A "op_membertext" token...