Vincit / Vincit/objection.js

Feature request: setRelated modifies associated id column

Open
#2,001 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
7.3k
Forks
637
PR merge metrics
No merged PRs in 30d

Description

Currently, $setRelated will place the given object on a model, equivalent to post.author = user. It would be nice if $setRelated would set the appropriate xId column as well (if defined in the relationMappings), equivalent to post.author = user; post.authorId = user.id.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the $setRelated entry point and the relationMappings handling for associated id columns. Trace how assigning the related object currently works, then verify that a defined xId column is updated consistently with the related object's id and add or run tests covering this behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend, databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.