From 1a624342ff4f0ef7f4ecb5dde02c8b0c82b53d75 Mon Sep 17 00:00:00 2001 From: Patrice Bender Date: Fri, 13 Sep 2024 09:04:58 +0200 Subject: [PATCH] align error message --- db-service/lib/infer/join-tree.js | 2 +- db-service/test/cqn4sql/keyless.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db-service/lib/infer/join-tree.js b/db-service/lib/infer/join-tree.js index 334dff2c7..c4c0cd0a0 100644 --- a/db-service/lib/infer/join-tree.js +++ b/db-service/lib/infer/join-tree.js @@ -189,7 +189,7 @@ class JoinTree { // sanity check: error out if we can't produce a join if ($refLink.definition.keys && $refLink.definition.keys.length === 0) { const path = prettyPrintRef(col.ref) - throw new Error(`Path step “${$refLink.alias}” of “${path}” has no valid foreign keys`) + throw new Error(`Path step “${$refLink.alias}” of “${path}” has no foreign keys`) } if (next) { diff --git a/db-service/test/cqn4sql/keyless.test.js b/db-service/test/cqn4sql/keyless.test.js index 3484bfb2d..258c4d632 100644 --- a/db-service/test/cqn4sql/keyless.test.js +++ b/db-service/test/cqn4sql/keyless.test.js @@ -17,7 +17,7 @@ describe('keyless entities', () => { const { Books } = model.entities const q = SELECT.from(Books).where(`author[ID = 42].book[ID = 42].author.name LIKE 'King'`) expect(() => cqn4sql(q, model)).to.throw( - 'Path step “author” of “author[…].book[…].author.name” has no valid foreign keys', + 'Path step “author” of “author[…].book[…].author.name” has no foreign keys', ) // ok if explicit foreign key is used const qOk = SELECT.columns('ID').from(Books).where(`authorWithExplicitForeignKey[ID = 42].name LIKE 'King'`)