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

Copying and maintaining of referenced records into referencing Repositories #22

Open
artem-v-shamsutdinov opened this issue Jan 6, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@artem-v-shamsutdinov
Copy link
Member

artem-v-shamsutdinov commented Jan 6, 2023

Records that are pointed to by @ ManyToOne() relations but are in different repositories should be:

  1. Recorded in the Repository Transaction History (keeping original Actor and Actor Record Ids, changing the Repository Id)
  2. Created when the Repository is loaded
  3. Updated (with different Repository Id) the referenced repository is loaded. Also the values need to be checked (by scanning for changes in the Repository transaction history) and updated where needed.
  4. @ ManyToOne() references to these records should be updated.

This solves a number of issues:

  1. It is possible that the referenced Repository is not accessible to some of the users of the referencing repository. In this case the queries that use @ ManyToOne() relations should still return full results. This is true especially if the query results are constrained by the records pointed to by the @ ManyToOne() relations.
  2. Even if the referenced Repository is accessible the query results may not return full data (or any data) until the referenced Repository is loaded, thus causing lag.

NOTE: This will impact native Foreign Keys in the SqlJs table (currently they are not generated so not an issue).

@artem-v-shamsutdinov artem-v-shamsutdinov added the enhancement New feature or request label Jan 6, 2023
@artem-v-shamsutdinov artem-v-shamsutdinov added this to the v1.1 milestone Jan 6, 2023
@artem-v-shamsutdinov artem-v-shamsutdinov self-assigned this Jan 6, 2023
@artem-v-shamsutdinov artem-v-shamsutdinov moved this to 📋 Backlog in Beyond Decentralized Jan 6, 2023
@artem-v-shamsutdinov artem-v-shamsutdinov changed the title Copying and maintenance of referenced records across Repositories Copying and maintaining of referenced records into referencing Repositories Jan 6, 2023
@artem-v-shamsutdinov artem-v-shamsutdinov removed this from the v1.1 milestone Jan 9, 2023
@artem-v-shamsutdinov
Copy link
Member Author

The decision is to create "real" objects in the database while maintaining copies in serialized Transaction logs. Subsequently, when the repository of the copied object is loaded that object is instead Updated (and not Created) because it is already present in the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant