Skip to content
New issue

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

BoolExpr args miss A_Const #13

Closed
markandrus opened this issue Oct 24, 2024 · 0 comments
Closed

BoolExpr args miss A_Const #13

markandrus opened this issue Oct 24, 2024 · 0 comments

Comments

@markandrus
Copy link

See here:

https://github.com/pg-nano/pg-parser/blob/b2a027f/src/lib/ast.ts#L5509-L5520

BoolExpr args miss A_Const, but it's possible:

console.log(parseQuerySync('SELECT TRUE AND TRUE'), null, 2))
/*
{
  "version": 160001,
  "stmts": [
    {
      "stmt": {
        "SelectStmt": {
          "targetList": [
            {
              "ResTarget": {
                "val": {
                  "BoolExpr": {
                    "boolop": "AND_EXPR",
                    "args": [
                      {
                        "A_Const": {
                          "boolval": {
                            "boolval": true
                          },
                          "location": 7
                        }
                      },
                      {
                        "A_Const": {
                          "boolval": {
                            "boolval": true
                          },
                          "location": 16
                        }
                      }
                    ],
                    "location": 12
                  }
                },
                "location": 7
              }
            }
          ],
          "limitOption": "LIMIT_OPTION_DEFAULT",
          "op": "SETOP_NONE"
        }
      }
    }
  ]
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant