Skip to content
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

Added support for joining to virtual tables #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

daniellockyer
Copy link
Member

⚠️ blocked to be merged until MySQL 5 has been dropped in Ghost

refs https://github.com/TryGhost/Team/issues/944

Currently mongo-knex does not allow setting up relations which use an
aggregate function, e.g. filtering based on the SUM of a related column.

I initially looked at adding a new relation type like
oneToOneAggregate but this proved to require large changes to the
codebase, with a big increase in complexity.

The approach here is to allow consumers of the library to have the
ability to define a virtual table as a knex query, which allows for more
complex relations, including aggregates, or joins over multiple tables.

refs TryGhost/Product#944

Currently mongo-knex does not allow setting up relations which use an
aggregate function, e.g. filtering based on the SUM of a related column.

I initially looked at adding a new relation type like
`oneToOneAggregate` but this proved to require large changes to the
codebase, with a big increase in complexity.

The approach here is to allow consumers of the library to have the
ability to define a virtual table as a knex query, which allows for more
complex relations, including aggregates, or joins over multiple tables.
@daniellockyer daniellockyer marked this pull request as ready for review January 14, 2023 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants