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

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

Open
Gnosnay opened this issue Jan 18, 2024 · 2 comments
Open

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

Gnosnay opened this issue Jan 18, 2024 · 2 comments
Labels
kind/improvement An improvement to existing feature and code. level/advanced priority/high topic: client Related to the Client API topic: generation

Comments

@Gnosnay
Copy link

Gnosnay commented Jan 18, 2024

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

@RobertCraigie RobertCraigie added kind/improvement An improvement to existing feature and code. topic: client Related to the Client API level/advanced priority/high topic: generation labels Jan 18, 2024
@Gnosnay
Copy link
Author

Gnosnay commented Jan 20, 2024

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

@RobertCraigie
Copy link
Owner

RobertCraigie commented Jan 21, 2024

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 #873 :)

Current TODOs:

  • Figure out structure for Model.prisma()
  • Figure out structure for registering clients
  • Generate separate sync / async actions classes
  • Define separate sync / async transaction managers
  • Generate separate sync / async batch actions classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement An improvement to existing feature and code. level/advanced priority/high topic: client Related to the Client API topic: generation
Projects
Development

No branches or pull requests

2 participants