What problem does it solve?
This Skill provides a practical guide for using Drift to implement persistent storage in Dart applications (CLI tools, backend services, and server-side Dart apps) with local SQLite and optional PostgreSQL support. It helps developers achieve type-safe queries, reactive streams, and robust migrations without fumbling through setup and boilerplate.
Core Features & Use Cases
- Type-safe, reactive persistence with Drift for SQLite and PostgreSQL
- Guidance on schema migrations, code generation, and connection handling
- Use cases include CLI tools, backend services, and server-side apps requiring durable storage
- Provides practical setup and reference materials for Drift workflows
Quick Start
Install dependencies and scaffold a Drift-based database. Example commands:
dart pub add drift sqlite3 (for SQLite)
dart pub add drift postgres drift_postgres (for PostgreSQL)
- Run code generation:
dart run build_runner build
- Create a minimal database class and open a connection as shown in the guide