Replies: 1 comment
-
Most of this proposal has been captured in the upcoming database refactor. We've deprecated https://gist.github.com/kodumbeats/d0f8d8305b28f1b3f3d52f0ada358551 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone.
I would like to propose new functions for collections on appwrite server side (node-appwrite).
Recap of current update behaviour
This is updateCollection function with all parameters except
list
And for example
Currently, to update a collection that already has rules in place would require a user to insert currently existing rules along with new ones, like shown in the example, because function completelly rewrites a collection based on parameters.
Use case
With current behaviour user needs to constantly repeat rules he wants to keep in the collection when updating it in any way.
This makes user write a lot of repetitive code when writing database migrations for collection(s) or just updating collection in general.
In case of larger collections, writing such migrations would require extra comments in order for others to know what has happened. Without comments it would take much longer to determine what has changed in latest migration in comparison to previous one, especially with large applications.
Proposal
To avoid repetitive code I propose functions:
This would mean that it would only affect collection rules while keeping all other collection parameters the same.
Also, this might require for rules to have unique ID or at least unique
key
as currently we can have multiple indentical rules in our collection(s) for update/delete to target proper rule.Other areas of implementation
Such behaviour could also be considered for other collection parameters as well.
Appwrite currently has such functions for documents:
Beta Was this translation helpful? Give feedback.
All reactions