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

套件詳情v3.9.1

sqlite3

透過使用 dart:ffi 提供輕量但便利的 SQLite 綁定

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
357萬
喜歡數
466
Pub 分數
150

安裝套件

flutter pub add sqlite3

套件介紹

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

sqlite3 套件透過 Dart 的 FFI(外部函數介面)提供輕量且便利的 SQLite 繫結,可實現跨多個平台的高效原生資料庫存取。此套件專為需要可靠嵌入式 SQL 資料庫解決方案,但又不希望承擔複雜抽象開銷的開發者設計。支援 Android、iOS、Web、macOS、Windows 及 Linux,非常適合需要本地資料持久化並具備完整 SQL 支援的跨平台應用。

適用情境

  • 移動應用中的離線數據存儲
  • 跨平台桌面和Web應用程序
  • Flutter 專案中的輕量級資料庫需求
  • 即時資料同步與本機快取
  • 在無伺服器函數中嵌入 SQL 功能

主要特色

  • 透過 dart:ffi 實現原生效能
  • 完整的 SQL 支援,包含交易
  • 跨平台相容性
  • 最小記憶體佔用
  • 與 Flutter 的輕鬆整合
  • 支援預處理語句和參數化查詢

適合對象

  • 需要快速、低階 SQLite 存取的開發人員
  • 需要離線優先功能的項目
  • 資料庫使用中等至較高的應用
  • 偏好最小依賴項的團隊
  • Flutter 應用針對多個平台

使用建議

  • 需要熟悉 SQLite 和 SQL
  • 與ORM庫相比,高階抽象功能有限
  • 手動管理連接和資源
  • 不建議在未優化的情況下用於非常大的資料集
  • 由於 JS 互操作性限制,Web 上可能需要額外設定

原始 README

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

sqlite3.dart

This project contains Dart packages to use SQLite from Dart via dart:ffi.

The main package in this repository is sqlite3, which contains all the Dart apis and their implementation. package:sqlite3 is a pure-Dart package without a dependency on Flutter. It can be used both in Flutter apps or in standalone Dart applications.

package:sqlite3_test contains utilities that make integrating SQLite databases into Dart tests easier. In particular, they patch CURRENT_TIMESTAMP and related constructs to return the (potentially faked) time returned by package:clock.

package:sqlite3_web contains helpers for running SQLite on the web, including code to compile web workers that help with the process.

package:sqlite3_connection_pool provides an asynchronous connection pool for SQLite that works well across isolates.

Example Usage

A file with basic usage examples for pure Dart can be found here.

所屬分類

依賴

依賴清單 10 項

原始碼儲存庫

使用此套件的專案