This repository was archived by the owner on Dec 9, 2024. It is now read-only.
Add support for defining indexes on models#13
Open
soderluk wants to merge 6 commits into
Open
Conversation
|
Hey @soderluk ! 🙂 I think one way to tackle this a bit more cleanly would be to create classes for the different types of index, so What do you think? |
|
So something like indexes = [
HashIndex(fields=["_from", "_to", "type"], unique=True)
] |
Author
|
@lietu Good idea! Will look into it :) |
Author
|
@lietu Made some updates to the PR. Please have a look, when you have the time. |
lietu
reviewed
May 9, 2022
|
Overall I'd say I like it, with some luck @joakimnordling has the time to take a look at some point as well 👍 |
joakimnordling
suggested changes
May 11, 2022
Support ensuring indexes on collections. The `Model.ensure_indexes()` function supports any indexing function that ArangoDB Collection supports.
Instead of using magic methods, set up index classes to handle all the different indexing cases.
Mypy doesn't really understand what is returned from the add_*_index function.
soderluk
force-pushed
the
ensure_indexes
branch
from
November 6, 2022 11:34
1e55b26 to
5f8cd69
Compare
Fix the tests for ensuring indexes. Make BaseIndex abstract base class, and make the add_index function as abstract as well. Move fields away from the BaseIndex to their respective sub-classes.
Author
|
@joakimnordling Updated the tests and fixed a few things according to code review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support ensuring indexes on collections. The
Model.ensure_indexes()function supports any indexing function that ArangoDB Collection
supports.