-
Notifications
You must be signed in to change notification settings - Fork 32
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
Upgrade 0.5.1.0 → 0.9.1.3: Query (Statement
) with generic parameter (formerly using ToParam
)
#353
Comments
Statement
) with generic parameter (formerly using ToParam
)
Statement
) with generic parameter (formerly using ToParam
)Statement
) with generic parameter (formerly using ToParam
)
Statement
) with generic parameter (formerly using ToParam
)Statement
) with generic parameter (formerly using ToParam
)
Hmmm. Looks like GHC is inferring the kind of
|
Or perhaps there is a mistake in the type annotation of your - encode :: EncodeParams Schemas pgty hsty
+ encode :: EncodeParams Schemas '[pgty] hsty Turning on |
It might typecheck if you just removed the type signature for |
@echatav Thank you so much for taking the time to look into this. I tried your suggestions, but unfortunately, I wasn’t able to resolve the error. To make it easier for you and potentially contribute to Squeal with an example of a parametrized query, I created this draft PR with an extension of the existing Does this help you repro and potentially resolve the issue? Thanks 🙇♂️ My dream is that one day a GitHub search for |
P.S. I let GPT-4 loose on this, but Squeal type errors are too powerful for our AI overlords 😜 |
I've kind of been stuck working on Squeal because every time I try I run into GHC/Postgres installation location problems.
Googling hasn't helped me. I hate computers. If you help me figure out how I can get GHC to find LibPQ then I can help with Squeal again. |
@echatav Re: Re: generic
I actually was able to get it working first in my own code (without even needing I’m generally pretty happy about it except for this long |
@gasi Nice job! Yes, I'm on a macbook. I'll send you an email. I've been wanting to get back to Squeal a bit. |
Re: type safety. I guess you mean for
|
Hi Eitan,
I’m currently doing a big migration from Squeal 0.5.1.0 → 0.9.1.3 and I love it overall, especially how
EncodeParams
+DecodeRows
gets rid of so much boilerplate.Problem
I was able to figure out 95% of the work, but I get stuck on turning this query that used to take an arbitrary (generic?) parameter (using
ToParam
), that can convert to a PostgreSQL type, to aStatement
withEncodeParams
+DecodeRow
. I had to revert and hard-code it toPGtext
+Text
which broke some of my queries that needPGtimestampz
+UTCTime
:Statement:
selectContentBy
Usage:
getBy
I tried the following without luck:
as I get this error ❌:
I was thinking it might be something obvious you could spot right away. If not, I’m happy to go back and do the work to create a minimally reproducing example.
I appreciate your help 😄
The text was updated successfully, but these errors were encountered: