Introducing Magic Local Storage 1.0.1
A local SQLite database, ready for Magic.
DB and Schema facades, migrations, seeders, factories and a push-then-pull sync skeleton on one local SQLite connection.
One connection. Every model.
Your Magic app gets a local SQLite database with facades, migrations and seeders that Laravel developers will find familiar. Listed targets: Android, iOS, macOS, Windows, Linux and web.
-
Migrations and Schema
Learn more about Migrations and SchemaMigrationclasses withupanddown, theSchemafacade (create,table,drop,dropIfExists,rename) and aMigratorthat runs them with savepoints. -
The DB facade
Learn more about The DB facadeDB.table(name)returns aQueryBuilder, and the facade also runs raw SQL andDB.transaction. -
Local model storage
A Magic model that sets
Learn more about Local model storageuseLocalreads and writes the local database: the package binds alocal_model_storebehind the model methods. -
Seeders and factories
Learn more about Seeders and factoriesSeederclasses run withSeeding.run(list).Factory<T>classes (definition,count,create) build fake rows for seeds and tests. -
A sync skeleton
A push-then-pull skeleton:
Learn more about A sync skeletonSyncFeed.run, a sync ledger and a cursors table on the same connection. It is a skeleton, not a finished sync. -
One SQLite engine
Native targets use the
Learn more about One SQLite enginesqlite3package over FFI, with the file in the application documents directory. The web usessqlite3.wasmon an IndexedDB-backed file system.
Add it in seconds
Or add to pubspec.yaml:
dependencies:
magic_local_storage: ^1.0.1
Or give your AI agent this prompt: