Drift는 Dart 및 Flutter 애플리케이션에서 관계형 데이터베이스를 관리하기 위한 반응형이고 타입 안전한 라이브러리입니다. 컴파일 시점 검사를 지원하는 강력한 SQL 유사 구문을 제공하여 여러 플랫폼 간에 효율적인 로컬 데이터 저장을 가능하게 합니다. Drift는 스트림을 통해 실시간 업데이트를 지원하며, 반응형 데이터 처리가 필요한 앱에 적합합니다. Flutter 워크플로우와 원활하게 통합되어 데이터베이스 작업을 단순화하면서도 성능과 확장성을 유지합니다.
사용 사례
오프라인 우선 모바일 앱
실시간 데이터 동기화
Flutter에서 로컬 데이터 지속성
복잡한 쿼리 작업
크로스 플랫폼 데이터베이스 관리
지속적 저장을 갖춘 앱 상태 관리
주요 기능
스트림을 사용한 반응형 데이터베이스 쿼리
타입 안전한 SQL 구문
컴파일 시 쿼리 검증
이전 및 스키마 진화 지원
크로스 플랫폼 호환성
효율적인 변경 추적
적합한 대상
로컬 데이터베이스 저장이 필요한 플러터 개발자
오프라인 기능이 필요한 앱
복잡한 데이터 관계를 가진 프로젝트
코드 안전성과 유지보수를 우선시하는 팀
SQLite 래퍼의 현대적인 대안을 찾는 개발자
고려 사항
고급 SQL 기능에 대한 학습 곡선
철저한 마이그레이션 계획이 필요합니다
대규모 서버 측 데이터베이스에 적합하지 않습니다
성숙한 대안에 비해 문서가 제한적
반응형 기능으로 인한 런타임 오버헤드
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Drift
Core
Generator
Drift is a reactive persistence library for Flutter and Dart, built on top of
SQLite.
Drift is:
Flexible: Drift lets you write queries in both SQL and Dart,
providing fluent apis for both languages. You can filter and order results
or use joins to run queries on multiple tables. You can even use complex
SQL features like WITH and WINDOW clauses.
🔥 Feature rich: Drift has builtin support for transactions, schema
migrations, complex filters and expressions, batched updates and joins. We
even have a builtin IDE for SQL!
📦 Modular: Thanks to builtin support for daos and imports in SQL files, drift helps you keep your database code simple.
🛡️ Safe: Drift generates type-safe code based on your tables and queries. If you make a mistake in your queries, drift will find it at compile time and
provide helpful and descriptive lints.
⚡ Fast: Even though drift lets you write powerful queries, it can keep
up with the performance of key-value stores like shared preferences and Hive. Drift is the only major persistence library with builtin threading support, allowing you to run database code across isolates with zero additional effort.
Reactive: Turn any SQL query into an auto-updating stream! This includes complex queries across many tables.
⚙️ Cross-Platform support: Drift works on Android, iOS, macOS, Windows, Linux and the web. This template is a Flutter todo app that works on all platforms.
🗡️ Battle tested and production ready: Drift is stable and well tested with a wide range of unit and integration tests. It powers production Flutter apps.
This repository contains a number of packages making up the drift project, most
notably:
drift: The main runtime for drift, which provides most APIs.
drift_dev: The compiler for drift tables, databases and daos. It
also contains a fully-featured SQL IDE for the Dart analyzer.
sqlparser: A SQL parser and static analyzer, written in pure Dart. This package can be used without drift to perform analysis on SQL statements.
It's on pub at
.
We use melos to manage the different packages
in this repository.
You can install it with dart pub global activate melos. To activate it in this
repository, run dart pub get in this directory followed by melos bootstrap.