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

refactor: Skeleton-API rework #1264

Merged
merged 15 commits into from
Oct 1, 2024

Conversation

phorward
Copy link
Member

@phorward phorward commented Sep 20, 2024

  • Rename Skeleton.toDB() into Skeleton.write()
  • Rename Skeleton.fromDB() into Skeleton.read()
  • Rename any skelValues variable into skel
  • Clean-up Skeleton.delete()
  • Improve Skeleton.read(), Skeleton.write() and Skeleton.delete() to accept key-parameter
  • Deprecation handling
  • Added support for legacy fromDB/toDB definitions in project-specific Skeletons

This pull request is a first, backward-compatible milestone on #630.

@phorward phorward added the refactoring Pull requests that refactor code but do not change its behavior. label Sep 20, 2024
@phorward phorward changed the base branch from main to develop September 20, 2024 14:28
@phorward phorward added the Priority: High After critical issues are fixed, these should be dealt with before any further issues. label Sep 23, 2024
@phorward phorward changed the title feat+refactor: Skeleton-API rework, Skeleton.update() transactional read/write refactor: Skeleton-API rework Sep 23, 2024
The key parameter allows to provide a different key for the given operation.
This might safe one more line of assignment code required before.

Also refactors Skeleton.delete() with its double db.Get()
@phorward phorward marked this pull request as ready for review September 23, 2024 22:35
@phorward phorward added the viur-meeting Issues to discuss in the next ViUR meeting label Sep 23, 2024
This is a "hackish", but working way to stay backward compatible with legacy code and still integrate existing fromDB/toDB-functionality into the new read/write-API.
phorward added a commit to phorward/viur-core that referenced this pull request Sep 24, 2024
Drafting new `Skeleton.update()` function based on `viur.toolkit.db.set_status()`.
This function replaces the existing Skeleton.update() which should provide a dict-like behavior. For this case, the `|`- and `|=`-operators should be used. Because Skelton/SkeletonInstance is not a dict, it should provide correct CRUD functinality.

This pull request is part of viur-framework#630 and a follow-up on viur-framework#1264, which should be merged first.
Copy link
Member

@sveneberth sveneberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming on this public API belongs in my opinion in a major release and not in a minor.

@phorward
Copy link
Member Author

Renaming on this public API belongs in my opinion in a major release and not in a minor.

Yeah, we've discussed this in the viur-meeting already, lgtm! 👍

@phorward phorward removed the viur-meeting Issues to discuss in the next ViUR meeting label Sep 30, 2024
@phorward phorward added this to the ViUR-core v3.7 milestone Sep 30, 2024
@phorward phorward merged commit 51b1507 into viur-framework:develop Oct 1, 2024
3 checks passed
phorward added a commit that referenced this pull request Oct 15, 2024
Provides a `Skeleton.patch()` function based on `viur.toolkit.db.set_status()`.

This improves the Skeleton API to a better and more integrated CRUD-API
(Create-Read-Update-Delete). It also introduces a
ReadFromClientException that can be raised internally for client parsing
error reporting.

This pull request is part of #630 and a follow-up on #1264, which
~should be~ was merged first.

This is also an alternative replacement on #991.

---------

Co-authored-by: agudermann <[email protected]>
Co-authored-by: Sven Eberth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High After critical issues are fixed, these should be dealt with before any further issues. refactoring Pull requests that refactor code but do not change its behavior.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants