At my company we really wanted to use VALUES Postgres expression to use it inside of JOIN
between large db data-set with some smaller user-input data-set without loading of data into app-memory.
VALUES allows us to do that and even gives performance benefit to our app.
At my company we really wanted to use
VALUES
Postgres expression to use it inside ofJOIN
between large db data-set with some smaller user-input data-set without loading of data into app-memory.VALUES
allows us to do that and even gives performance benefit to our app.I think it is a relevant issue https://github.com/bitemyapp/esqueleto/issues/231 :)
This PR tries to bring an ability to use like:
SQL :
SELECT * FROM (VALUES (a1), (a2) ...) as "vs"("v1")
Haskell:select $ from $ values [val 1, val 2, val 3]
It also works for more than one columns as well (a bit doubting about aliases/refs assembling but works good so far). :)
I implemented it as part of
From
and thanks to latest refactoring from GADTs to type-classes it was not so difficult :)Few appropriate semi-integrational tests with other sql capabilities as join, sinigle/multicolumn were added as well.
Please, let me know if I made something in a wrong way - I am ready to try to fix :)
Thanks!
Before submitting your PR, check that you've:
@since
declarations to the Haddock.stylish-haskell
and otherwise adhered to the style guide.After submitting your PR: