drift_postgres는 drift 패키지용 PostgreSQL 데이터베이스 구현을 제공하여 Flutter 애플리케이션이 여러 플랫폼에서 PostgreSQL 데이터베이스와 상호 작용할 수 있도록 합니다. 이는 drift의 강력한 SQL 기반 데이터 접근 레이어를 확장하여 서버 측 PostgreSQL 연결을 지원하며, 개발자가 타입 안전한 쿼리를 작성하고 데이터베이스 스키마를 효율적으로 관리할 수 있게 해줍니다. 클라이언트와 서버 간에 일관된 쿼리 처리가 필요한 강력하고 확장 가능한 백엔드 데이터 저장소가 필요할 때 이상적인 패키지입니다. 모든 주요 데스크톱 및 모바일 플랫폼을 지원하여 크로스플랫폼 호환성을 보장합니다.
사용 사례
Flutter 앱을 PostgreSQL 데이터베이스에 연결하는 방법
drift를 사용하여 확장 가능한 백엔드 서비스 구축
로컬 및 원격 PostgreSQL 인스턴스 간의 데이터 동기화
서버 동기화를 활용한 오프라인 우선 아키텍처 구현
PostgreSQL를 통해 실시간 데이터 업데이트 활성화
Flutter 앱에서 복잡한 데이터베이스 스키마 관리하기
주요 기능
drift를 사용한 타입 안전한 SQL 쿼리
Android, iOS, macOS, Windows 및 Linux에 대한 크로스 플랫폼 지원
drift의 기존 API와의 원활한 통합
마이그레이션 및 스키마 관리 지원
PostgreSQL와의 효율적인 데이터 동기화
내장된 연결 풀 및 트랜잭션 처리
적합한 대상
PostgreSQL 백엔드를 사용하여 Flutter 앱을 개발하는 개발자
오프라인 우선 또는 하이브리드 앱 아키텍처를 구현하는 팀
고성능 데이터베이스 작업을 필요로 하는 응용 프로그램
다양한 플랫폼 간에 일관된 데이터베이스 로직이 필요한 프로젝트
드리프트를 사용하여 데이터 모델링을 수행하는 백엔드 서비스
고려 사항
실행 중인 PostgreSQL 서버가 필요합니다
인증 및 연결 구성에 대한 추가 설정
순수하게 로컬 데이터베이스 용도에는 적합하지 않습니다
원격 액세스를 위해 네트워크 인프라가 필요할 수 있습니다
PostgreSQL 고유 기능 및 구문에 한정
원본 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.