It is possible to add the postgres ONLY keyword to a query? (Question)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.3k
- Forks
- 637
- PR merge metrics
- No merged PRs in 30d
Description
Is there a way to add the ONLY keyword to a postgres query? I'm able to do it without a Model and using knex with .from(knex.raw(ONLY parent)) directly but I was wondering if it were possible to modify a query to add ONLY. For example, I'm trying to perform a query involving inherited tables like so.
SELECT * FROM ONLY parent NATURAL FULL JOIN child;
with .joinRaw, I can add the NATURAL FULL JOIN.
I tried messing around with modifiers but couldn't seem to get it to work.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the query-builder and modifier APIs, along with the raw and joinRaw usage described in the issue. First reproduce the PostgreSQL inherited-table query with a minimal Objection.js/Knex query; done means determining whether ONLY is supported through the API or documenting the limitation and workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, postgresql
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100