sqflite on top of sqflite_async #20
Replies: 2 comments
-
Hi, thanks for the input! API compatibility with sqflite is something I've wanted for a while, but haven't gotten around to it. We're definitely open to PRs to help with those goals. On the points you've mentioned: Read-only databasesThis should be fairly simple - read-only connections are already used. Probably just needs some changes to the connection pool logic to not have a write connection. In-memory databasesThis will have be restricted to a single connection. Can probably bypass the connection pool and just use Multiple Isolatessqlite_async does support multiple isolates on different levels:
It is still required to have a single global SqliteDatabase to manage these connections. I don't have enough experience with e.g. push notifications to know whether additional work is required for that. Other related projectsWeb supportWe're starting work on this, but it's quite tricky. The underlying
Regardless of that, web support has some challenges:
DriftThe Drift project by Simon Binder is great, and some of the ideas here come from that. In an ideal world, I'd unify the projects so that Drift is just an ORM layer on top of a lower-level library like sqlite_async or similar. I haven't yet looked in detail at what would be required for this. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick reply.
Thanks again and looking forward providing good solutions for SQLite for everyone! |
Beta Was this translation helpful? Give feedback.
-
Hello and thanks for your package which I think make the right decisions in terms of feature (WAL, multiple readers, read/write transaction...). I'm the author of sqflite and try to provide multiple implementations for the various platforms using a common API (opiniated and mostly based on the Android original API).
I'm currently working on
sqflite_common_ffi_async
(Yes, I know bad name). sqflite has a java-like abstraction using a factory so your implementation is a good test for the abstraction layer. It has some history (6+ years) and compatibility constraints that luckily you don't have.After some work, most of my tests are working except the ones that are specific to sqflite. I might publish it at some point.
I might send (or not) some requests or PR regarding supporting:
or might simply decide to use existing sqflite_common_ffi (which is similar is some sense to your implementation but not as powerful) for theses cases.
The goal is mainly to provide a better implementation for those who need it without having to change their existing code. Developers might decide to switch to
sqlite_async
at some point which I'm perfectly fine.One the main drawback of the existing sqflite is cross isolate support which is kind complex so I was wondering whether your implementation supports multiple isolates (the common scenario being accessing SQLite in a push notification).
I hope you're ok with that and we'll end up cooperating when needed, I have a nice relation with Simon Binder where we help each other (well he helps me more than I help him). I'm a freelance developer and ended up maintaining sqflite just because I started it. People might get confused of having multiple SQLite solution but I think it helps make the overall solution better in the long term.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions