All works in Postgres!

pull/14/head
Sander Vocke 5 years ago
parent 318bd677f0
commit d28d94c7c8
  1. 10
      server/endpoints/QueryEndpointHandler.ts
  2. 2
      server/test/test.sh

@ -177,9 +177,13 @@ function constructQuery(knex: Knex, queryFor: ObjectType, queryElem: api.QueryEl
joinObjects.delete(queryFor); // We are already querying this object in the base query.
// Figure out what data we want to select from the results.
var columns: any[] = [];
joinObjects.forEach((obj: ObjectType) => columns.push(...objectColumns[obj]));
columns.push(...objectColumns[queryFor]);
var columns: any[] = objectColumns[queryFor];
// TODO: there was a line here to add columns for the joined objects.
// Could not get it to work with Postgres, which wants aggregate functions
// to specify exactly how duplicates should be aggregated.
// Not sure whether we need these columns in the first place.
// joinObjects.forEach((obj: ObjectType) => columns.push(...objectColumns[obj]));
// First, we create a base query for the type of object we need to yield.
var q = knex.select(columns)

@ -3,8 +3,6 @@
# Wrapper around the Jasmine test scripts.
# Can test with different types of databases.
set -x
SCRIPT=`realpath $0`
SCRIPTPATH=`dirname $SCRIPT`
SOURCEPATH="$SCRIPTPATH/.."

Loading…
Cancel
Save