Search packages, repositories and app categories

Package detailsv3.9.1

sqlite3

Provides lightweight yet convenient bindings to SQLite by using dart:ffi

AndroidiOSWebmacOSWindowsLinux
30-day downloads
3.8M
Likes
466
Pub points
150

Install package

flutter pub add sqlite3

Package Overview

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

The sqlite3 package provides lightweight and convenient bindings to SQLite using Dart's FFI (Foreign Function Interface), enabling efficient, native-level access to SQLite databases across multiple platforms. It is designed for developers who need a reliable, embedded SQL database solution without the overhead of complex abstractions. The package supports Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform applications requiring local data persistence with full SQL support.

Use cases

  • Offline data storage in mobile apps
  • Cross-platform desktop and web applications
  • Lightweight database needs in Flutter projects
  • Real-time data synchronization with local caching
  • Embedding SQL capabilities in serverless functions

Key features

  • Native performance via dart:ffi
  • Full SQL support including transactions
  • Cross-platform compatibility
  • Minimal memory footprint
  • Easy integration with Flutter
  • Supports prepared statements and parameterized queries

Suitable for

  • Developers needing fast, low-level SQLite access
  • Projects requiring offline-first functionality
  • Apps with moderate to high database usage
  • Teams preferring minimal dependencies
  • Flutter apps targeting multiple platforms

Considerations

  • Requires familiarity with SQLite and SQL
  • Limited higher-level abstractions compared to ORM libraries
  • Manual management of connections and resources
  • Not recommended for very large datasets without optimization
  • May require additional setup on Web due to JS interop constraints

Original README

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

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.

Categories

Dependencies

Dependency list 10 items

Source repository

Projects using this package