Skip to content

Commit

Permalink
align error message
Browse files Browse the repository at this point in the history
  • Loading branch information
patricebender committed Sep 13, 2024
1 parent 033fc07 commit 1a62434
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion db-service/lib/infer/join-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion db-service/test/cqn4sql/keyless.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'`)
Expand Down

0 comments on commit 1a62434

Please sign in to comment.