Skip to content

using database with flutter background service #1252

Answered by simolus3
laitooo asked this question in Q&A
Discussion options

You must be logged in to vote

I don't have a lot of experience with the background service package, but this stands out:

The code will executed in isolated process, you can't share reference between UI and Service. Use sendData and onDataReceived to communicate between service and UI.

This means that, by default, you can't share a moor database between the UI and a background service. You can open the database separately of course. The only real downside is that real-time stream queries wouldn't work.

If you also need stream queries, you can implement a moor remote database over the communication primitives provided by that package. This would allow you to use everything moor has to offer across that database. You c…

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@simolus3
Comment options

@2math
Comment options

@2math
Comment options

@2math
Comment options

@2math
Comment options

Answer selected by laitooo
Comment options

You must be logged in to vote
1 reply
@2math
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants