Search packages, repositories and app categories

Package detailsv0.1.0

migrant_db_sqlite

SQLite gateway for Migrant

AndroidiOSLinuxmacOSWebWindows
30-day downloads
718
Likes
1
Pub points
150

Install package

flutter pub add migrant_db_sqlite

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Migrant_db_sqlite is a SQLite database gateway for the Migrant framework, enabling seamless persistent data storage across multiple platforms. It provides a structured way to manage database migrations and schema evolution while leveraging SQLite's reliability and performance. Designed for use with Flutter applications, it supports Android, iOS, Linux, macOS, Web, and Windows, making it ideal for cross-platform apps requiring robust local data handling. The package integrates smoothly with Migrant’s migration system, simplifying database setup and updates.

Use cases

  • Cross-platform offline data storage
  • Database schema versioning
  • App data persistence in mobile and desktop apps
  • Managing complex database migrations
  • Integrating SQLite with Migrant workflows

Key features

  • SQLite-backed migration support
  • Multi-platform compatibility
  • Seamless integration with Migrant
  • Automatic schema management
  • Lightweight and efficient

Suitable for

  • Flutter developers using Migrant
  • Apps needing reliable local databases
  • Projects with evolving database schemas
  • Cross-platform applications
  • Teams managing database changes over time

Considerations

  • Requires Migrant framework
  • Limited to SQLite as backend
  • Migration scripts must be properly defined
  • Not suitable for cloud-synced data
  • Dependent on platform-specific SQLite implementations

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

SQLite gateway for migrant.

Example:

import 'package:migrant/migrant.dart';
import 'package:migrant/testing.dart';
import 'package:migrant_db_sqlite/migrant_db_sqlite.dart';
import 'package:sqflite_common/sqlite_api.dart' show inMemoryDatabasePath;
import 'package:sqflite_common_ffi/sqflite_ffi.dart' show databaseFactoryFfi;

Future<void> main() async {
  // These are the migrations. We are using a simple in-memory source,
  // but you may read them from other sources: local filesystem, network, etc.
  // More options at https://pub.dev/packages/migrant
  final migrations = InMemory([
    Migration('0001', ['CREATE TABLE foo (id TEXT NOT NULL PRIMARY KEY);']),
    Migration('0002', ['ALTER TABLE foo ADD COLUMN message TEXT;']),
    // Try adding more stuff here and running this example again.
  ]);

  // The SQLite connection. We're using a local file.
  var connection = await databaseFactoryFfi.openDatabase(inMemoryDatabasePath);

  // The gateway is provided by this package.
  final gateway = SQLiteGateway(connection);

  // Applying migrations.
  await Database(gateway).upgrade(migrations);
  // At this point the table "foo" is ready.
}

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.

Rankings