fix: crypto TS类型修复 + EXPLAIN AST类型补充
This commit is contained in:
Vendored
+28
-1
@@ -185,6 +185,14 @@ interface IStorageEngine {
|
||||
commitTransaction(): Promise<void>;
|
||||
/** 回滚事务 */
|
||||
rollbackTransaction(): Promise<void>;
|
||||
/** 创建 Savepoint */
|
||||
savepoint?(name: string): Promise<void>;
|
||||
/** 回滚到 Savepoint */
|
||||
rollbackToSavepoint?(name: string): Promise<void>;
|
||||
/** 释放 Savepoint */
|
||||
releaseSavepoint?(name: string): Promise<void>;
|
||||
/** 在线备份:导出全库一致性快照 */
|
||||
backup?(): Promise<Record<string, Record<string, unknown>[]>>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,6 +245,11 @@ interface DropTableStatement {
|
||||
/** IF EXISTS — 表不存在时不报错 */
|
||||
ifExists?: boolean;
|
||||
}
|
||||
/** EXPLAIN 查询计划 */
|
||||
interface ExplainStatement {
|
||||
type: 'EXPLAIN';
|
||||
query: Statement;
|
||||
}
|
||||
interface InsertStatement {
|
||||
type: 'INSERT';
|
||||
into: string;
|
||||
@@ -272,7 +285,7 @@ interface SelectStatement {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
}
|
||||
type Statement = SelectStatement | InsertStatement | UpdateStatement | DeleteStatement | CreateTableStatement | DropTableStatement;
|
||||
type Statement = SelectStatement | ExplainStatement | InsertStatement | UpdateStatement | DeleteStatement | CreateTableStatement | DropTableStatement;
|
||||
|
||||
/**
|
||||
* metona-sqlark Query Executor — AST 执行器
|
||||
@@ -285,6 +298,8 @@ declare class QueryExecutor {
|
||||
private engine;
|
||||
constructor(engine: IStorageEngine);
|
||||
execute(stmt: Statement): Promise<unknown>;
|
||||
/** EXPLAIN: 输出查询计划 */
|
||||
private executeExplain;
|
||||
private executeSelect;
|
||||
private executeJoinSelect;
|
||||
private prefixRow;
|
||||
@@ -697,6 +712,11 @@ declare class AriaEngine implements IStorageEngine {
|
||||
beginTransaction(): Promise<void>;
|
||||
commitTransaction(): Promise<void>;
|
||||
rollbackTransaction(): Promise<void>;
|
||||
private savepoints;
|
||||
savepoint(name: string): Promise<void>;
|
||||
rollbackToSavepoint(name: string): Promise<void>;
|
||||
releaseSavepoint(name: string): Promise<void>;
|
||||
backup(): Promise<Record<string, Record<string, unknown>[]>>;
|
||||
private getAllRows;
|
||||
private getPK;
|
||||
private validateRow;
|
||||
@@ -713,6 +733,13 @@ declare class AriaEngine implements IStorageEngine {
|
||||
private indexScanToRows;
|
||||
/** 每 10 次 gc 计数器触发一次 MVCC 垃圾回收 */
|
||||
private tryGC;
|
||||
/** 检查内存预算,超出时强制 flush + GC */
|
||||
private checkMemoryBudget;
|
||||
/**
|
||||
* ANALYZE: 收集表统计信息
|
||||
* 返回行数、平均行大小、索引深度等
|
||||
*/
|
||||
analyzeTable(tableName: string): Promise<Record<string, unknown>>;
|
||||
private ensureOpen;
|
||||
private ensureTable;
|
||||
/** Get the number of WAL records stored */
|
||||
|
||||
Reference in New Issue
Block a user