taozhi8833998 / node-sql-parser

Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList and convert it back to SQL
https://taozhi8833998.github.io/node-sql-parser/
Apache License 2.0
755 stars 172 forks source link

Throws SyntaxError when parsing 'create database' statements with name in backticks #1923

Closed 1ilit closed 1 month ago

1ilit commented 1 month ago

Describe the bug Throws SyntaxError when parsing 'create database' statements with the name of the database in backticks

Database Engine MySQL

To Reproduce -the SQL that be parsed

CREATE DATABASE IF NOT EXISTS `gouden_draak`;

-the node-sql-parser version v5.1.0 -the node version v18.20.3

Expected behavior Return AST

Additional context Minimal reproducible example: https://stackblitz.com/edit/stackblitz-starters-9dpxty?file=index.js