-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Can this be used for an offline Flutter app? #118
Comments
This is in the support plan. I am in the official Prisma discussion group. It is expected that the dynamic library support will be standardized in the future, then this function will become a reality. |
It would be very helpful if this was explicitly mentioned as a limitation to this package. I have spent the last week developing around this because I thought it was a complete port of the JavaScript Prisma, allowing for local databases, but as I have just found out the hard way, this is not implemented. Here is the error I received before looking this up:
I'm still looking for a decent ORM for local databases. I'll be switching to Drift in the mean time. |
@BradyEdgar94 @SpongeManiac Unfortunately, Library has not been developed yet because I am new to Rust. |
I was curious what the current status of this is? The Engine Binary being supported on Flutter Native, that is. Is there any documentation or prior examples of this being done in other languages? I'd love to help. |
Flutter does not support binary engine files, and Prisma engines https://github.com/prisma/prisma-engines are not ready to be built for CAPI. In other words, if I want to provide an offline local database for Prisma Support, I have to write a CAPI engine whose output target is a dynamic library (so/dll), which is cumbersome, but I'm working on it, I'm building the new Prisma client API, and when it's finished, I can start building the engine part . |
One reason, as mentioned above, is that I am new to Rust. This was a big challenge for me, as I needed to learn the Rust language and develop it at the same time. |
I'm actually doing a similar thing with Mercury, I've never worked with C++ before, but I had to for the project. I wouldn't mind having to do that again for this project, I'd love to know how/if I could help! |
https://pub.dev/packages/flutter_rust_bridge maybe can help |
After I communicated with the Prisma Team, they have started working on the experimental C ABI engine 👉 https://github.com/prisma/prisma-engines/tree/osp/rn/query-engine/query-engine-rn They have already made it Added to this quarter’s roadmap! Please wait patiently, 4.0 will finally use the C ABI engine officially produced by Prisma, so that it can run in Flutter. |
In addition, I am making a temporary replacement version https://github.com/medz/prisma-dart/tree/main/packages/engine_ffi until the C ABI engine is officially released. Since I am new to Rust, my progress may be slow. |
An alternative is to wait for the Dart team to implement dart-lang/sdk#51383 this feature. At that time, I will make a Dart NAPI compatible program that can run in Dart using the Node API's dylib. However, it is obvious that Prisma Team will implement the C ABI engine faster. |
I am looking to convert my Flutter app to be offline first, which means migrating from my GraphQL API(using Prisma) to a local DB Flutter solution. This Prisma-Dart package would be perfect for me if it means a user can have their own DB records stored on their phone. So I am trying to see if that is possible with this package.
My requirements are to have a persistant local DB and handle CRUD operations using this prisma-dart package.
Is this something that is possible with this package?
Thanks so much!
The text was updated successfully, but these errors were encountered: