dart-drift

Integrate the drift database library into Dart applications for SQLite and PostgreSQL persistence.

5|Updated Oct 14, 2025
One-click install
npx skills add https://github.com/reloveution/dart-flutter-rules --skill dart-drift-reloveution
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dart-drift
Source: https://github.com/reloveution/dart-flutter-rules/tree/main/skills/dart-drift
Command: npx skills add https://github.com/reloveution/dart-flutter-rules --skill dart-drift-reloveution

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of managing local data persistence in Dart applications, providing a robust and type-safe solution for SQLite and PostgreSQL databases.

Core Features & Use Cases

  • Type-Safe Queries: Write queries that are checked at compile time, reducing runtime errors.
  • Reactive Streams: Automatically get notified when your data changes, perfect for UI updates.
  • Schema Migrations: Manage database schema evolution gracefully.
  • Use Case: Building a Dart CLI tool that needs to store user preferences and application state locally, or a server-side Dart application requiring a PostgreSQL backend for robust data management.

Quick Start

Configure your Dart project to use the drift database library with SQLite by adding the specified dependencies to your pubspec.yaml file.

Frequently Asked Questions about dart-drift

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up local SQLite persistence in a Dart application?

To set up local SQLite persistence in a Dart application, configure your project by adding the drift database library to your pubspec.yaml file, enabling type-safe data management. This provides a robust solution for storing application state locally.

What is the best way to write type-safe database queries in Dart?

The best way to write type-safe database queries in Dart is using the drift library, which checks queries at compile time to reduce runtime errors. This ensures robust data management for both SQLite and PostgreSQL backends.

How do reactive streams work with Dart database persistence?

Reactive streams in Dart database persistence automatically notify your application when data changes, which is perfect for triggering UI updates. The drift library facilitates these reactive programming patterns seamlessly.

Can I use a PostgreSQL backend for server-side Dart applications?

Yes, you can use a PostgreSQL backend for server-side Dart applications by integrating the drift database library. It provides robust data management and type-safe persistence for server-side environments.

How do I manage database schema migrations in Dart?

To manage database schema migrations in Dart, use the drift library to gracefully handle database schema evolution. This ensures your local SQLite and PostgreSQL persistence layers remain synchronized as your application grows.