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

Engines for C API #3106

Closed
medz opened this issue Aug 7, 2022 · 9 comments
Closed

Engines for C API #3106

medz opened this issue Aug 7, 2022 · 9 comments
Assignees
Labels
team/client Issue for team Client.

Comments

@medz
Copy link

medz commented Aug 7, 2022

I would like to discuss some thoughts on Prisma ORM engines targeting the C language community.

Initially I saw through prisma/prisma#9473 and more Issues that other programming language developers focus on Prisma ORM except Node environment.

I tried migrating Prisma ORM to Dart language a week ago, although the Binary engine migration went smoothly (just download it via binaries.prisma.sh). But I don't think the binary engine is a critical part anymore.

Since the Prisma ORM JS/TS client is also done via the Dynamic library by default (done via Node-API).

Obviously, Node is just a framework, and adding native modules to Node.js via the Node Addon API is really convenient. But after analyzing FFI in other languages, I found that everyone has implemented native C ABI support, and there is no plug-in mechanism like Node.

I then tried to write the Prisma Query Engine C API, and I found that the module is more general, why not make it support more languages?

Then I thought, the community maintains the C API part is unstable (because Prisma Engines is not released to https://crates.io as expected) The community adopts git to add dependencies https://github.com/prisma/engines is unstable , if the official destructive changes to some content, it will cause serious trouble to the community.

I think, I submit the C API package writing requirements to Prisma official, and the official maintains the C API package. The language implementation of the community only needs to rely on this C API package, and then compile it into a dynamic library is the most reasonable.

@medz
Copy link
Author

medz commented Aug 7, 2022

I know that Prisma officials do not have more energy and funds to maintain Prisma ORM implementations in other languages, but I think that if the official can release this C API package, JS/TS client can be used as a template for other languages to implement Prisma ORM effectively. Bringing more languages and more developers into the field.

@tomhoule tomhoule added the team/client Issue for team Client. label Aug 7, 2022
@medz

This comment was marked as outdated.

@nikolasburk
Copy link
Member

Hey @medz 👋 thank you so much for opening this issue, as well as for your work on the Dart version of Prisma Client and the query-engine-c-api repo! All of this looks like really great work 🎉

Unfortunately, our Product team has set a very clear direction that we're not going to invest any time, neither into building new DB connectors, nor Prisma Client for new languages in the next couple of months. I still think it's great to have this issue open as a future reminder for the time when we're ready to expand into other languages, but for now I just want to set expectations from our side that this is not going to end up on our roadmap any time soon, hope you understand!

FYI, I'm also reaching out to you via email (which I found in your GitHub profile whine.whitish.0u@icloud.com), would love to chat more about your work on the Prisma Client for Dart if you're open to it! 🙏

@medz
Copy link
Author

medz commented Aug 9, 2022

query-engine-c-api completed:

  • version
  • dmmf
  • engine_create
  • engine_connect

@medz

This comment was marked as outdated.

@listepo
Copy link

listepo commented Jan 30, 2024

@nikolasburk any news about official C API? This shouldn't be a problem, you can use https://github.com/rust-lang/rust-bindgen

@aqrln
Copy link
Member

aqrln commented Feb 9, 2024

@listepo rust-bindgen does the opposite thing, it automatically generates Rust extern declarations from C headers.

@listepo
Copy link

listepo commented Feb 11, 2024

Sorry, https://github.com/mozilla/cbindgen this must be it

@medz
Copy link
Author

medz commented Apr 15, 2024

#4793

I noticed that this PR has been merged. Do you have any information about the C ABI engine? Or you can find a place to use it! I still can't wait to follow up~

Additionally, due to the merger of this PR, I will close this issue. I want to search for any outputs and information about it.

@listepo , thank you for your attention. Once I make any progress, I will update you in Prisma for Dart's Flutter issue!

@medz medz closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team/client Issue for team Client.
Projects
None yet
Development

No branches or pull requests

5 participants