Skip to content

Disambiguates find query after patch - #199

Merged
daffl merged 1 commit into
feathersjs:masterfrom
coreysan:adds-table-alias-to-patch-method
Apr 16, 2019
Merged

daffl merged 1 commit into
feathersjs:masterfrom
coreysan:adds-table-alias-to-patch-method

Conversation

@coreysan

Copy link
Copy Markdown
Contributor

Tell us about the problem your pull request is solving.

When modifying the params.knex query with a join that introduces an ambiguous primary key, PATCH requests will fail with an ambiguous column error:

BadRequest: 
  select `animals`.* 
  from `animals` 
    left join `animals` as `ancestors` on `ancestors`.`id` = `animals`.`ancestor_id` 
  where `id` in (2) - SQLITE_ERROR: ambiguous column name: id

To fix, the table is specified in the Patch request (see code in MR)

Are there any open issues that are related to this?

Not really. There's this: #164
But it's stale and only related in that it concerns the same service method.

Is this PR dependent on PRs in other repos?

No

@coreysan
coreysan force-pushed the adds-table-alias-to-patch-method branch from 43f761c to ca9aa67 Compare April 16, 2019 19:09
@daffl
daffl merged commit e05e093 into feathersjs:master Apr 16, 2019
@daffl

daffl commented Apr 16, 2019

Copy link
Copy Markdown
Member

Released as v5.0.7 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants