Backup and restore database across web and mobile #1032
anthonychwong
started this conversation in
Ideas
Replies: 1 comment
-
You could use a LazyDatabase(() async {
MoorWebStorage newStorage() => MoorWebStorage('your-database-name');
final storage = newStorage();
await storage.open();
if (await storage.restore() == null) {
await storage.store(your_database_bytes);
}
await storage.close();
return WebDatabase.withStorage(newStorage());
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How to import sqlite file from mobile to web, and vice versa?
I did some searching, while
sql.js
can create db from binaries, butmoor
don't have constructor to create DB from this format.Beta Was this translation helpful? Give feedback.
All reactions