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

Connector helpers to obtain INDEX and FOREIGN KEY configurations from model definitions #143

Open
7 tasks
bajtos opened this issue Apr 18, 2019 · 1 comment

Comments

@bajtos
Copy link
Member

bajtos commented Apr 18, 2019

This is a follow-up task for the proposal outlined in loopbackio/loopback-next#2712.

Implement a helper functions in base Connector class to process index and foreign-key definitions in an unified way and convert them into data suitable for consumption by connector implementations. The helpers should gather both model-level and property-level definitions, apply database/connector-specific options, merge keys/properties fields in index definitions, etc. and produce a final definition that can be directly mapped to database commands.

See _SPIKE_.md in loopbackio/loopback-next#2712 for the full description of index/PK definition syntax.

This is a prerequisite for implementation of indexes & foreign keys in other connectors, most notably memory connector (loopbackio/loopback-next#2333) and SqlConnector (https://github.com/strongloop/loopback-connector-rest/issues/135)

Acceptance criteria

  • Implement a helper to process INDEX definitions, include tests and API docs
  • Implement a helper to process FOREIGN KEY definitions, include tests and API docs
  • Deprecate ModelDefinition.prototype.indexes() API in favor of this new Connector method.
  • Create follow-up tasks to leverage the new helper in our NoSQL connectors and thus let the connectors understand the new FK/INDEX definition syntax. One GH issue per connector please.
    • MongoDB
    • CouchDB
    • Cloudant
    • Cassandra
@stale
Copy link

stale bot commented Nov 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 9, 2019
@bajtos bajtos added the major label Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants