talira

SQLite plugin for Flutter apps on Android, iOS and macOS

open sourceBSD-2-Clausefree

sqflite is a Flutter plugin for SQLite: a SQL database in a file on Android, iOS and macOS, with SQL run on a background thread so it never blocks the UI. It handles transactions and batches, schema versions when a database opens (onCreate and onUpgrade), and helpers for insert, query, update and delete. Companion packages run the same API on Windows, Linux, the Dart VM and unit tests (sqflite_common_ffi), and experimentally on the web (sqflite_common_ffi_web).

Problems it solves

  • store data in a local SQL database in my Flutter app
  • run SQLite queries in Flutter without blocking the UI thread
  • use the same SQLite code in a Flutter app on mobile and desktop

Features

  • Transactions and batches
  • Schema version management on open (onCreate, onUpgrade)
  • Insert, query, update and delete helpers
  • SQL on a background thread on Android, iOS and macOS
  • Same API on Windows, Linux, the Dart VM and in unit tests through sqflite_common_ffi

Limitations

  • Web support is experimental1

Alternatives

The same job

These do what sqflite does.

  1. sembast Embedded NoSQL document database for Dart and Flutter, stored in a single file
  2. sqlite3 (Dart) SQLite bindings for Dart on native platforms and the web

Compare sqflite with the top 3