@casekit/orm2 1.0.2 → 1.0.3

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.
@@ -144,7 +144,7 @@ export const buildFind = (config, middleware, modelName, query, lateralBy = [],
144
144
  const joinColumns = relation.from.columns.map((fk, i) => {
145
145
  const toColumnName = relation.to.columns[i];
146
146
  // Find the column in the subquery that matches the join key
147
- const toColumn = joinBuilder.columns.find(col => col.table === joinBuilder.table.alias &&
147
+ const toColumn = joinBuilder.columns.find((col) => col.table === joinBuilder.table.alias &&
148
148
  col.name === toColumnName);
149
149
  if (!toColumn) {
150
150
  throw new Error(`Join key column ${toColumnName} not found in select for relation ${r}`);
@@ -176,7 +176,7 @@ export const buildFind = (config, middleware, modelName, query, lateralBy = [],
176
176
  });
177
177
  // Add columns but update their table reference to the subquery alias
178
178
  // and use the column's alias as the name since that's what the subquery outputs
179
- builder.columns.push(...joinBuilder.columns.map(col => ({
179
+ builder.columns.push(...joinBuilder.columns.map((col) => ({
180
180
  ...col,
181
181
  table: subqueryAlias,
182
182
  name: col.alias, // The subquery outputs columns with their aliases
@@ -500,7 +500,10 @@ describe("findToSql", () => {
500
500
  },
501
501
  columns: [
502
502
  {
503
- from: { table: "b", name: "department_id" },
503
+ from: {
504
+ table: "b",
505
+ name: "department_id",
506
+ },
504
507
  to: { table: "c", name: "id" },
505
508
  },
506
509
  ],
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@casekit/orm2",
3
3
  "description": "",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "author": "",
6
6
  "dependencies": {
7
7
  "es-toolkit": "^1.39.3",
8
8
  "object-hash": "^3.0.0",
9
9
  "pino": "^9.7.0",
10
10
  "uuid": "^11.1.0",
11
- "@casekit/orm2-config": "1.0.2",
12
- "@casekit/orm2-schema": "1.0.2",
13
- "@casekit/toolbox": "1.0.2",
14
- "@casekit/sql": "1.0.2"
11
+ "@casekit/orm2-config": "1.0.3",
12
+ "@casekit/orm2-schema": "1.0.3",
13
+ "@casekit/sql": "1.0.3",
14
+ "@casekit/toolbox": "1.0.3"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@casekit/unindent": "^1.0.5",
@@ -31,10 +31,10 @@
31
31
  "typescript-eslint": "^8.34.1",
32
32
  "vite-tsconfig-paths": "^5.1.4",
33
33
  "vitest": "^3.2.4",
34
- "@casekit/orm2-fixtures": "1.0.2",
35
- "@casekit/orm2-testing": "1.0.2",
36
- "@casekit/tsconfig": "1.0.2",
37
- "@casekit/prettier-config": "1.0.2"
34
+ "@casekit/orm2-fixtures": "1.0.3",
35
+ "@casekit/orm2-testing": "1.0.3",
36
+ "@casekit/tsconfig": "1.0.3",
37
+ "@casekit/prettier-config": "1.0.3"
38
38
  },
39
39
  "exports": {
40
40
  ".": "./build/index.js"