-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Data access simplifications (part 1: apps driver) #2219
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
Draft
KernelDeimos
wants to merge
15
commits into
main
Choose a base branch
from
eric/25CN0-entity-refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,469
−15
Conversation
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
6167b41 to
bb96940
Compare
Adds `as_bool` utility function for boolean values from MySQL and Sqlite, based on the previous implementatoin for ES/OM.
It turns out self-referencing tables add some nuances to what is and what isn't ambiguous in SQL queries, so getting this right took a little longer than expected. Following the entire chain doesn't seem to be possible so a compromise is made by only traversing one level of depth. (you can the uid of the owner of the app, but not the uid of the owner app's own owner)
Adds the `icon_size` parameter to the `.select()` method on the new non-ES/OM implementation. When adding the necessary `params` parameter to the `.select()` method, it was noticed that the `predicate` parameter did not have a default value - potentially causing a regression; a default value was set for both `params` and `predicate`.
Most of this implementation matched `.select()` which saved time. The
common behavior can be factored out, but since the purpose of this
refactor is to flatten everything as much as possible I'm going to leave
the duplicated code and make a note to do this later.
The challenging part was `#build_complex_id_where()`, which is the
equivalent to the `fetch_based_on_complex_id_()` method in
EntityStoreService. This allows `uid: app-UUID-OF-APP` and `id: { name:
'editor' }` to both work.
Fixes are also included for a couple issues that were found: - `null` being included in extensions list - property called `user_owner` instead of `owner`
DRY some redundant code and use guard clauses where applicable.
Primarily these tests were AI generated an then checked over for sanity. These tests are good unit tests to avoid regressions as a result of changes to this code but are not sufficient to test for regressions introduced by this new implementation that will replace `es:app`.
This is a naive implementation of the `.upsert()` method that simply calls `.create()` or `.update()` depending on whether or not the app already exists.
bb96940 to
5bba01b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Scope
This PR covers implementing the
appsdriver, which will replace thees:appsdriver.es:subdomainsandes:notificationswill separately be moved away from the EntityStorage system.es:apps.Process/Convention Notes
main.Method Implementations
apps.select()apps.read()apps.create()apps.update()apps.upsert()apps.delete()Regression Discovery
.select()to testes:app->app.read()to testes:app->app.create()to testes:app->app.update()to testes:app->app.upsert()to testes:app->app.delete()to testes:app->appRegression Fixes
this list will be populated later
Other Tasks