We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const result = parseQuerySync(`select from test_table WHERE status = 'complete'::text`); const stmts = result.stmts.map(mapStmt); deparse(stmts, {})
=>
deparser/deparser.ts:720 if (node.val.String) { ^ TypeError: Cannot read properties of undefined (reading 'String')
after fix: https://github.com/launchql/pgsql-parser/blob/main/packages/deparser/src/deparser.ts#L720
if (node.val.String) { => if (node?.val?.String) {
if (node.val.String) {
if (node?.val?.String) {
result is
SELECT FROM test_table WHERE null::undefined
The text was updated successfully, but these errors were encountered:
select from test_table WHERE status = 'complete'
after pipeline (parseQuerySync |> deparse) result is
SELECT FROM test_table WHERE
without status = 'complete'
status = 'complete'
AST:
[ { "RawStmt": { "stmt": { "SelectStmt": { "fromClause": [ { "RangeVar": { "relname": "test_table", "inh": true, "relpersistence": "p", "location": 12 } } ], "whereClause": { "A_Expr": { "kind": "AEXPR_OP", "name": [ { "String": { "sval": "=" } } ], "lexpr": { "ColumnRef": { "fields": [ { "String": { "sval": "status" } } ], "location": 29 } }, "rexpr": { "A_Const": { "sval": { "sval": "complete" }, "location": 38 } }, "location": 36 } }, "limitOption": "LIMIT_OPTION_DEFAULT", "op": "SETOP_NONE" } }, "stmt_location": 0 } } ]
Sorry, something went wrong.
No branches or pull requests
=>
after fix:
https://github.com/launchql/pgsql-parser/blob/main/packages/deparser/src/deparser.ts#L720
if (node.val.String) {
=>if (node?.val?.String) {
result is
The text was updated successfully, but these errors were encountered: