Open vanlooverenkoen opened 3 years ago
I tested with moor_db_viewer 4.0.0 and I have the same issue there. For web we should use another enging. That is not yet added in the example: https://moor.simonbinder.eu/web/
@gedw99 Did you follow that guide?
In the my_db.dart
file you should use WebDatabase instead of the _openConnection
method. ffi should be removed from that file.
@UseMoor(tables: [Todos, Users])
class MyDatabase extends _$MyDatabase {
MyDatabase() : super(WebDatabase('db'));
@override
int get schemaVersion => 1;
}
Ok I get it.
I wonder if there is a way to setup the example so that these manual switches are not needed ?
Typically compile time or runtime checks are used.
For compile time checks the fact that web cannot depend on FFI means that we need a new entry point to the code ?
That is possible. If you follow the web guide you can see how to share code between web & mobile. It is just not added to the example project
I cant promise a PR, but if i get a time opening will swing back and do it.
👍 alright. I first have some other packages that need to be updated first. After that I will come back to moor_db_viewer to add this. This is not a blocking issue because it works perfectly on web. You only have to follow the moor documentation to get it working in your app.
yep i get that its not blocking. Just wanted to make things tidy.
Yes indeed. That is why I created this new ticket so I don't forget to add this. Thanks for testing the example on web :)
@vanlooverenkoen The update has broken the web target it seems.
flutter run -d chrome --release
_Originally posted by @gedw99 in https://github.com/vanlooverenkoen/moor_db_viewer/issues/38#issuecomment-871137473_