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

[Useful Idea] - Use Prisma Python's custom generation for solid Python client #362

Open
kivo360 opened this issue Aug 22, 2022 · 1 comment

Comments

@kivo360
Copy link

kivo360 commented Aug 22, 2022

I don't have the time to build this out. You should look into using Prisma Python as the base for your client upgrade. Reaching out (via Discord) and partnering with the developer could speed the process.

Context:

I frequently use Prisma Python to deal with SQL queries. It's a great client library that lets me get features out of the way quickly.

While it's great, EdgeDB's features (i.e. filtration, grouping and aggregation) are more powerful. I want to switch to EdgeDB. What's holding me back is writing custom queries. ORMs such in terms of UX, but they're useful for ensuring your modelling is right. The type system and detailed API helps inform me what's available for an API and develop without looking at the docs as much.

Benefits:

Here are some benefits that would come from using his work (and even partnering with him):

  1. (Mostly) Complete Client with Test - He wrote a ton of tests and docs for this software. The client underneath is modular. You should be able to swap the protocol with your own. By changing names for tests and docs, you can have a lot of tests for the client.
  2. Javascript-like API - the TypedDict-based completion allows you to make something that looks a lot like EdgeDB JavaScript/Typescript API.
  3. Easily add custom generators - The code is almost entirely generator-based.
  4. Minimal Prisma Coupling - The shocking part about the library is how uncoupled it is from Prisma.

Path for Fast Execution:

You can execute everything faster if you leverage the right things.

  1. Contact the Prisma Python developer (via Discord) - He's extremely approachable and does not work for Prisma directly (therefore not tied down to Prisma). He knows the library, and can speed your progress along with the right incentives.
  2. Use EdgeQL to Generate Prisma Python compatible models - Prisma Python uses Pydantic models to create generators. You just need to create models that match the formatting of the library to start generating code. He already has the templates for them, and somebody with a pull request is a short step away from completion.
  3. Exploit custom generator feature - Practice generating the new client using his library's custom generator feature.
  4. Convert Prisma Engine to EdgeDB Engine - Replace the engine RPC with your protocol. The interface will be largely similar to what it currently is.
  5. Lock In Specs - Migrate the rest of Prisma specs to EdgeDB's specs.

That would give his library a second major boost (or at least the core of it), and set you all up to dominate the DB market.

I don't have the bandwidth to work on this project. I so deeply want a simplified SQL experience (for parts of my code), that I figured writing something for you all would be a good possible step to achieving that.

Best,
Kevin

@1st1
Copy link
Member

1st1 commented Aug 23, 2022

We have plans to start working on a proper Python query builder soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants