Skip to content
Snippets Groups Projects
Commit 07104416 authored by Rafael Dias's avatar Rafael Dias
Browse files

Issue #112: Fix SELECT all


Signed-off-by: default avatarrafaelcosc <rpd17@inf.ufpr.br>
parent ac597977
No related branches found
No related tags found
1 merge request!92Issue #112: Fix SELECT all
Pipeline #21499 passed
......@@ -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 + ";";
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment