Skip to content
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

JSONField queries with complex JSON parameters don't work #58

Open
timgraham opened this issue Apr 8, 2023 · 0 comments
Open

JSONField queries with complex JSON parameters don't work #58

timgraham opened this issue Apr 8, 2023 · 0 comments

Comments

@timgraham
Copy link
Collaborator

Due to snowflake-connector-python's lack of VARIANT support (I think it's difficult if not impossible to fix this otherwise), some JSONField queries with complex JSON parameters don't work.

For example, if value is a JSONField, this won't work:

>>> JSONModel.objects.filter(value__k={"l": "m"})

A workaround is:

>>> from django.db.models.expressions import RawSQL
>>> JSONModel.objects.filter(value__k=RawSQL("PARSE_JSON(%s)", ('{"l": "m"}',)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant