-
Notifications
You must be signed in to change notification settings - Fork 107
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
Destroy all GADTs; Removes the From GADT and SqlExpr GADT #228
Destroy all GADTs; Removes the From GADT and SqlExpr GADT #228
Conversation
…g the need for the intermediate structure. Extract the parts of the Experimental module into submodules.
yeah this rules! GADTs are neat but simple type classes are even better 👍 |
This is a breaking change to the internals of experimental, so I'm cool with calling it 3.4.1.0. 3.5.0.0 would be reasonable too. |
…e changelog and bump version
This PR is relevant to #231. I went ahead and put it into what i think is a mergeable state. The checks failed even installing ghc into the action. @parsonsmatt any idea why? |
fixed the CI stuff in #233 , merge that in and try again? |
…hild context). Removed need for composite key constructor
… case since it is generalized to all
… independent datatype
… the db but you shouldnt be using rand anyway. distinctOnOrderBy seems dangerous though
Paging @parsonsmatt I don't want to merge this in without your consent. |
…ation in select clause before adding AS <alias>
… though that info isnt currently used anywhere
Can you do a quick self-review? It's hard to tell what the functional changes are vs the "moving code around" changes are. |
Convert SqlExpr to a final encoding
This now includes the changes to SqlExpr |
hell yeah buddy |
…. Modify Experimental to only use FromRaw.
-- the FromRaw FromClause constructor directly when converting | ||
-- from a @From@ to a @SqlQuery@ using @from@ | ||
-- | ||
-- /Since: 3.5.0.0/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the syntax for this annotation is:
-- /Since: 3.5.0.0/ | |
-- @since 3.5.0.0 |
going to get my work for 2.12 in then i want to merge the 2.12 support in, then try it on the mercury codebase should be sweet |
@parsonsmatt Got your 2.13 changes merged in, mind testing on mercurys code base |
bles't thx |
Just tested on the Mercury codebase. No errors or warnings or anything. Nice. @hdgarrood @arthurxavierx would one of y'all be willing to test this on the Lumi codebase? @eborden any chance y'all could try this out at Freckle? |
IIRC we are matching on SqlExpr constructors in a few places (I know, I know) so I not sure how long it will take me to get around to trying this out, but I'll try to fit it in at some point. |
@parsonsmatt I'll pass this along. |
@parsonsmatt @belevy this PR compiles fine on Lumi's code. There were warnings on Has something changed for the outputted SQL because I ran into a runtime error with a query. I logged the SQL with esqueleto 3.4.2.1 and then also logged the SQL with this PR. Here is the problem error and problem diff: - "q3"."v11_id", -- esqueleto 3.4.2.1
+ "q3"."id" AS "v17_id", -- esqueleto 3.5.0.0 (this PR) |
@codedmart Are you able to post the query code? To answer your question, the query generation code has been shuffled around pretty hard and there is very possibly a bug with subqueries. |
@codedmart The only thing i could figure was different was the realiasing of already referenced things, in the old code this was handled as a passthrough. I have updated to match that, would you be able to retest? |
@codedmart and I were able to work out the issue. @parsonsmatt do we wait on Freckle? |
@parsonsmatt Change is merged in but it appears to be obviated by the change in representation of composite keys. Also fixed an issue in the SQLite tests where it was accidentally set to focus on the sqlite specific cases only. I'm cool with making 3.5 "A New Hope" and adding the deprecation warnings for the old syntax. |
Man I gotta have the |
thanks @belevy for your patience! let's get this going 😎 |
Remove
From
GADT. RenamedToFrom
toFrom
andToFromT
toFromT
.There are a couple of orphan instances caused by this. It might make sense to move subqueries into the same module as the class. That orphan is basically the only one that can't be eliminated. The orphans caused by the different joins can be rectified.
@parsonsmatt Do you have feelings on this change. Better, worse, or the same?
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: