remult 0.26.17 → 0.26.18

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.
@@ -138,7 +138,10 @@ class KnexEntityDataProvider {
138
138
  if (x.isServerExpression) {
139
139
  }
140
140
  else {
141
- cols.push(e.$dbNameOf(x));
141
+ let name = e.$dbNameOf(x);
142
+ if (x.options.sqlExpression)
143
+ name = this.knex.raw('?? as ' + x.key, [name]);
144
+ cols.push(name);
142
145
  colKeys.push(x);
143
146
  }
144
147
  }
@@ -318,6 +318,8 @@ class ActualSQLServerDataProvider {
318
318
  if (colKeys.length > 0)
319
319
  select += ', ';
320
320
  select += e.$dbNameOf(x);
321
+ if (x.options.sqlExpression)
322
+ select += ' as ' + x.key;
321
323
  colKeys.push(x);
322
324
  }
323
325
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.26.17",
3
+ "version": "0.26.18",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -229,7 +229,7 @@ var KnexEntityDataProvider = /** @class */ (function () {
229
229
  };
230
230
  KnexEntityDataProvider.prototype.find = function (options) {
231
231
  return tslib_1.__awaiter(this, void 0, void 0, function () {
232
- var e, cols, colKeys, _a, _b, x, query, br, r_1, r;
232
+ var e, cols, colKeys, _a, _b, x, name_1, query, br, r_1, r;
233
233
  var e_3, _c;
234
234
  return tslib_1.__generator(this, function (_d) {
235
235
  switch (_d.label) {
@@ -244,7 +244,10 @@ var KnexEntityDataProvider = /** @class */ (function () {
244
244
  if (x.isServerExpression) {
245
245
  }
246
246
  else {
247
- cols.push(e.$dbNameOf(x));
247
+ name_1 = e.$dbNameOf(x);
248
+ if (x.options.sqlExpression)
249
+ name_1 = this.knex.raw('?? as ' + x.key, [name_1]);
250
+ cols.push(name_1);
248
251
  colKeys.push(x);
249
252
  }
250
253
  }
@@ -462,6 +462,8 @@ var ActualSQLServerDataProvider = /** @class */ (function () {
462
462
  if (colKeys.length > 0)
463
463
  select += ', ';
464
464
  select += e.$dbNameOf(x);
465
+ if (x.options.sqlExpression)
466
+ select += ' as ' + x.key;
465
467
  colKeys.push(x);
466
468
  }
467
469
  }