drizzle-orm 0.10.12 → 0.10.13

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.
@@ -45,7 +45,8 @@ class SelectAggregator extends abstractAggregator_1.default {
45
45
  this.orderBy = (column, order) => {
46
46
  if (column !== null && column !== undefined) {
47
47
  this._orderBy.push('ORDER BY ');
48
- this._orderBy.push(`${column.getColumnName()} `);
48
+ const columnParent = this._joinCache[column.getParent().tableName()] ? this._joinCache[column.getParent().tableName()] : column.getParent();
49
+ this._orderBy.push(`${columnParent}.${ecranate_1.ecranate(column.getColumnName())} `);
49
50
  this._orderBy.push(order_1.default[order]);
50
51
  }
51
52
  return this;
@@ -15,7 +15,7 @@ class ConstArray extends where_1.default {
15
15
  finalArray.push(`$${nextPosition}`);
16
16
  finalValues.push(`${value.toISOString()}`);
17
17
  }
18
- if (ecranate_1.shouldEcranate(value)) {
18
+ else if (ecranate_1.shouldEcranate(value)) {
19
19
  finalArray.push(`$${nextPosition}`);
20
20
  finalValues.push(`${value.toString()}`);
21
21
  }
@@ -28,7 +28,7 @@ class ConstArray extends where_1.default {
28
28
  }
29
29
  nextPosition += 1;
30
30
  }
31
- return { query: finalArray.join(','), values: finalValues };
31
+ return { query: finalArray.join(''), values: finalValues };
32
32
  };
33
33
  this.values = values;
34
34
  }
@@ -9,6 +9,9 @@ class PgInteger extends columnType_1.default {
9
9
  this.dbName = 'INT';
10
10
  }
11
11
  selectStrategy(value) {
12
+ if (typeof value === 'string') {
13
+ return value ? parseInt(value, 10) : undefined;
14
+ }
12
15
  return value;
13
16
  }
14
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-orm",
3
- "version": "0.10.12",
3
+ "version": "0.10.13",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",