by inshadows · 4y ago · 0 comments
posts = await client.post.find_many(
where={
'OR': [
{'title': {'contains': 'prisma'}},
{'content': {'contains': 'prisma'}},
]
}
)
SQL for comparison: ... where title like '%prisma%' or content like '%prisma%'You neglected to write the SELECT, which would typically not be as simple as "SELECT * from post".
You neglected to write the code to iterate over the results, which is trivial in the ORM version. In the SQL version it requires cursors and the error-prone manual mapping of positional data to named data.
Thank you :)
Has a clear link to the python "any" as well
https://github.com/RobertCraigie/prisma-client-py/issues/293