jsharmony 1.26.2 → 1.26.3
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.
- package/jsHarmony.LoadSQL.js +12 -1
- package/package.json +1 -1
package/jsHarmony.LoadSQL.js
CHANGED
|
@@ -717,12 +717,14 @@ exports.ParseSQLObjects = function(){
|
|
|
717
717
|
_.each(obj.dependencies, function(tblname){ obj._dependencies[tblname] = tblname; });
|
|
718
718
|
}
|
|
719
719
|
else if(obj.type=='view'){
|
|
720
|
+
//Resolve Tables
|
|
720
721
|
var resolvedTables = {};
|
|
721
722
|
if(obj.tables) for(let tblKey in obj.tables){
|
|
722
723
|
let tbl = obj.tables[tblKey];
|
|
723
724
|
var isAlias = !!tbl.table;
|
|
724
725
|
let resolvedTable = isAlias ? tbl.table : tblKey;
|
|
725
|
-
if(
|
|
726
|
+
if(obj.with && (tblKey in obj.with)){ /* Do nothing */ }
|
|
727
|
+
else if(module.schema && ((resolvedTable.indexOf('.')<0)) && !tbl.sql){
|
|
726
728
|
resolvedTable = module.schema + '.' + resolvedTable;
|
|
727
729
|
}
|
|
728
730
|
if(isAlias){
|
|
@@ -734,6 +736,15 @@ exports.ParseSQLObjects = function(){
|
|
|
734
736
|
}
|
|
735
737
|
}
|
|
736
738
|
obj.tables = resolvedTables;
|
|
739
|
+
|
|
740
|
+
//Resolve Dependencies
|
|
741
|
+
if(obj.dependencies) for(var i=0;i<obj.dependencies.length;i++){
|
|
742
|
+
let depName = obj.dependencies[i];
|
|
743
|
+
if(module.schema && ((depName.indexOf('.')<0))){
|
|
744
|
+
obj.dependencies[i] = module.schema + '.' + depName;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
737
748
|
obj._tables = {};
|
|
738
749
|
for(let tblname in obj.tables){
|
|
739
750
|
let tbl = obj.tables[tblname];
|