Comments (2)
at one point, was implemented but it was a bit confusing and the rules were a bit unclear. so we can take another look at this soon.
note that it'd be nice to have auto-generated async accessors for sub-objects instead of having to build the query ourselves
from aqueduct.
Just to start the convo, something like this:
var categoryTemplate = new Category();
var roomTemplate = new Room()..categories = [categoryTemplate];
var userTemplate = new User()..id = 1..rooms = [roomTemplate];
var users = await adapt.populateModelGraph(userTemplate);
Where users contains all users that have id = 1 (which we know to just be one for this particular value), and its properties will be populated, along with all of its rooms, and all of the rooms will have all of their categories.
Every property set on these objects would become filters (just like predicateObjects). An empty object in a relationship (or list of objects) indicates that you want them fetched.
Now, I really don't like this whole using model objects as templates for generating predicates, but its an OK temporary solution. Where it breaks down is when you need anything other than equality (<, >, like, etc.). What I'd really want is an automatically generated class for each model class. The auto generated class would have the same properties as the model class, except the properties would be a different type. Maybe some sort of PredicateMatcher. Its values could follow the Matcher syntax like in tests:
var userTemplate = new PredicateMatcher<User>();
userTemplate.name = beginsWith("B");
userTemplate.rooms.items = hasLength(10); // rooms is lazily allocated
var query = userTemplate.query;
var modelGraph = await query.fetch(adapter);
from aqueduct.
Related Issues (20)
- How to use ORM without http server HOT 1
- starting from existing db HOT 2
- Getting Socket exception after restarting the aqueduct app HOT 4
- Problems with aqueduct commands after flutter upgrade HOT 12
- How to install aqueduct on macOS? HOT 4
- How to I change aqueduct serve default port? HOT 5
- How can I create a push notification with aqueduct? HOT 2
- Unable to create project. HOT 1
- aqueduct db upgrade gives range error : Invalid value: Not in inclusive range 0..1114111: -1 HOT 2
- I think aqueduct need provide object transfer method like the AutoMapper
- [Feature request !!] any plans to return html templates instead of json ? HOT 1
- Dart 2.12 and new features HOT 1
- Use multiple query condition after join
- Dependency issues, new versions of googleapis are no longer compatible
- null-safety error on commands HOT 3
- Feature-Request: Replace mirrors with reflectable
- Here's how to fix your Heroku app (SSL) HOT 2
- Annotation @ManagedTableAttributes: Is not working. HOT 1
- Is this project no longer maintained
- Do you consider adding such a plug-in, please see the link below!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aqueduct.