@mastra/libsql 1.23.0 → 1.23.1-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.
package/dist/index.js CHANGED
@@ -14407,10 +14407,15 @@ var LibSQLFactoryStorageOps = class {
14407
14407
  const filter = this.#buildWhere(schema, where);
14408
14408
  const sql = `UPDATE "${schema.name}" SET ${columns.map((c) => `"${c}" = ?`).join(", ")} WHERE ${filter.sql}`;
14409
14409
  const args = [...columns.map((column) => this.#serialize(this.#column(schema, column), set[column])), ...filter.args];
14410
- return (await this.#client.execute({
14411
- sql,
14412
- args
14413
- })).rowsAffected;
14410
+ try {
14411
+ return (await this.#client.execute({
14412
+ sql,
14413
+ args
14414
+ })).rowsAffected;
14415
+ } catch (error) {
14416
+ if (isUniqueViolation(error)) throw new UniqueViolationError(collection, { cause: error });
14417
+ throw error;
14418
+ }
14414
14419
  }
14415
14420
  async updateMany(collection, where, set) {
14416
14421
  return this.#withWriteLock(() => this.#updateMany(collection, where, set));