forked from constructive-io/libpg-query-node
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Great project, the typing is wonderful for building complex functionality.
It seems that there might be an issue in the typing of SelectStmt.valuesLists:
In @pg-nano/pg-parser/lib/ast.d.ts
export type SelectStmt = {
...
valuesLists?: List<Expr>[];
...
}But looking at the actual parser output, the type should probably be defined as such
export type SelectStmt = {
...
valuesLists?: {List: List<Expr>}[];
...
}Steps to reproduce:
INSERT INTO users (id, name, email)
VALUES (1, 'John', NULL);It is parsed into this
{
stmt: {
InsertStmt: {
relation: {
relname: "users",
inh: true,
relpersistence: "p",
location: 194,
},
cols: [
{
ResTarget: {
name: "id",
location: 201,
},
},
{
ResTarget: {
name: "name",
location: 205,
},
},
{
ResTarget: {
name: "email",
location: 211,
},
},
],
selectStmt: {
SelectStmt: {
valuesLists: [
{
List: {
items: [
{
A_Const: {
ival: {
ival: 1,
},
location: 226,
},
},
{
A_Const: {
sval: {
sval: "John",
},
location: 229,
},
},
{
A_Const: {
isnull: true,
location: 237,
},
},
],
},
},
],
limitOption: "LIMIT_OPTION_DEFAULT",
op: "SETOP_NONE",
},
},
override: "OVERRIDING_NOT_SET",
},
},
stmt_location: 181,
stmt_len: 61,
}
Metadata
Metadata
Assignees
Labels
No labels