-
Notifications
You must be signed in to change notification settings - Fork 22
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
Parameter binding change seems to have moved from nchar to ntext #39
Comments
I also encountered this #34 (comment). We're still using the approach described in the comment of casting to |
Thanks chaps. I don't have time right now to look at this in detail, but I understand that explicit binding vs the more implicit text rendering causes comparison issues. |
@spencerjanssen Do you have the commit for your patch? I'm curious what approach you took. |
Sorry, the workaround isn't in any public repository. In our codebase we use a class ToQuery a where
toQuery :: a -> Query
default toQuery :: ToSql a => a -> Query
toQuery = toSql
-- odbc treats Text as ntext, which has all sorts of problems including equality comparison
-- and use in AT TIME ZONE
instance ToQuery Text where
toQuery x = "cast(" <> toSql x <> " as nvarchar(max))" |
Ah, thanks. That wouldn't cover the parametrized case that we're discussing (https://github.com/hasura/graphql-engine-mono/issues/2913#issuecomment-1010162201), but good to know. 👌 |
I could wrap up the |
Related attempt: #44 |
Not quite sure who/what's wrong here, but thought I'd log this one anyway since others might run into similar issues.
I tried updating hasura/graphql-engine to build against
odbc-0.2.5
(currently it builds against7c0cea45d0b779419eb16177407c4ee9e7ba4c6f
which is between 0.2.3 and 0.2.4), and I see test failures withReading through the recent changes to this package, I believe this is likely to be related to how commit 555182e changes text values to be passed via
withBindParameter
as aTextParam t
, where it was previously encoded directly viarenderValue
.Now it may well be that the tests are just wrong, but if so, it seems like the change in behaviour might be worth mentioning in the changelog?
The text was updated successfully, but these errors were encountered: