-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
json query with boolean argument fails #7005
Comments
@andersryanc |
I could certainly try that... but... The thing that doesn't make sense to me is that the SQL expression itself works fine using a boolean. As you can see in my description above, the SQL that is output is identical in both cases. You can also run the SQL directly through a SQL prompt or GUI application and get the expected results. What doesn't make sense is why the GORM You can see that in both cases, the SQL output is the same, while one says |
I am not very familiar with this. But I think |
GORM Playground Link
go-gorm/playground#729
Description
When querying a property inside a json field with a bool argument, the query returns 0 rows. However, if you embed the bool into the where clause itself, you get 1 row. The strange thing is that the generated SQL shown by the debugger is identical.
Broken Example:
Working Example:
I tried testing a variety of other variations as well, like using
json_extract
and the double arrow syntax, likeconfig->>'$.enabled'
. The same thing also happens with nested values, such asconfig->'$.foo.enabled' = true
.The text was updated successfully, but these errors were encountered: