taozhi8833998 / taozhi8833998/node-sql-parser
MySQL Parser: SHOW TABLES LIKE 'pattern'is not supported
Open
@taozhi8833998 is already working on this.
Since May 15, 2026.
- Dominant language
- PEG.js
- Stars
- 1k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
The parser currently does not support the SHOW TABLES LIKE 'pattern' syntax, which is a standard MySQL statement. Attempting to parse it results in a syntax error.
To Reproduce
Steps to reproduce the behavior:
- Use the following code snippet:
const { Parser } = require('node-sql-parser');
const parser = new Parser();
try {
const ast = parser.astify("SHOW TABLES LIKE 'user%'", { database: 'mysql' });
console.log(ast);
} catch (error) {
console.error(error.message);
}
- Actual Output: Throws an error:
Expected "#", "--", "/*", ";", "GO", [ \t\n\r], or end of input but "L" found. - Expected Output: Should successfully parse and return an AST object for the
SHOW TABLESstatement.
Additional context
- Library Version: Latest
- Database Dialect: MySQL / MariaDB
- Standard SQL:
SHOW TABLES [LIKE 'pattern']is a common DDL statement for listing tables.
Feature Request
Please extend the grammar to support SHOW TABLES with optional LIKE clause. This is critical for projects that need to parse database introspection queries.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.