搜尋套件、儲存庫與 APP 分類

套件詳情v0.1.0

migrant_db_sqlite

Migrant 的 SQLite 網關

AndroidiOSLinuxmacOSWebWindows
近 30 天下載
718
喜歡數
1
Pub 分數
150

安裝套件

flutter pub add migrant_db_sqlite

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Migrant_db_sqlite 是 Migrant 框架的 SQLite 資料庫閘道,可於多個平台實現無縫的持續資料儲存。它提供一種結構化的方式來管理資料庫遷移與模式演進,同時發揮 SQLite 的可靠性與效能。專為 Flutter 應用設計,支援 Android、iOS、Linux、macOS、Web 與 Windows,非常適合需要強大本機資料處理功能的跨平台應用。此套件與 Migrant 的遷移系統順暢整合,簡化資料庫的設定與更新。

適用情境

  • 跨平台離線資料儲存
  • 資料庫模式版本控制
  • 移動和桌面應用程式中的應用資料持久化
  • 管理複雜的資料庫遷移
  • 將 SQLite 與 Migrant 工作流程整合

主要特色

  • 基於 SQLite 的遷移支援
  • 多平台相容性
  • 與 Migrant 的無縫整合
  • 自動模式管理
  • 輕量且高效

適合對象

  • 使用 Migrant 的 Flutter 開發人員
  • 需要可靠本地資料庫的應用程式
  • 具有不斷演變的資料庫架構的專案
  • 跨平台應用程式
  • 團隊管理隨時間變更的資料庫變更

使用建議

  • 需要 Migrant 框架
  • 僅限 SQLite 作為後端
  • 遷移腳本必須正確定義
  • 不適用於雲端同步資料
  • 依賴於平台特定的 SQLite 實現

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

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.
}

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。

所在榜單