-
Notifications
You must be signed in to change notification settings - Fork 17
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
Loading relationships with get()
?
#19
Comments
I agree fully. Problem right now is that Dexie needs to change it's core loop to handle this. I've started a rewrite in typescript at https://github.com/dfahlander/Dexie.js/tree/next-expression-engine/src/dexie-next. This new branch is a rewrite of quite much. It will support chained where clauses in combination with orderBy() and support lazy mapping like what you are requesting. It will also support asynchronous hooks. Many of the features mentioned here will be supported. I would very much appreciate any help with completing this branch later on when it comes to a stage where it is functional and testable. I find myself with too little time this spring to work on it right now. But hope to get it going again later this year (August and forth). Probably too undocumented to jump into right away though. (does not even compile right now) If you find an easier way to accomplish it based on current Dexie master branch, feel free to implement it and PR it. You will then need PRs for both Dexie and dexie-relationships. As long as all the unit tests pass, I'm fine with it. |
Oh, nice (re. rewrite)! Hmm, so this sounds like two action items:
|
Thanks! I'll ping you as I move forward. Just the knowledge of that there are people wanting to help further on is good. Relationships addon is already part of the CI tests of Dexie, as other addons may be too, too verify a new Dexie version never will break first class addons. It may continue as an addon to save the library size though. |
The current use case (AFAICT) for
with()
is to use it where you would call.toArray()
.However, I'd like to use it on
.get()
queries and in places where I don't want to invoke.toArray()
. Implicitly invokingtoArray()
limits query building scenarios.Rail's ActiveRecord handles this by "queueing up" query filters, then having an evaluate method (similar to
toArray()
). Is there a similar way to do this, sowith()
will work withget()
, plus enable some more complex query builders such as the following use cases:Use Case 1: Executing a scalar query
Use Case 2: Composing a collection query
Use Case 3: Composing queries that are "doubly" async
If the answer is "yes" or @dfahlander has some pointers on how to do this, I'm 💯 to write a PR!
The text was updated successfully, but these errors were encountered: