-
-
Notifications
You must be signed in to change notification settings - Fork 220
Open
Description
Describe the bug
The PostgreSQL "DO" statement is not supported: https://www.postgresql.org/docs/current/sql-do.html.
Parsing the SQL below gives the following error: Expected "#", "--", "/*", ":=", "=", or [ \\t\\n\\r] but "$" found.
Database Engine
PostgreSQL
To Reproduce
Reproduction code (https://playcode.io/empty-typescript-playground--019ac65c-53cf-741c-a307-87d71bda1d4b):
import { Parser } from "node-sql-parser/build/postgresql";
const parser = new Parser();
const ast = parser.astify(`
DO $$
DECLARE
test INTEGER;
BEGIN
SELECT 1 INTO test;
END
$$;
`);
console.log(ast);node-sql-parser version: 5.3.13
node version: 25.2.1
Expected behavior
Support for "DO" statements.
Metadata
Metadata
Assignees
Labels
No labels