feat: SQL 语法支持 BETWEEN AND、DROP TABLE IF EXISTS
CI / test (18.x) (push) Waiting to run
CI / test (20.x) (push) Waiting to run
CI / test (22.x) (push) Waiting to run
CI / test (24.x) (push) Waiting to run

This commit is contained in:
thzxx
2026-07-26 17:55:45 +08:00
parent 287f2a2b22
commit 1f8e11bf72
14 changed files with 181 additions and 13 deletions
+6 -2
View File
@@ -130,8 +130,12 @@ describe('Parser 边缘场景', () => {
expect(ast.columns[3]).toMatchObject({ name: 'active', default: true });
});
it('支持 IF EXISTS 语法(表名被解析为 IF', () => {
// 解析器把 IF 当作表名,EXISTS 作为后续 token 导致错误
it('支持 DROP TABLE IF EXISTS 语法', () => {
const ast = parse('DROP TABLE IF EXISTS users');
expect(ast).toMatchObject({ type: 'DROP_TABLE', name: 'users', ifExists: true });
});
it('DROP TABLE 不带 IF EXISTS', () => {
const ast = parse('DROP TABLE users');
expect(ast).toMatchObject({ type: 'DROP_TABLE', name: 'users' });
});