@sqb/connect
Advanced tools
Comparing version 4.0.1-beta.43 to 4.0.1-beta.44
@@ -30,3 +30,3 @@ "use strict"; | ||
(0, builder_1.LeftOuterJoin)(targetEntity.tableName + ' as ' + joinAlias); | ||
join.on((0, builder_1.Eq)(joinAlias + '.' + targetCol.fieldName, (0, builder_1.Raw)(parentAlias + '.' + keyCol.fieldName))); | ||
join.on((0, builder_1.Eq)((0, builder_1.Field)(joinAlias + '.' + targetCol.fieldName, targetCol.dataType, targetCol.isArray), (0, builder_1.Field)(parentAlias + '.' + keyCol.fieldName, keyCol.dataType, keyCol.isArray))); | ||
if (node.conditions) | ||
@@ -72,4 +72,4 @@ await prepareFilter(targetEntity, node.conditions, join._conditions, joinAlias); | ||
if ((0, builder_1.isCompOperator)(item)) { | ||
if (typeof item._expression === 'string') { | ||
const itemPath = item._expression.split('.'); | ||
if (typeof item._left === 'string') { | ||
const itemPath = item._left.split('.'); | ||
const l = itemPath.length; | ||
@@ -84,13 +84,13 @@ let pt; | ||
if (!col) | ||
throw new Error(`Unknown property (${item._expression}) defined in filter`); | ||
throw new Error(`Unknown property (${item._left}) defined in filter`); | ||
// if last item on path | ||
if (i === l - 1) { | ||
if (!(0, orm_helper_1.isColumnElement)(col)) | ||
throw new Error(`Invalid column expression (${item._expression}) defined in filter`); | ||
throw new Error(`Invalid column expression (${item._left}) defined in filter`); | ||
const ctor = Object.getPrototypeOf(item).constructor; | ||
trgOp.add(new ctor(_curAlias + '.' + col.fieldName, item._value)); | ||
trgOp.add(new ctor((0, builder_1.Field)(_curAlias + '.' + col.fieldName, col.dataType, col.isArray), item._right)); | ||
} | ||
else { | ||
if ((0, orm_helper_1.isColumnElement)(col)) | ||
throw new Error(`Invalid column (${item._expression}) defined in filter`); | ||
throw new Error(`Invalid column (${item._left}) defined in filter`); | ||
if ((0, orm_helper_1.isObjectElement)(col)) { | ||
@@ -101,3 +101,3 @@ _curEntity = await col.resolveType(); | ||
if (!(0, orm_helper_1.isAssociationElement)(col)) | ||
throw new Error(`Invalid column (${item._expression}) defined in filter`); | ||
throw new Error(`Invalid column (${item._left}) defined in filter`); | ||
let node; | ||
@@ -110,3 +110,3 @@ _curEntity = await col.association.resolveTarget(); | ||
.from(_curEntity.tableName + ' K'); | ||
subSelect.where((0, builder_1.Eq)('K.' + targetCol.fieldName, (0, builder_1.Raw)(tableAlias + '.' + keyCol.fieldName))); | ||
subSelect.where((0, builder_1.Eq)((0, builder_1.Field)('K.' + targetCol.fieldName, targetCol.dataType, targetCol.isArray), (0, builder_1.Field)(tableAlias + '.' + keyCol.fieldName, keyCol.dataType, keyCol.isArray))); | ||
trgOp.add((0, builder_1.Exists)(subSelect)); | ||
@@ -128,3 +128,3 @@ trgOp = subSelect._where; | ||
subSelect.join((0, builder_1.InnerJoin)(targetEntity.tableName + ' ' + joinAlias) | ||
.on((0, builder_1.Eq)(joinAlias + '.' + targetColumn.fieldName, (0, builder_1.Raw)(_curAlias + '.' + sourceColumn.fieldName)))); | ||
.on((0, builder_1.Eq)((0, builder_1.Field)(joinAlias + '.' + targetColumn.fieldName, targetColumn.dataType, targetColumn.isArray), (0, builder_1.Field)(_curAlias + '.' + sourceColumn.fieldName, sourceColumn.dataType, sourceColumn.isArray)))); | ||
_curEntity = targetEntity; | ||
@@ -131,0 +131,0 @@ _curAlias = joinAlias; |
{ | ||
"name": "@sqb/connect", | ||
"description": "Multi-dialect database connection framework written with TypeScript", | ||
"version": "4.0.1-beta.43", | ||
"version": "4.0.1-beta.44", | ||
"author": "Panates Ltd.", | ||
@@ -48,3 +48,3 @@ "contributors": [ | ||
"peerDependencies": { | ||
"@sqb/builder": "^4.0.1-beta.43" | ||
"@sqb/builder": "^4.0.1-beta.44" | ||
}, | ||
@@ -51,0 +51,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
185703