@mastra/libsql 1.17.1-alpha.0 → 1.17.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-memory-message-history.md +1 -1
- package/dist/docs/references/reference-memory-memory-class.md +1 -1
- package/dist/index.cjs +6 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -39
- package/dist/index.js.map +1 -1
- package/dist/storage/factory-storage.d.ts +0 -3
- package/dist/storage/factory-storage.d.ts.map +1 -1
- package/dist/storage/index.d.ts +1 -9
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts +1 -7
- package/dist/vector/index.d.ts.map +1 -1
- package/dist/vector/sql-builder.d.ts.map +1 -1
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -544,29 +544,14 @@ var LibSQLVector = class extends MastraVector {
|
|
|
544
544
|
this.vectorIndexes = this.isMemoryDb ? Promise.resolve(/* @__PURE__ */ new Set()) : this.discoverVectorIndexes();
|
|
545
545
|
}
|
|
546
546
|
/**
|
|
547
|
-
* Closes the underlying libsql client, releasing
|
|
548
|
-
*
|
|
549
|
-
* For local file databases, first runs PRAGMA wal_checkpoint(TRUNCATE) and
|
|
550
|
-
* switches back to journal_mode=DELETE so the -wal and -shm sidecar files
|
|
551
|
-
* are released promptly (mirrors LibSQLStore.close()).
|
|
552
|
-
*
|
|
553
|
-
* Remote (Turso) databases skip the WAL pragmas and just close the client.
|
|
547
|
+
* Closes the underlying libsql client, releasing this vector store's OS file handles.
|
|
554
548
|
*
|
|
555
549
|
* Safe to call more than once; subsequent calls are no-ops.
|
|
556
550
|
*/
|
|
557
551
|
async close() {
|
|
558
|
-
if (this.turso.closed) {
|
|
559
|
-
|
|
560
|
-
}
|
|
561
|
-
if (this.turso.protocol === "file" && !this.isMemoryDb) {
|
|
562
|
-
try {
|
|
563
|
-
await this.turso.execute("PRAGMA wal_checkpoint(TRUNCATE);");
|
|
564
|
-
await this.turso.execute("PRAGMA journal_mode=DELETE;");
|
|
565
|
-
} catch (err) {
|
|
566
|
-
this.logger.warn("LibSQLVector: Failed to checkpoint WAL before close.", err);
|
|
567
|
-
}
|
|
552
|
+
if (!this.turso.closed) {
|
|
553
|
+
this.turso.close();
|
|
568
554
|
}
|
|
569
|
-
this.turso.close();
|
|
570
555
|
}
|
|
571
556
|
async discoverVectorIndexes() {
|
|
572
557
|
try {
|
|
@@ -14016,32 +14001,14 @@ var LibSQLStore = class extends MastraCompositeStore {
|
|
|
14016
14001
|
await this.initDomainsSequentially();
|
|
14017
14002
|
}
|
|
14018
14003
|
/**
|
|
14019
|
-
* Closes the underlying libsql client, releasing
|
|
14020
|
-
*
|
|
14021
|
-
* For local file databases, first runs PRAGMA wal_checkpoint(TRUNCATE) and
|
|
14022
|
-
* switches back to journal_mode=DELETE so that Windows releases the -wal
|
|
14023
|
-
* and -shm sidecar files promptly. Without this, the handles stay open
|
|
14024
|
-
* until process exit, causing EBUSY errors when callers try to fs.rm the
|
|
14025
|
-
* storage directory after Mastra.shutdown().
|
|
14026
|
-
*
|
|
14027
|
-
* Remote (Turso) databases skip the WAL pragmas and just close the client.
|
|
14004
|
+
* Closes the underlying libsql client, releasing this store's OS file handles.
|
|
14028
14005
|
*
|
|
14029
14006
|
* Safe to call more than once; subsequent calls are no-ops.
|
|
14030
14007
|
*/
|
|
14031
14008
|
async close() {
|
|
14032
|
-
if (this.client.closed) {
|
|
14033
|
-
|
|
14034
|
-
}
|
|
14035
|
-
const isLocalFileDb = this.isLocalDb || this.client.protocol === "file";
|
|
14036
|
-
if (isLocalFileDb) {
|
|
14037
|
-
try {
|
|
14038
|
-
await this.client.execute("PRAGMA wal_checkpoint(TRUNCATE);");
|
|
14039
|
-
await this.client.execute("PRAGMA journal_mode=DELETE;");
|
|
14040
|
-
} catch (err) {
|
|
14041
|
-
this.logger.warn("LibSQLStore: Failed to checkpoint WAL before close.", err);
|
|
14042
|
-
}
|
|
14009
|
+
if (!this.client.closed) {
|
|
14010
|
+
this.client.close();
|
|
14043
14011
|
}
|
|
14044
|
-
this.client.close();
|
|
14045
14012
|
}
|
|
14046
14013
|
};
|
|
14047
14014
|
|