feat: v0.2.4 异步Compaction + 槽位压缩 + EXPLAIN + 慢查询日志
CI / test (18.x) (push) Failing after 5m0s
CI / test (20.x) (push) Failing after 4m58s
CI / test (22.x) (push) Failing after 4m58s
CI / test (24.x) (push) Failing after 4m57s

This commit is contained in:
thzxx
2026-07-27 21:53:13 +08:00
parent da999d607b
commit 82e6baaae9
4 changed files with 104 additions and 2 deletions
+7
View File
@@ -142,6 +142,7 @@ export class MetonaSqlark {
/** 执行 SQL 字符串查询 */
async query(sql: string): Promise<unknown> {
this.ensureReady();
const startTime = this.debug ? Date.now() : 0;
await this.pluginManager.trigger('beforeQuery', sql);
@@ -150,6 +151,12 @@ export class MetonaSqlark {
await this.pluginManager.trigger('afterQuery', sql, result);
if (this.debug) {
const elapsed = Date.now() - startTime;
const rows = Array.isArray(result) ? (result as any[]).length : 0;
this._debug(`query [${elapsed}ms] ${rows} rows: ${sql.slice(0, 100)}`);
}
return result;
}