@prisma/client-engine-runtime 6.9.0-dev.6 → 6.9.0-dev.8

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.
@@ -85,6 +85,7 @@ export type JoinExpression = {
85
85
  child: QueryPlanNode;
86
86
  on: [left: string, right: string][];
87
87
  parentField: string;
88
+ isRelationUnique: boolean;
88
89
  };
89
90
  export type QueryPlanNode = {
90
91
  type: 'seq';
package/dist/index.d.mts CHANGED
@@ -47,6 +47,7 @@ export declare type JoinExpression = {
47
47
  child: QueryPlanNode;
48
48
  on: [left: string, right: string][];
49
49
  parentField: string;
50
+ isRelationUnique: boolean;
50
51
  };
51
52
 
52
53
  export declare const noopTracingHelper: TracingHelper;
package/dist/index.d.ts CHANGED
@@ -47,6 +47,7 @@ export declare type JoinExpression = {
47
47
  child: QueryPlanNode;
48
48
  on: [left: string, right: string][];
49
49
  parentField: string;
50
+ isRelationUnique: boolean;
50
51
  };
51
52
 
52
53
  export declare const noopTracingHelper: TracingHelper;
package/dist/index.js CHANGED
@@ -898,7 +898,12 @@ function attachChildrenToParent(parentRecord, children) {
898
898
  }
899
899
  function filterChildRecords(records, parentRecord, joinExpr) {
900
900
  if (Array.isArray(records)) {
901
- return records.filter((record) => childRecordMatchesParent(asRecord(record), parentRecord, joinExpr));
901
+ const filtered = records.filter((record) => childRecordMatchesParent(asRecord(record), parentRecord, joinExpr));
902
+ if (joinExpr.isRelationUnique) {
903
+ return filtered.length > 0 ? filtered[0] : null;
904
+ } else {
905
+ return filtered;
906
+ }
902
907
  } else if (records === null) {
903
908
  return null;
904
909
  } else {
package/dist/index.mjs CHANGED
@@ -854,7 +854,12 @@ function attachChildrenToParent(parentRecord, children) {
854
854
  }
855
855
  function filterChildRecords(records, parentRecord, joinExpr) {
856
856
  if (Array.isArray(records)) {
857
- return records.filter((record) => childRecordMatchesParent(asRecord(record), parentRecord, joinExpr));
857
+ const filtered = records.filter((record) => childRecordMatchesParent(asRecord(record), parentRecord, joinExpr));
858
+ if (joinExpr.isRelationUnique) {
859
+ return filtered.length > 0 ? filtered[0] : null;
860
+ } else {
861
+ return filtered;
862
+ }
858
863
  } else if (records === null) {
859
864
  return null;
860
865
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "6.9.0-dev.6",
3
+ "version": "6.9.0-dev.8",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,8 +31,8 @@
31
31
  "nanoid": "5.1.5",
32
32
  "ulid": "3.0.0",
33
33
  "uuid": "11.1.0",
34
- "@prisma/debug": "6.9.0-dev.6",
35
- "@prisma/driver-adapter-utils": "6.9.0-dev.6"
34
+ "@prisma/debug": "6.9.0-dev.8",
35
+ "@prisma/driver-adapter-utils": "6.9.0-dev.8"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/jest": "29.5.14",