Commit 08700bfc authored by Rafael Dias's avatar Rafael Dias

Issue #112: Update SELECT

Signed-off-by: Rafael Dias's avatarrafaelcosc <rpd17@inf.ufpr.br>
parent ac597977
Pipeline #21484 failed with stages
in 44 seconds
......@@ -121,7 +121,28 @@ export abstract class SQLAdapter extends Adapter {
sort = " ORDER BY " + order;
}
return withClause + "SELECT * FROM " + view.name + sort + ";";
let dim = "";
if(view.dimensions.length > 0){
dim = view.dimensions.map((item) => {
return "\"" + item.name + "\"";
}).join(",");
}
let met = "";
if(view.metrics.length > 0){
met = view.metrics.map((item) => {
return "\"" + item.name + "\"";
}).join(",");
}
let attribute = "";
if(met.length > 0){
attribute = dim + "," + met;
}else{
attribute = dim;
}
return withClause + "SELECT " + attribute + " FROM " + view.name + sort + ";";
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment