-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add examples #18
Comments
@oliverbrooks this might help with use cases for #13 |
One example of a conditional join hack {?disablefishFilter, "LEFT JOIN", "INNER JOIN"}
"fish" ON
(
{?disablefishFilter} = false
AND
"fish"."foodId" = "food"."id"
) This will inner join and filter if This is useful if you need to do a join to filter down results but you don't want the weight of the join all the time. |
@oliverbrooks so I thought I'd have a go at getting a pattern working for the above. So I think you're trying to always join to a table and then switch to only return rows which join to that table. I believe the below does this, also it's ANSI SQL (at least I think) and can be prepared and hence optimised ahead of time
|
Our only examples currently live in ./test and README.md we should put some more complete examples into an
./examples
directoryThese would show our current use cases, especially with regard to
I suggest we also make a sqlite database in order to properly show these in operation via knex.
The text was updated successfully, but these errors were encountered: