Closed tbantle22 closed 3 months ago
node-sql-parser v5.0.0+
The query SELECT * FROM `test1` WHERE NOT (`id` = "4" AND `id2` = "2") parses to:
SELECT * FROM `test1` WHERE NOT (`id` = "4" AND `id2` = "2")
{ "with": null, "type": "select", "options": null, "distinct": null, "columns": [ { "expr": { "type": "column_ref", "table": null, "column": "*" }, "as": null } ], "into": { "position": null }, "from": [ { "db": null, "table": "test1", "as": null } ], "where": { "type": "function", "name": { "name": [ { "type": "default", "value": "NOT" } ] }, "args": { "type": "expr_list", "value": [ { "type": "binary_expr", "operator": "AND", "left": { "type": "binary_expr", "operator": "=", "left": { "type": "column_ref", "table": null, "column": "id" }, "right": { "type": "double_quote_string", "value": "4" } }, "right": { "type": "binary_expr", "operator": "=", "left": { "type": "column_ref", "table": null, "column": "id2" }, "right": { "type": "double_quote_string", "value": "2" } } } ] }, "over": null }, "groupby": null, "having": null, "orderby": null, "limit": null, "locking_read": null, "window": null }
But some of these structures are not accurately reflected in types.d.ts
types.d.ts
FunctionName
name: ValueExpr<string>[]
ValueExpr
type
Function
args.value
ExpressionList[]
Expr
node-sql-parser v5.0.0+
The query
SELECT * FROM `test1` WHERE NOT (`id` = "4" AND `id2` = "2")
parses to:But some of these structures are not accurately reflected in
types.d.ts
FunctionName
->name: ValueExpr<string>[]
->ValueExpr
does not include a "default" option for thetype
fieldFunction
->args.value
only allowsExpressionList[]
, but should also allowExpr
as seen above