You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The query returns 0 records, whereas I'm expecting more than 1 record from the DB.
'
This is an extract from the Prisma-generated SQL query from the log (string quotes removed for formatting to work):
SELECT mydomain.listingItem.id, mydomain.listingItem.userId, mydomain.listingItem.createdAt, mydomain.listingItem.updatedAt, mydomain.listingItem.itemData FROM mydomain.listingItem WHERE (JSON_UNQUOTE(JSON_EXTRACT(mydomain.listingItem.itemData, ?)) LIKE ? AND (JSON_TYPE(JSON_EXTRACT(mydomain.listingItem.itemData, ?)) = ?))
Bug description
I am attempting to query on the content of a JSON field.
My JSON looks like this:
My prisma query is this:
The query returns 0 records, whereas I'm expecting more than 1 record from the DB.
'
This is an extract from the Prisma-generated SQL query from the log (string quotes removed for formatting to work):
SELECT mydomain.listingItem.id, mydomain.listingItem.userId, mydomain.listingItem.createdAt, mydomain.listingItem.updatedAt, mydomain.listingItem.itemData FROM mydomain.listingItem WHERE (JSON_UNQUOTE(JSON_EXTRACT(mydomain.listingItem.itemData, ?)) LIKE ? AND (JSON_TYPE(JSON_EXTRACT(mydomain.listingItem.itemData, ?)) = ?))
and the log parameters
Params: ["$.instrument.description","%organ%","$.instrument.description","STRING"]
There appears to be no information about the instrument.description path of the
JSON_EXTRACT
function in the SQL query.Playing with the query:
returns 0 records
How to reproduce
I'm using Postman to send the query to the API.
Expected behavior
There is at least 1 record in my DB with the word organ contained in the JSON path instrument.description.
No records are being returned.
I expect matching records to be returned.
Prisma information
My prisma schema looks like this:
Environment & setup
Windows 10 Pro
Version 10.0.19045 Build 19045
MySQL
node -v
v20.10.0
next: "^14.1.4",
Prisma Version
The text was updated successfully, but these errors were encountered: