@sqb/connect
Advanced tools
Comparing version 4.0.1-beta.4 to 4.0.1-beta.5
@@ -63,2 +63,4 @@ "use strict"; | ||
.from(entity.tableName + ' as T'); | ||
if (args.distinct) | ||
query.distinct(); | ||
if (ctx.joins) | ||
@@ -200,8 +202,9 @@ for (const j of ctx.joins) { | ||
let suffix = ''; | ||
let _entityDef = entityDef; | ||
if (elName.includes('.')) { | ||
const a = elName.split('.'); | ||
while (a.length > 1) { | ||
const col = entityDef.getElement(a.shift() || ''); | ||
const col = _entityDef.getElement(a.shift() || ''); | ||
if (embedded_element_meta_1.isEmbeddedElement(col)) { | ||
entityDef = await col.resolveType(); | ||
_entityDef = await col.resolveType(); | ||
if (col.fieldNamePrefix) | ||
@@ -215,3 +218,3 @@ prefix += col.fieldNamePrefix; | ||
tableAlias = joinInfo.joinAlias; | ||
entityDef = joinInfo.targetEntity; | ||
_entityDef = joinInfo.targetEntity; | ||
} | ||
@@ -223,3 +226,3 @@ else | ||
} | ||
const col = entityDef.getElement(elName); | ||
const col = _entityDef.getElement(elName); | ||
if (!col) | ||
@@ -226,0 +229,0 @@ throw new Error(`Unknown element (${elName}) declared in sort property`); |
@@ -26,2 +26,3 @@ import { SqbClient } from '../client/SqbClient'; | ||
offset?: number; | ||
distinct?: boolean; | ||
} | ||
@@ -28,0 +29,0 @@ interface FindAllOptions extends FindOneOptions { |
@@ -117,1 +117,3 @@ import type { AbstractElementMeta } from './metadata/abstract-element-meta'; | ||
} | ||
export interface RelationLink { | ||
} |
{ | ||
"name": "@sqb/connect", | ||
"description": "Multi-dialect database connection framework written with TypeScript", | ||
"version": "4.0.1-beta.4", | ||
"version": "4.0.1-beta.5", | ||
"author": "Panates Ltd.", | ||
@@ -47,3 +47,3 @@ "contributors": [ | ||
"peerDependencies": { | ||
"@sqb/builder": "^4.0.1-beta.4" | ||
"@sqb/builder": "^4.0.1-beta.5" | ||
}, | ||
@@ -50,0 +50,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
176638
4269