Query Builder issue, not returning results

Hi guys,

We’ve moved to higher versions of Postgres, and I’m seeing what used to work at 9.5, isn’t at 10.

Running 2020.09 and the following used to give me a count with Query Builder…

	var n = databaseManager.createSelect('db:/stsservoy/sheets');
	n.where.add(n.columns.sheet_number.eq(record.sheet_number));
	n.where.add(n.columns.tenant_uuid.eq(globals.makeUUID(globals.session.tenant_uuid)));
	n.where.add(n.columns.job_id.eq(globals.makeUUID(scopes.jobs.importJob.jobId)));
	/** @type {QBJoin<db:/stsservoy/piecemarks>} */
	var t = n.joins.add('db:/stsservoy/piecemarks');
	t.on.add(t.columns.sheet_id.eq(n.columns.sheet_id));
	n.root.where.add(t.columns.piecemark.eq(record.piecemark));
	n.root.where.add(t.columns.parent_piecemark.eq(record.parent_piecemark));
	var T = databaseManager.getFoundSet(n);

I’m checking the forums, but nothing new yet.

Just trying to get a count of existing records, of which this is but a part, but the join doesn’t work.

Checking here to see if anyone actually uses query builder and where there might be a better resource as to debugging.

I should get a joined record, but result is only the sheets record.

Thanks,
–Joe.

Joe,

Do you see the actual sql that is executed?
You can see it from the admin page.

Also, check the startup logging, does it say anything about a dialect?
Maybe the database is not recognized as Postgres.

Rob

Hi Rob,

Thanks for the quick reply.

On some selected records, I get the correct joins. On others, it doesn’t.

I’ll post more when I analyze it.

This is an imported file from a customer through PgAdmin v4.5.

I’m not sure where the diags go when in Servoy Developer.

Thanks,
–Joe.