diff --git a/package-shared/functions/dsql/sql/sql-generator.js b/package-shared/functions/dsql/sql/sql-generator.js index 3339764..f258db3 100644 --- a/package-shared/functions/dsql/sql/sql-generator.js +++ b/package-shared/functions/dsql/sql/sql-generator.js @@ -121,7 +121,17 @@ function sqlGenerator({ tableName, genObject }) { return `'${mtch.targetLiteral}'`; } - if (join.alias) return `${join.alias}.${mtch.target}`; + if (join.alias) { + return `${ + typeof mtch.target == "object" + ? mtch.target.tableName + : join.alias + }.${ + typeof mtch.target == "object" + ? mtch.target.fieldName + : mtch.target + }`; + } return `${ typeof mtch.target == "object" diff --git a/package.json b/package.json index 92e14ba..bd92d2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "3.2.7", + "version": "3.2.8", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {