Comments (3)
Hey. We've been quiet on this project for a while, but we're starting to try to pick up again. Hopefully we can get to this in the next week or two. Can you explain the second point about circular dependencies a little more? We typically define a model in its own file and require them, you should be able to create those dependencies that way. However, we haven't run performance tests on something like that, so I can't guarantee good results.
from fastlegs.
It is a great project, I am sure all users appreciate the effort.
circular depency (in terms of the variables) e.g.
USERS receive many reviews... REVIEWS are made by many USERS
var Reviews = FastLegS.Base.extend({
tableName: 'reviews',
primaryKey: 'id'
_fields: [
{ 'column_name': 'user_id' },
{ 'column_name': 'author_id' },
{ 'column_name': 'id' },
{ 'column_name': 'comment' }
]
});
var Users = FastLegS.Base.extend({
tableName: 'users',
primaryKey: 'id',
_fields: [
{ 'column_name': 'id' },
{ 'column_name': 'first' },
{ 'column_name': 'last' }
]
many: [
{ 'reviews': Reviews, joinOn: 'user_id' },
//**{'users': Users, joinOn: 'user_id'} Reviews may have many authors, however Users would be UNdefined (yes i know i presently wouldn't be able to connect using user_id).
]
});
If i wanted to perform a join on users and reviews; and at the sametime get the author of those reviews it would NOT be possible since (see **)
User.find({ 'id.in': ['1', '2', '3'] }, {
only: ['id', 'first', 'last'],
order: ['-first'],
include: { 'reviews': {
//* There is no way i can include users here again since i cant say
//* include on reviews.author_id = users.id
//** FastLegs always assFK to a PK OR two columns that are not Keys
}
}
}, function(err, results) {
//
});
from fastlegs.
Relationships will have to be defined outside of the models for e.g. http://nodetoolbox.com/packages/jugglingdb OR https://github.com/1602/jugglingdb they are too tightly coupled to the model.
from fastlegs.
Related Issues (20)
- README Update? HOT 1
- in functionality is buggy. HOT 2
- Full Text Search HOT 1
- $or doesn't seem to work HOT 2
- $or doesn't seem to work HOT 2
- Clearing values in database using null, '' or undefined does work HOT 1
- Distinct Clause
- Group By Clause
- Batch size option for bulk inserts HOT 1
- `order` no working HOT 2
- Make node 0.8 compatible HOT 1
- or null operator for WHERE clauses
- Support for auto created/updated timestamp columns
- Not Equal to Null Not Working HOT 4
- Limit/Offset Issue
- TypeError: Object 1 has no method 'forEach' HOT 3
- PostgreSQL Date Issue
- Support for FastLegS? HOT 2
- More complex Logic HOT 1
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 fastlegs.