Closed 1ilit closed 1 month ago
@1ilit It can parse the sql.
const sql = 'CREATE DATABASE [MyDatabase];'
const { Parser } = require('node-sql-parser')
const parser = new Parser()
const ast = parser.astify(sql, { database: 'transactsql' }) // please specified the database option
console.log(ast)
I will close the issue. If you still have problems, please reopen it, and show the codes you use.
Describe the bug Throws syntax error when the name of the database in CREATE DATABASE is in square brackets
Database Engine Transact-SQL.
To Reproduce -the SQL that be parsed
-the node-sql-parser version v5.2.0 -the node version v20.11.0
Expected behavior Parse successfully