Closed mathiasrw closed 8 years ago
Yes, I think that would be in scope for this project! I'll look into implementing that.
Hi @mathiasrw take a look in test/join.js and tell me what you think of that syntax!
books .join('authorId') .to('authors') .where('name') .equals('James Joyce')
I would always think join XXX with YYY
(and not to
) - but im not native english, so its just an input for you.
When you join tables you must state what fields the two tables should join on. It looks like the example is trying to "join" on a specific value. It must be that value in table a is equal to value in table b
I suggest a syntax where like this:
books
.join(author, 'id')
.on('authorId')
For multiply layers of join I suggest something along with:
books
.join(author, 'id')
.on('authorId')
.join(sales, 'authorId')
.on('author, 'id'')
I'll try that, thanks for the input!
Interesting.
Is it ment to support join on tables at some point?