@mastra/libsql 1.6.3-alpha.0 → 1.6.4-alpha.0

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.
@@ -71,13 +71,13 @@ const results = await store.query({
71
71
 
72
72
  ## Constructor Options
73
73
 
74
- **url:** (`string`): libSQL database URL. Use ':memory:' for in-memory database, 'file:dbname.db' for local file, or a libSQL-compatible connection string like 'libsql://your-database.turso.io'.
74
+ **url** (`string`): libSQL database URL. Use ':memory:' for in-memory database, 'file:dbname.db' for local file, or a libSQL-compatible connection string like 'libsql://your-database.turso.io'.
75
75
 
76
- **authToken?:** (`string`): Authentication token for Turso cloud databases
76
+ **authToken** (`string`): Authentication token for Turso cloud databases
77
77
 
78
- **syncUrl?:** (`string`): URL for database replication (Turso specific)
78
+ **syncUrl** (`string`): URL for database replication (Turso specific)
79
79
 
80
- **syncInterval?:** (`number`): Interval in milliseconds for database sync (Turso specific)
80
+ **syncInterval** (`number`): Interval in milliseconds for database sync (Turso specific)
81
81
 
82
82
  ## Methods
83
83
 
@@ -85,45 +85,45 @@ const results = await store.query({
85
85
 
86
86
  Creates a new vector collection. The index name must start with a letter or underscore and can only contain letters, numbers, and underscores. The dimension must be a positive integer.
87
87
 
88
- **indexName:** (`string`): Name of the index to create
88
+ **indexName** (`string`): Name of the index to create
89
89
 
90
- **dimension:** (`number`): Vector dimension size (must match your embedding model)
90
+ **dimension** (`number`): Vector dimension size (must match your embedding model)
91
91
 
92
- **metric?:** (`'cosine' | 'euclidean' | 'dotproduct'`): Distance metric for similarity search. Note: Currently only cosine similarity is supported by libSQL. (Default: `cosine`)
92
+ **metric** (`'cosine' | 'euclidean' | 'dotproduct'`): Distance metric for similarity search. Note: Currently only cosine similarity is supported by libSQL. (Default: `cosine`)
93
93
 
94
94
  ### upsert()
95
95
 
96
96
  Adds or updates vectors and their metadata in the index. Uses a transaction to ensure all vectors are inserted atomically - if any insert fails, the entire operation is rolled back.
97
97
 
98
- **indexName:** (`string`): Name of the index to insert into
98
+ **indexName** (`string`): Name of the index to insert into
99
99
 
100
- **vectors:** (`number[][]`): Array of embedding vectors
100
+ **vectors** (`number[][]`): Array of embedding vectors
101
101
 
102
- **metadata?:** (`Record<string, any>[]`): Metadata for each vector
102
+ **metadata** (`Record<string, any>[]`): Metadata for each vector
103
103
 
104
- **ids?:** (`string[]`): Optional vector IDs (auto-generated if not provided)
104
+ **ids** (`string[]`): Optional vector IDs (auto-generated if not provided)
105
105
 
106
106
  ### query()
107
107
 
108
108
  Searches for similar vectors with optional metadata filtering.
109
109
 
110
- **indexName:** (`string`): Name of the index to search in
110
+ **indexName** (`string`): Name of the index to search in
111
111
 
112
- **queryVector:** (`number[]`): Query vector to find similar vectors for
112
+ **queryVector** (`number[]`): Query vector to find similar vectors for
113
113
 
114
- **topK?:** (`number`): Number of results to return (Default: `10`)
114
+ **topK** (`number`): Number of results to return (Default: `10`)
115
115
 
116
- **filter?:** (`Filter`): Metadata filters
116
+ **filter** (`Filter`): Metadata filters
117
117
 
118
- **includeVector?:** (`boolean`): Whether to include vector data in results (Default: `false`)
118
+ **includeVector** (`boolean`): Whether to include vector data in results (Default: `false`)
119
119
 
120
- **minScore?:** (`number`): Minimum similarity score threshold (Default: `0`)
120
+ **minScore** (`number`): Minimum similarity score threshold (Default: `0`)
121
121
 
122
122
  ### describeIndex()
123
123
 
124
124
  Gets information about an index.
125
125
 
126
- **indexName:** (`string`): Name of the index to describe
126
+ **indexName** (`string`): Name of the index to describe
127
127
 
128
128
  Returns:
129
129
 
@@ -139,7 +139,7 @@ interface IndexStats {
139
139
 
140
140
  Deletes an index and all its data.
141
141
 
142
- **indexName:** (`string`): Name of the index to delete
142
+ **indexName** (`string`): Name of the index to delete
143
143
 
144
144
  ### listIndexes()
145
145
 
@@ -151,41 +151,41 @@ Returns: `Promise<string[]>`
151
151
 
152
152
  Removes all vectors from an index while keeping the index structure.
153
153
 
154
- **indexName:** (`string`): Name of the index to truncate
154
+ **indexName** (`string`): Name of the index to truncate
155
155
 
156
156
  ### updateVector()
157
157
 
158
158
  Update a single vector by ID or by metadata filter. Either `id` or `filter` must be provided, but not both.
159
159
 
160
- **indexName:** (`string`): Name of the index containing the vector
160
+ **indexName** (`string`): Name of the index containing the vector
161
161
 
162
- **id?:** (`string`): ID of the vector entry to update (mutually exclusive with filter)
162
+ **id** (`string`): ID of the vector entry to update (mutually exclusive with filter)
163
163
 
164
- **filter?:** (`Record<string, any>`): Metadata filter to identify vector(s) to update (mutually exclusive with id)
164
+ **filter** (`Record<string, any>`): Metadata filter to identify vector(s) to update (mutually exclusive with id)
165
165
 
166
- **update:** (`object`): Update data containing vector and/or metadata
166
+ **update** (`object`): Update data containing vector and/or metadata
167
167
 
168
- **update.vector?:** (`number[]`): New vector data to update
168
+ **update.vector** (`number[]`): New vector data to update
169
169
 
170
- **update.metadata?:** (`Record<string, any>`): New metadata to update
170
+ **update.metadata** (`Record<string, any>`): New metadata to update
171
171
 
172
172
  ### deleteVector()
173
173
 
174
174
  Deletes a specific vector entry from an index by its ID.
175
175
 
176
- **indexName:** (`string`): Name of the index containing the vector
176
+ **indexName** (`string`): Name of the index containing the vector
177
177
 
178
- **id:** (`string`): ID of the vector entry to delete
178
+ **id** (`string`): ID of the vector entry to delete
179
179
 
180
180
  ### deleteVectors()
181
181
 
182
182
  Delete multiple vectors by IDs or by metadata filter. Either `ids` or `filter` must be provided, but not both.
183
183
 
184
- **indexName:** (`string`): Name of the index containing the vectors to delete
184
+ **indexName** (`string`): Name of the index containing the vectors to delete
185
185
 
186
- **ids?:** (`string[]`): Array of vector IDs to delete (mutually exclusive with filter)
186
+ **ids** (`string[]`): Array of vector IDs to delete (mutually exclusive with filter)
187
187
 
188
- **filter?:** (`Record<string, any>`): Metadata filter to identify vectors to delete (mutually exclusive with ids)
188
+ **filter** (`Record<string, any>`): Metadata filter to identify vectors to delete (mutually exclusive with ids)
189
189
 
190
190
  ## Response Types
191
191
 
package/dist/index.cjs CHANGED
@@ -3900,6 +3900,10 @@ var ExperimentsLibSQL = class extends storage.ExperimentsStorage {
3900
3900
  updates.push("failedCount = ?");
3901
3901
  values.push(input.failedCount);
3902
3902
  }
3903
+ if (input.totalItems !== void 0) {
3904
+ updates.push("totalItems = ?");
3905
+ values.push(input.totalItems);
3906
+ }
3903
3907
  if (input.startedAt !== void 0) {
3904
3908
  updates.push("startedAt = ?");
3905
3909
  values.push(input.startedAt?.toISOString() ?? null);