@mastra/libsql 1.21.1 → 1.22.0-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 +53 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-deployment-workers.md +2 -2
- package/dist/docs/references/docs-storage.md +1 -0
- package/dist/docs/references/reference-core-mastra-class.md +1 -1
- package/dist/index.cjs +12 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/storage/db/client.d.ts +31 -0
- package/dist/storage/db/client.d.ts.map +1 -0
- package/dist/storage/db/index.d.ts +1 -1
- package/dist/storage/db/index.d.ts.map +1 -1
- package/dist/storage/db/utils.d.ts +1 -1
- package/dist/storage/db/utils.d.ts.map +1 -1
- package/dist/storage/db/write-lock.d.ts +2 -2
- package/dist/storage/db/write-lock.d.ts.map +1 -1
- package/dist/storage/domains/agents/index.d.ts.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/dist/storage/domains/blobs/index.d.ts.map +1 -1
- package/dist/storage/domains/channels/index.d.ts.map +1 -1
- package/dist/storage/domains/datasets/index.d.ts.map +1 -1
- package/dist/storage/domains/experiments/index.d.ts.map +1 -1
- package/dist/storage/domains/favorites/index.d.ts.map +1 -1
- package/dist/storage/domains/knowledge/index.d.ts.map +1 -1
- package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -1
- package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/notifications/index.d.ts.map +1 -1
- package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -1
- package/dist/storage/domains/schedules/index.d.ts.map +1 -1
- package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/skills/index.d.ts.map +1 -1
- package/dist/storage/domains/thread-state/index.d.ts.map +1 -1
- package/dist/storage/domains/tool-provider-connections/index.d.ts.map +1 -1
- package/dist/storage/domains/utils.d.ts +1 -1
- package/dist/storage/domains/utils.d.ts.map +1 -1
- package/dist/storage/domains/workflow-definitions/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/domains/workspaces/index.d.ts.map +1 -1
- package/dist/storage/factory-storage.d.ts.map +1 -1
- package/dist/storage/index.d.ts +2 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -13054,7 +13054,7 @@ var WorkflowsLibSQL = class WorkflowsLibSQL extends WorkflowsStorage {
|
|
|
13054
13054
|
sql: `INSERT INTO ${TABLE_WORKFLOW_SNAPSHOT} (workflow_name, run_id, resourceId, snapshot, createdAt, updatedAt)
|
|
13055
13055
|
VALUES (?, ?, ?, jsonb(?), ?, ?)
|
|
13056
13056
|
ON CONFLICT(workflow_name, run_id)
|
|
13057
|
-
DO UPDATE SET resourceId = excluded.resourceId, snapshot = excluded.snapshot, updatedAt = excluded.updatedAt`,
|
|
13057
|
+
DO UPDATE SET resourceId = COALESCE(excluded.resourceId, ${TABLE_WORKFLOW_SNAPSHOT}.resourceId), snapshot = excluded.snapshot, updatedAt = excluded.updatedAt`,
|
|
13058
13058
|
args: [
|
|
13059
13059
|
workflowName,
|
|
13060
13060
|
runId,
|
|
@@ -13854,6 +13854,15 @@ var LibSQLFactoryStorageOps = class {
|
|
|
13854
13854
|
async findMany(collection, where, opts) {
|
|
13855
13855
|
return this.#select(collection, where, opts);
|
|
13856
13856
|
}
|
|
13857
|
+
async count(collection, where) {
|
|
13858
|
+
const schema = this.#schema(collection);
|
|
13859
|
+
const filter = this.#buildWhere(schema, where);
|
|
13860
|
+
const result = await this.#client.execute({
|
|
13861
|
+
sql: `SELECT COUNT(*) AS count FROM "${schema.name}" WHERE ${filter.sql}`,
|
|
13862
|
+
args: filter.args
|
|
13863
|
+
});
|
|
13864
|
+
return Number(result.rows[0]?.count ?? 0);
|
|
13865
|
+
}
|
|
13857
13866
|
async #insertOne(collection, row) {
|
|
13858
13867
|
const schema = this.#schema(collection);
|
|
13859
13868
|
const pk = primaryKeyOf(schema);
|
|
@@ -14003,7 +14012,7 @@ var LibSQLFactoryStorage = class extends FactoryStorage {
|
|
|
14003
14012
|
});
|
|
14004
14013
|
}
|
|
14005
14014
|
async close() {
|
|
14006
|
-
this.#client.close();
|
|
14015
|
+
await this.#client.close();
|
|
14007
14016
|
}
|
|
14008
14017
|
authDatabase() {
|
|
14009
14018
|
return {
|
|
@@ -14250,7 +14259,7 @@ var LibSQLStore = class extends MastraCompositeStore {
|
|
|
14250
14259
|
* Safe to call more than once; subsequent calls are no-ops.
|
|
14251
14260
|
*/
|
|
14252
14261
|
async close() {
|
|
14253
|
-
if (!this.client.closed) this.client.close();
|
|
14262
|
+
if (!this.client.closed) await this.client.close();
|
|
14254
14263
|
}
|
|
14255
14264
|
};
|
|
14256
14265
|
//#endregion
|