Comments (2)
RelationProxy, being an unfinished API is not exactly what I had planned initially.
The current idea is to not change the state in the RelationProxy itself but instead make a copy and modify the state in that. That'll allow you to reuse the same initial instance of multiple times and just build queries on top of that like such:
auto rp = RelationProxy!User;
auto allRows = rp.all;
auto filteredRows = rp.where("row = 1").all;
// and so on
This eliminates all need to reset the state/queries.
The current solution is to use the RelationMixin inside User since each of its methods spawns another instance of RelationProxy.
from dpq.
That clarifies a bit.
But this approach renders caching unusable since in the case of copying the initial RelationProxy it will always be marked as 'stale'. Or rather difficult to make a RelationProxy to track if the new chain can use cached data from the previous one. Besides, user can easily make his/her own cache like this:
auto rp = RelationProxy!User;
auto cachedUsers = rp.all;
Should the caching be maintained somehow or be just removed from the RelationProxy?
from dpq.
Related Issues (20)
- DPQ doesn't throw when you try connecting to port 0
- Add support for serializing BigInt to NUMERIC HOT 5
- Support for JSON Fields HOT 6
- Turn off camelCase to underscore_pg HOT 3
- Explicit connection or ProxyMixin. HOT 1
- Deprecation with dmd 2.078
- code.dlang not updated HOT 2
- Conversion issue
- Deprecation on test HOT 1
- Deprecation with dmd 2.096 HOT 3
- DateTime deserialization is not correct HOT 1
- Deprecations
- Noisy Writes to Stdout HOT 1
- _dpqLastConnection is not visible from module HOT 2
- IsValidRelation returns false for a relation declared without explicit name
- Result iteration issues HOT 2
- RelationProxy on structs containing Nullable!SysTime causes compilation error.
- Use on windows HOT 1
- deprecation with dmd 100
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 dpq.