@zenstackhq/orm 3.0.0-beta.32 → 3.0.0-beta.33

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.cjs CHANGED
@@ -6361,7 +6361,7 @@ var ZenStackQueryExecutor = class _ZenStackQueryExecutor extends import_kysely7.
6361
6361
  parameters
6362
6362
  };
6363
6363
  }
6364
- return connection.executeQuery(compiled);
6364
+ return this.internalExecuteQuery(connection, compiled);
6365
6365
  }
6366
6366
  if ((import_kysely7.InsertQueryNode.is(query) || import_kysely7.UpdateQueryNode.is(query)) && this.hasEntityMutationPluginsWithAfterMutationHooks) {
6367
6367
  query = {
@@ -6390,7 +6390,7 @@ var ZenStackQueryExecutor = class _ZenStackQueryExecutor extends import_kysely7.
6390
6390
  return beforeMutationEntities;
6391
6391
  }, "loadBeforeMutationEntities");
6392
6392
  await this.callBeforeMutationHooks(finalQuery, mutationInfo, loadBeforeMutationEntities, connectionClient, queryId);
6393
- const result = await connection.executeQuery(compiled);
6393
+ const result = await this.internalExecuteQuery(connection, compiled);
6394
6394
  if (!this.driver.isTransactionConnection(connection)) {
6395
6395
  await this.callAfterMutationHooks(result, finalQuery, mutationInfo, connectionClient, "all", queryId);
6396
6396
  } else {
@@ -6527,7 +6527,7 @@ var ZenStackQueryExecutor = class _ZenStackQueryExecutor extends import_kysely7.
6527
6527
  where: this.andNodes(selectQueryNode.where, where)
6528
6528
  };
6529
6529
  const compiled = this.compileQuery(selectQueryNode, (0, import_kysely7.createQueryId)());
6530
- const result = await connection.executeQuery(compiled);
6530
+ const result = await this.internalExecuteQuery(connection, compiled);
6531
6531
  return result.rows;
6532
6532
  }
6533
6533
  andNodes(condition1, condition2) {
@@ -6539,6 +6539,13 @@ var ZenStackQueryExecutor = class _ZenStackQueryExecutor extends import_kysely7.
6539
6539
  return condition2;
6540
6540
  }
6541
6541
  }
6542
+ async internalExecuteQuery(connection, compiledQuery) {
6543
+ try {
6544
+ return await connection.executeQuery(compiledQuery);
6545
+ } catch (err) {
6546
+ throw createDBQueryError("Failed to execute query", err, compiledQuery.sql, compiledQuery.parameters);
6547
+ }
6548
+ }
6542
6549
  };
6543
6550
 
6544
6551
  // src/client/functions.ts