release: v0.2.5 — 质量加固 + Bug修复 + 性能优化 + SQL扩展
CI / test (18.x) (push) Successful in 10m4s
CI / test (20.x) (push) Successful in 10m0s
CI / test (22.x) (push) Successful in 9m58s
CI / test (24.x) (push) Successful in 9m58s

This commit is contained in:
thzxx
2026-07-29 21:50:53 +08:00
parent 29d779d96a
commit eb79b2198e
34 changed files with 2017 additions and 298 deletions
+29 -7
View File
@@ -58,7 +58,7 @@ interface DatabaseConfig {
onReady?: (db: unknown) => void;
/** 错误回调 */
onError?: (error: Error) => void;
/** 查询结果行数上限(默认 100000 表示不限制) */
/** 查询结果行数上限(默认 0,0 表示不限制) */
maxRowsPerQuery?: number;
/** 调试模式(启用后输出详细操作日志) */
debug?: boolean;
@@ -114,7 +114,7 @@ interface MetonaPlugin {
/** 销毁 */
destroy(): void;
}
declare const VERSION = "0.2.0";
declare const VERSION = "0.2.5";
/**
* metona-sqlark Plugin — 插件系统
@@ -128,7 +128,7 @@ declare class PluginManager {
private plugins;
private hooks;
/** 注册插件 */
register(plugin: MetonaPlugin): void;
register(plugin: MetonaPlugin, db?: unknown): void;
/** 卸载插件 */
unregister(pluginName: string): void;
/** 获取所有已注册插件 */
@@ -285,7 +285,17 @@ interface SelectStatement {
limit?: number;
offset?: number;
}
type Statement = SelectStatement | ExplainStatement | InsertStatement | UpdateStatement | DeleteStatement | CreateTableStatement | DropTableStatement;
interface AlterTableStatement {
type: 'ALTER_TABLE';
name: string;
action: 'ADD' | 'DROP';
column: ASTColumnDef;
}
interface TruncateTableStatement {
type: 'TRUNCATE_TABLE';
name: string;
}
type Statement = SelectStatement | ExplainStatement | InsertStatement | UpdateStatement | DeleteStatement | CreateTableStatement | DropTableStatement | AlterTableStatement | TruncateTableStatement;
/**
* metona-sqlark Query Executor — AST 执行器
@@ -296,7 +306,10 @@ type Statement = SelectStatement | ExplainStatement | InsertStatement | UpdateSt
declare class QueryExecutor {
private engine;
constructor(engine: IStorageEngine);
private maxRowsPerQuery;
constructor(engine: IStorageEngine, maxRowsPerQuery?: number);
/** 设置查询结果行数上限 */
setMaxRowsPerQuery(max: number): void;
execute(stmt: Statement): Promise<unknown>;
/** EXPLAIN: 输出查询计划 */
private executeExplain;
@@ -313,6 +326,8 @@ declare class QueryExecutor {
private executeDelete;
private executeCreateTable;
private executeDropTable;
private executeAlterTable;
private executeTruncateTable;
getEngine(): IStorageEngine;
/** 检查 SELECT 列列表中是否包含聚合函数 */
private _hasAggregateColumn;
@@ -595,6 +610,8 @@ declare class IndexedDBEngine implements IStorageEngine {
private idbDropTable;
private idbInsert;
private idbFind;
/** 尝试使用 IDB 索引进行等值查询,成功返回结果,不适用返回 null */
private tryIDBIndexLookup;
private idbUpdate;
private idbDelete;
private idbClear;
@@ -674,7 +691,7 @@ interface AriaEngineConfig {
* AriaEngine — 自研页面式存储引擎主类
* @module engine/aria/index
*
* v0.2.4: 二级索引 + MVCC 集成 + 生产加固
* v0.2.5: WAL 同步修复 + MVCC 接入 + 版本统一 + 生产加固
*/
declare class AriaEngine implements IStorageEngine {
@@ -736,6 +753,8 @@ declare class AriaEngine implements IStorageEngine {
private tryGC;
/** 检查内存预算,超出时强制 flush + GC */
private checkMemoryBudget;
/** 估算 WAL 大小(字节) */
getWALEstimatedSize(): number;
/**
* ANALYZE: 收集表统计信息
* 返回行数、平均行大小、索引深度等
@@ -857,6 +876,9 @@ declare enum TokenType {
IF = "IF",
EXISTS = "EXISTS",
FALSE = "FALSE",
ALTER = "ALTER",
ADD = "ADD",
TRUNCATE = "TRUNCATE",
INNER = "INNER",
LEFT = "LEFT",
RIGHT = "RIGHT",
@@ -964,7 +986,7 @@ declare class OPFSBackend implements IStorageBackend {
/**
* metona-sqlark — 入口文件
* @module metona-sqlark
* @version 0.1.12
* @version 0.2.5
*
* 前端关系型数据库,内存与磁盘双模式。
* 支持 Query Builder 链式 API 和 SQL 字符串查询。