orange-orm 4.9.0 → 4.9.1

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.
@@ -4132,8 +4132,10 @@ function requireNewShallowJoinSqlCore () {
4132
4132
 
4133
4133
  function _new(context, rightTable, leftColumns, rightColumns, leftAlias, rightAlias, filter) {
4134
4134
  const quote = getSessionSingleton(context, 'quote');
4135
- leftAlias = quote(leftAlias);
4136
- rightAlias = quote(rightAlias);
4135
+ const leftAliasRaw = leftAlias;
4136
+ const rightAliasRaw = rightAlias;
4137
+ leftAlias = quote(leftAliasRaw);
4138
+ rightAlias = quote(rightAliasRaw);
4137
4139
  var sql = '';
4138
4140
  var delimiter = '';
4139
4141
  for (var i = 0; i < leftColumns.length; i++) {
@@ -4147,7 +4149,7 @@ function requireNewShallowJoinSqlCore () {
4147
4149
  sql += delimiter + leftAlias + '.' + quote(leftColumn._dbName) + '=' + rightAlias + '.' + quote(rightColumn._dbName);
4148
4150
  }
4149
4151
 
4150
- sql += newDiscriminatorSql(context, rightTable, rightAlias);
4152
+ sql += newDiscriminatorSql(context, rightTable, rightAliasRaw);
4151
4153
  var result = newParameterized(sql);
4152
4154
  if (filter)
4153
4155
  result = result.append(delimiter).append(filter);
package/dist/index.mjs CHANGED
@@ -4133,8 +4133,10 @@ function requireNewShallowJoinSqlCore () {
4133
4133
 
4134
4134
  function _new(context, rightTable, leftColumns, rightColumns, leftAlias, rightAlias, filter) {
4135
4135
  const quote = getSessionSingleton(context, 'quote');
4136
- leftAlias = quote(leftAlias);
4137
- rightAlias = quote(rightAlias);
4136
+ const leftAliasRaw = leftAlias;
4137
+ const rightAliasRaw = rightAlias;
4138
+ leftAlias = quote(leftAliasRaw);
4139
+ rightAlias = quote(rightAliasRaw);
4138
4140
  var sql = '';
4139
4141
  var delimiter = '';
4140
4142
  for (var i = 0; i < leftColumns.length; i++) {
@@ -4148,7 +4150,7 @@ function requireNewShallowJoinSqlCore () {
4148
4150
  sql += delimiter + leftAlias + '.' + quote(leftColumn._dbName) + '=' + rightAlias + '.' + quote(rightColumn._dbName);
4149
4151
  }
4150
4152
 
4151
- sql += newDiscriminatorSql(context, rightTable, rightAlias);
4153
+ sql += newDiscriminatorSql(context, rightTable, rightAliasRaw);
4152
4154
  var result = newParameterized(sql);
4153
4155
  if (filter)
4154
4156
  result = result.append(delimiter).append(filter);
package/docs/changelog.md CHANGED
@@ -1,4 +1,6 @@
1
1
  ## Changelog
2
+ __4.9.1__
3
+ Fix: Avoid double-quoting aliases in discriminator join SQL [#144](https://github.com/alfateam/orange-orm/issues/144)
2
4
  __4.9.0__
3
5
  Node.js 22.5+: Continues using built-in `node:sqlite` (no action needed)
4
6
  Node.js 18-22.4: Now requires `better-sqlite3` instead of `sqlite3`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orange-orm",
3
- "version": "4.9.0",
3
+ "version": "4.9.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -4,8 +4,10 @@ const getSessionSingleton = require('../../../getSessionSingleton');
4
4
 
5
5
  function _new(context, rightTable, leftColumns, rightColumns, leftAlias, rightAlias, filter) {
6
6
  const quote = getSessionSingleton(context, 'quote');
7
- leftAlias = quote(leftAlias);
8
- rightAlias = quote(rightAlias);
7
+ const leftAliasRaw = leftAlias;
8
+ const rightAliasRaw = rightAlias;
9
+ leftAlias = quote(leftAliasRaw);
10
+ rightAlias = quote(rightAliasRaw);
9
11
  var sql = '';
10
12
  var delimiter = '';
11
13
  for (var i = 0; i < leftColumns.length; i++) {
@@ -19,11 +21,11 @@ function _new(context, rightTable, leftColumns, rightColumns, leftAlias, rightAl
19
21
  sql += delimiter + leftAlias + '.' + quote(leftColumn._dbName) + '=' + rightAlias + '.' + quote(rightColumn._dbName);
20
22
  }
21
23
 
22
- sql += newDiscriminatorSql(context, rightTable, rightAlias);
24
+ sql += newDiscriminatorSql(context, rightTable, rightAliasRaw);
23
25
  var result = newParameterized(sql);
24
26
  if (filter)
25
27
  result = result.append(delimiter).append(filter);
26
28
  return result;
27
29
  }
28
30
 
29
- module.exports = _new;
31
+ module.exports = _new;