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

Detangle collection fetching features #1963

Closed
Tracked by #1913
AndrewSisley opened this issue Oct 13, 2023 · 1 comment · Fixed by #1984
Closed
Tracked by #1913

Detangle collection fetching features #1963

AndrewSisley opened this issue Oct 13, 2023 · 1 comment · Fixed by #1984
Assignees
Labels
area/collections Related to the collections system area/schema Related to the schema system code quality Related to improving code quality refactor This issue specific to or requires *notable* refactoring of existing codebases and components
Milestone

Comments

@AndrewSisley
Copy link
Contributor

There are several features that make little sense in their current once schema is separated from collection, these need to be sorted out:

  • In commits queries, collection ID can be requested and returned, this is impossible atm, as the DAG only contains global elements. It is currently fetched by using the schema version ID in the DAG, but that does not define which collection. If we end up storing a global collection ID in the DAG (which we may not want to), we could do this, but at the moment those things do not exist.
  • Store.GetCollectionByVersionID fetches a single collection from a schema version ID
    • It should either be removed, or needs to change so that multiple collections are returned, as many collections can share the same schema version
    • This is also used in P2P, a hack to be added in their to use only the first whilst waiting on collection global IDs
    • This is also used in commit queries to get the collection ID
  • Store.GetCollectionBySchemaID has the same problem as Store.GetCollectionByVersionID and is used heavily in P2P as well as being public
@AndrewSisley AndrewSisley added area/schema Related to the schema system area/collections Related to the collections system refactor This issue specific to or requires *notable* refactoring of existing codebases and components code quality Related to improving code quality labels Oct 13, 2023
@AndrewSisley AndrewSisley self-assigned this Oct 13, 2023
@AndrewSisley
Copy link
Contributor Author

Note for me, some work has been done in branch 1963-collection-feat-detangle for tthis

@AndrewSisley AndrewSisley added this to the DefraDB v0.8 milestone Oct 18, 2023
AndrewSisley added a commit that referenced this issue Oct 19, 2023
## Relevant issue(s)

Resolves #1963

## Description

Changes GetCollectionBySchemaFoo function signatures to return many
Collections, instead of single values.

Conceptually these functions were broken and relied on the fact that we
cannot yet link multiple collections to the same schema(version)(s).
This changes their signatures and the code that calls them to reflect
what they should do long term.

The code that calls these functions now hosts the 'broken' code. These
will still need to change once we add global IDs.

The implementation of these functions will change later in
#1964.
shahzadlone pushed a commit to shahzadlone/defradb that referenced this issue Feb 23, 2024
…work#1984)

## Relevant issue(s)

Resolves sourcenetwork#1963

## Description

Changes GetCollectionBySchemaFoo function signatures to return many
Collections, instead of single values.

Conceptually these functions were broken and relied on the fact that we
cannot yet link multiple collections to the same schema(version)(s).
This changes their signatures and the code that calls them to reflect
what they should do long term.

The code that calls these functions now hosts the 'broken' code. These
will still need to change once we add global IDs.

The implementation of these functions will change later in
sourcenetwork#1964.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collections Related to the collections system area/schema Related to the schema system code quality Related to improving code quality refactor This issue specific to or requires *notable* refactoring of existing codebases and components
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant