Commit 07104416 authored by Rafael Dias's avatar Rafael Dias

Issue #112: Fix SELECT all

Signed-off-by: Rafael Dias's avatarrafaelcosc <rpd17@inf.ufpr.br>
parent ac597977
Pipeline #21499 passed with stages
in 1 minute and 25 seconds
......@@ -121,7 +121,30 @@ export abstract class SQLAdapter extends Adapter {
sort = " ORDER BY " + order;
}
return withClause + "SELECT * FROM " + view.name + sort + ";";
const dimensions = view.dimensions.map((item) => {
return "\"" + item.name + "\"";
}).join(",");
const metrics = view.metrics.map((item) => {
return "\"" + item.name + "\"";
}).join(",");
let attributes = "";
if (dimensions.length > 0) {
if (metrics.length > 0) {
attributes = dimensions + "," + metrics;
}
else {
attributes = dimensions;
}
}
else {
attributes = metrics;
}
return withClause + "SELECT " + attributes + " 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