feat: SQL 语法支持 BETWEEN AND、DROP TABLE IF EXISTS
CI / test (18.x) (push) Successful in 9m56s
CI / test (20.x) (push) Successful in 9m54s
CI / test (22.x) (push) Successful in 9m50s
CI / test (24.x) (push) Successful in 9m49s

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
+2
View File
@@ -103,6 +103,8 @@ export interface CreateTableStatement {
export interface DropTableStatement {
type: 'DROP_TABLE';
name: string;
/** IF EXISTS — 表不存在时不报错 */
ifExists?: boolean;
}
// ---------------------------------------------------------------------------
+4
View File
@@ -234,6 +234,10 @@ export class QueryExecutor {
}
private async executeDropTable(stmt: DropTableStatement): Promise<void> {
if (stmt.ifExists) {
const exists = await this.engine.hasTable(stmt.name);
if (!exists) return; // IF EXISTS: 表不存在时静默返回
}
return this.engine.dropTable(stmt.name);
}