Open CodingAleCR opened 5 years ago
It should work in theory, but you might run into synchronization problems if you open the database from Moor & Room simultaneously.
If you open the database via FlutterQueryExecutor.inDatabasePath
, the location of the database file will be in Context.getDatabasePath()
on Android. If you model the same table structure in Room, the interop should work. I've never tried it though.
I wonder if it would affect the synchronization. The idea is to make a native homescreen widget for android, and I don't know if the connection would work. I'll try to set it up and see how it goes. Thanks for the quick response!
Hey @CodingAleCR, I want to try something similar. Did you succeed in accessing the same database from both Flutter and native with Room?
Hi, I've had to put my side project on hold due to some personal issues, but I'm hoping to retake it soon. In case you were wondering, my idea was to use Moor to do the modeling and then copy that into the Room Database model. It's theoretically possible but haven't got around to making it a thing.
@nevi-me @CodingAleCR am about to give this a try.
How did you guys go with your projects?
Have kept it on hold since it took a different direction. Still think that it's theoretically possible though. I'm curious to see how it goes for you.
@nevi-me @CodingAleCR am about to give this a try.
How did you guys go with your projects?
If you don't mind, Can you post your results/findings here?
@nevi-me @CodingAleCR am about to give this a try. How did you guys go with your projects?
If you don't mind, Can you post your results/findings here?
I was able to access the DB from the native side on Android but my DB implementation on the Flutter side is using sqlite
instead of Moor.
I get errors from time to time, mostly because I'm accessing the DB from the native Android side for a Home Screen widget. My widget implementation is not the best and was lazily done, so it might be the cause for the errors too.
I have an app written natively that uses Flutter for some features and stores information using Moor. Now I want to access the "Moor" database from my native code (probably using Room library from Android), is it posible?