Drift_sqflite는 sqflite 패키지를 사용하여 지속적인 SQL 저장을 위한 Flutter 전용 Drift 데이터베이스 라이브러리의 구현입니다. 쿼리, 마이그레이션 및 실시간 업데이트를 지원하며, 효율적이고 타입 안전한 데이터베이스 작업을 가능하게 합니다. 안드로이드, iOS, macOS에서 사용하도록 설계되었으며, 로컬 데이터 영속성과 강력한 타입 체크 및 컴파일 시점 검사를 필요로 하는 Flutter 앱에 원활하게 통합됩니다. 깔끔하고 표현력 있는 API를 제공하면서도 성능과 신뢰성을 유지합니다.
사용 사례
오프라인 우선 모바일 애플리케이션
실시간 데이터 동기화
앱 데이터의 로컬 캐싱
Flutter 앱에서의 복잡한 쿼리 처리
Flutter에서 데이터베이스 마이그레이션
주요 기능
타입 안전한 데이터베이스 쿼리
컴파일 시 SQL 검증
실시간 데이터 업데이트
마이그레이션 지원
sqflite를 통한 효율적인 SQLite 통합
적합한 대상
로컬 SQL 데이터베이스가 필요한 플러터 개발자
강력한 오프라인 기능을 필요로 하는 앱
코드 안전성과 유지보수를 우선시하는 팀
복잡한 데이터 모델을 가진 프로젝트
확장된 도구를 사용하는 sqflite 개발자
고려 사항
SQL 및 Dart에 대한 지식이 필요합니다
sqflite에서 지원하는 플랫폼에 제한됨
생성된 코드로 인해 앱 크기가 증가할 수 있습니다
클라우드 기반 또는 서버 측 데이터베이스에는 적합하지 않습니다
완전한 기능을 위해 드리프트의 생태계에 의존합니다
원본 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.