do you have experience with the python prisma client?
hay gang,
has anyone used the python client for prisma? what's your take?
https://github.com/RobertCraigie/prisma-client-py
a bit of context: we have a terribly maintained MongoDB at work and I'm searching for a way out, adding prisma would be a big jump in the right direction, any other suggestions are welcome
GitHub
GitHub - RobertCraigie/prisma-client-py: Prisma Client Python is an...
Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of use - GitHub - RobertCraigie/prisma-client-py: Prisma Client Python is an auto-generated and fully...
13 Replies
Im using it for my discord bot written in python.
It doesn't support some things yet, but works for me just fine.
like what...?
and what's the workaround if you run into something that doesn't work... I guess you can always write native queries, but how do you avoid things getting messy?
Personally, I faced the issue with composite-types
They aren't supported yet
I used relationships to resolve this
And it works just fine
GitHub
Prisma Client Python • RobertCraigie
This project is used to track the Prisma Client Python roadmap
hmmm... that's kind of a big one in mongo land
but to be honest, most of our issues are because we are modeling relational data
Yea
so moving away from it would be good
so you basically just created a
$lookup
and then embed it via a query when needed?I created a onetoone relation from guild to guildsettings, and yes, I just include it when needed.
*populate I think is the correct technical term, so basically a join
gotcha
thanks! 🙂
FWIW The tooling for more complex stuff in terms of editor suggestions isn't quite there yet and I had like a weird thing going on with nested queries:
^ Query for loading all posts with the last version of the user profile. SOMEHOW this works, but looks super shady to me since the first include is an args name and the second a string... if you're operating on simpler queries and don't mind falling back to raw sql occasionally, it's kinda nice though. (This is on 0.7.1, might be better now)
I think the first
include = {
is a named parameter whereas the next "include": {
is a dict keythat does make sense but yeah, that's one of the places where it's not as smooth as typescript prisma
also forget editor suggestions for nested queries
cool thanks for the input!