Repository navigation
Description
Problem to Solve
When working with Serverpod on the server, developers that need offline support have to rely on other packages, like Drift, which introduces asymmetry in the interaction with the same relational data between server and client, duplicated models, more documentation context, different migration systems, etc.
Proposal
Offer a fully integrated developer experience by exposing the same Model.db on the client to interact with a local SQLite database. The Client would expose a way to create a long-living session and migrations should share the same workflow as migrations on the server. The implementation can be broken out into several steps that will be discussed individually as sub-issues covering:
- Moving the database to a package that can be used on the client.
- Implementing SQLite database support.
- Adapting the CLI to generate client-side repositories.
- Exposing a
DatabaseSessionon the client. - Adapting the migration system to generate and run client-side migrations.
Use Case
A developer wants to build an offline-first application with the same Serverpod ORM experience across the client and server.
Alternatives
Use other packages on the client and deal with the difference in the semantics.
Additional context
Related issues and discussions:
- sqlite3 & drift database support #160
sqfliteadapter for Serverpod protocol classes #1719- SQLite support #1977
- Consider using CRDT (sync) for offline support & client-server sync #2084
This issue is one big step towards seamlessly synchronizing data between client and server database for a true offline-first experience.
How experienced are you with this library?
Expert - Experienced and comfortable with using this library in complex projects
Are you interested in working on a PR for this?
- I want to work on this
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone 🚀
Activity
serverpodand into aserverpod_databasepackage #4784DatabaseSessionon the client #4792[-]Generate a client-side SQLite database using Serverpod models[/-][+]☂️ Generate a client-side SQLite database using Serverpod models[/+]