RobertCraigie / prisma-client-py

Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of use
https://prisma-client-py.readthedocs.io
Apache License 2.0
1.89k stars 81 forks source link

Generate Async and Sync client together at the same time #871

Open Gnosnay opened 10 months ago

Gnosnay commented 10 months ago

Problem

In my project, i mixed sync and async operations together, so i have to use sync and async in the same project but not in the same context.

Suggested solution

Shall we just generate sync and async clients together?

Alternatives

for now i write two generator, and generate clients to different position. but the problem here

  1. i have to commit the code along with code, which a little bit annoying
  2. partial types feature does work anymore. because it share the same context between prisma cli and generated python model.

Additional context

Gnosnay commented 10 months ago

hi i am willing to contribute this feature. would you mind giving me some instruction about how to involve it? thank you!

RobertCraigie commented 10 months ago

I appreciate it @Gnosnay! Unfortunately I think this feature isn't feasible for an external contributor that is new to this codebase as it requires a deep refactor of a large part of this library.

I have started on this refactor in https://github.com/RobertCraigie/prisma-client-py/pull/873 :)

Current TODOs: