Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory connector should enforce referential integrity #2333

Closed
3 tasks
bajtos opened this issue Feb 4, 2019 · 5 comments
Closed
3 tasks

Memory connector should enforce referential integrity #2333

bajtos opened this issue Feb 4, 2019 · 5 comments
Labels
feature Relations Model relations (has many, etc.) stale

Comments

@bajtos
Copy link
Member

bajtos commented Feb 4, 2019

The memory connector should enforce foreign key and uniqueness constraints for HasMany, HasOne and BelongsTo relations.

For example, when creating an order using /post/{userId}/orders for a userId which is not that of a user, I would've expected some sort of a check that would've ensure that the userId exists. The connector should throw an error for an userId not in the database.

See #1718 for background and #2332 for the SQL story.

See https://github.com/strongloop/loopback-connector-rest/issues/134 for a Connector helper to parse different styles of index/fk definitions into a format that's easy to consume by connectors.

Acceptance criteria

Out of scope

  • "Plain" indexes without uniqueness check
  • onUpdate and onDelete options for foreign keys
@bajtos bajtos added feature Relations Model relations (has many, etc.) labels Feb 4, 2019
@bajtos
Copy link
Member Author

bajtos commented Feb 11, 2019

The pull request loopbackio/loopback-datasource-juggler#1672 contains an early version of UNIQUE index support for our memory connector.

@jannyHou
Copy link
Contributor

@strongloop/loopback-next Let's add the acceptance criteria for this story.

@bajtos
Copy link
Member Author

bajtos commented Mar 29, 2019

I think we need to work on #2606 first and the implement any follow-up stories.

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Dec 25, 2020
@stale
Copy link

stale bot commented Jul 14, 2021

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Relations Model relations (has many, etc.) stale
Projects
None yet
Development

No branches or pull requests

3 participants