kysely-hydrate 0.4.1 → 0.4.2

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.
Files changed (2) hide show
  1. package/dist/index.mjs +5 -4
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -601,12 +601,13 @@ var HydratedQueryBuilderImpl = class HydratedQueryBuilderImpl {
601
601
  return this.#hydrate(rows);
602
602
  }
603
603
  async executeTakeFirst() {
604
- const result = await this.#props.qb.executeTakeFirst();
605
- return result ? this.#hydrate(result) : void 0;
604
+ const [result] = await this.execute();
605
+ return result;
606
606
  }
607
607
  async executeTakeFirstOrThrow(errorConstructor = k.NoResultError) {
608
- const result = await this.#props.qb.executeTakeFirstOrThrow(errorConstructor);
609
- return this.#hydrate(result);
608
+ const result = await this.executeTakeFirst();
609
+ if (result === void 0) throw k.isNoResultErrorConstructor(errorConstructor) ? new errorConstructor(this.toOperationNode()) : errorConstructor(this.toOperationNode());
610
+ return result;
610
611
  }
611
612
  extras(extras) {
612
613
  return new HydratedQueryBuilderImpl({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kysely-hydrate",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Explicit ORM-style queries with Kysely",
5
5
  "license": "MIT",
6
6
  "author": {