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
Failed withRelated three tables #82
Comments
It looks like it's not retrieving anything from the "client" fetch - Could you give me an shortened example schema (table keys / values) in the db so I can take a look at reproducing? |
I was writing a better example and you're right. The But my real problem it's that Bookshelf doesn't support composited keys. Something like: var Table1 = db.Model.extend({
tableName: 'table1',
idAttribute: ['key1', 'key2']
});
var Table2 = db.Model.extend({
tableName: 'table2',
test: function() {
return this.belongsTo(Table1, ['key1_id', 'key2_id']);
}
}); Thanks for your help. |
Yeah, I'd like to be able to support composite keys at some point, let me know if you have any ideas on how these could be easily added. |
Moving to #86. |
I don't know why Bookshelf is fetching only the first relation.
But Bookshelf only makes two queries. The client.compta it's never fetched.
{ sql: 'select "fitxes".* from "fitxes" limit 1', bindings: [], __cid: '__cid2' } { sql: 'select "fitxes_clients".* from "fitxes_clients" where "id_fitxa" in (?)', bindings: [ undefined ], __cid: '__cid3' }
And yes, idAttribute on table client really sucks.
The text was updated successfully, but these errors were encountered: