Skip to content
CAI
Software that uses CAICheck a score

simolus3/drift

68.9

Adequate · 23 September 2026

114.3k

lines of production code

Dart

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Drift is a reactive, type-safe database library for Dart and Flutter that enables developers to define schemas using either Dart code or SQL files. It provides a comprehensive ORM layer with a fluent query builder, automatic code generation, and support for complex data relationships, full-text search, and geospatial queries. The system features cross-platform execution via native SQLite, WebAssembly for web environments, and backends for PostgreSQL and MariaDB, while ensuring data integrity through runtime schema validation and step-by-step migration management.

How it got here

2019–2021 — Drift 3.0 architecture and SQL parser

87 changes.

This period focused on the foundational development of the standalone sqlparser library, implementing a comprehensive AST, tokenizer, and static analysis engine for SQL. Concurrently, the Drift runtime underwent a major architectural overhaul to support multi-dialect generation, isolate sharing, and a new modular code generation pipeline for the upcoming Drift 3 release.

2022 — WebAssembly support and analysis rewrite

66 changes.

This period focused on enabling Drift to run in web browsers via WebAssembly and shared workers, alongside the introduction of a new Sqflite executor for mobile platforms. The code generation engine underwent a significant rewrite to a modular analysis backend, improving static analysis, multi-dialect support, and migration tooling.

2023–2026 — Drift 3 preview and ecosystem expansion

64 changes.

This period focused on developing the Drift 3 preview, introducing a new Manager API, a standalone drift\_sqlite backend with WebAssembly support, and a DevTools extension for database inspection. It also expanded the project's ecosystem by adding experimental backends for MariaDB and PostgreSQL, while providing comprehensive migration tools and examples to facilitate the transition to the new architecture.

Features

Add AST nodes for Drift-specific SQL syntax

The parser now recognizes Drift-specific syntax within \.drift\ files, including declared statements with optional result class overrides, inline Dart placeholders (expressions, limits, ordering terms, and insertables), nested query columns (\LIST(...)\), nested star result columns (\\\\), and import statements. This enables the parser to correctly model and transform these advanced query features used by the Drift ORM.

sqlparser/lib/src/ast/drift · high confidence

Add Drift PostgreSQL example application

The extras/drift\_postgres/example directory now includes a runnable example application (main.dart and generated code) that demonstrates how to set up a Drift database backed by the PostgreSQL driver. The example defines a Users table with a UUID primary key and a name field, configures the PgDatabase connection with localhost credentials, and performs a basic insert and delete operation, serving as a reference implementation for integrating Drift with PostgreSQL.

_extras/drift\postgres/example · high confidence

Add Drift-based benchmarks for prepared statement caching and insert performance

The benchmark suite in the extras/moor location has been migrated from the Moor library to Drift. This update introduces new performance tests that specifically measure the impact of prepared statement caching (comparing cached vs. non-cached execution) and compare batched versus serial database insert operations.

extras/benchmarks/lib/src/moor · high confidence

Add SQL parser example demonstrating schema registration and query analysis

The sqlparser/example directory now includes a Dart example (sqlparser\_example.dart) that demonstrates how to use the SqlEngine to register tables from SQL strings and analyze a SELECT statement. The example shows how to parse a complex query involving joins, filters, and ordering, then inspect the result columns and their inferred types, providing a concrete usage pattern for the library's analysis capabilities.

sqlparser/example · high confidence

Add Web support for drift\_sqlite via sqlite3\_web

This change introduces a new Web-based database connection implementation for the drift\_sqlite package, enabling SQLite operations in browser environments. It adds a worker-side handler (DriftWorkerDatabase) that processes custom requests from the client, a client-side session implementation (WebSession) that wraps the sqlite3\_web database, and a protocol layer (protocol.dart) for serializing SQL statements, parameters, and results between the Dart client and the Web Worker. This allows users to run drift queries on the web using the sqlite3\_web package.

_future/drift\sqlite/lib/src/connection/web · high confidence

Add database backup and restore functionality to the drift3 demo app

The drift3 demo application now includes a backup and restore feature for its SQLite database. Users can save the current database state to a file via a dialog accessible through a new save icon, and restore from a previously saved backup file. This functionality is implemented using the file\_picker package for file selection and sqlite3 for database operations, with platform-specific support handled via conditional exports.

_examples/app\drift3/lib/screens/backup · high confidence

Add database backup and restore functionality to the example app

The example app now includes a backup and restore feature for its SQLite database. A new backup screen provides a dialog where users can save the current database to a file or restore from a previously saved backup. The implementation uses the file\_picker package to select directories and files, and leverages SQLite's VACUUM INTO command to create backups. On unsupported platforms, the backup icon is hidden.

examples/app/lib/screens/backup · high confidence

Add encrypted Drift executor for SQLite databases

Users can now enable transparent database encryption by using the new \EncryptedExecutor\ from the \encrypted\_drift\ package (located in \extras/encryption\). This executor wraps the \sqflite\_sqlcipher\ library, allowing Drift to store and query data in an encrypted SQLite file. To use it, replace the standard \SqfliteQueryExecutor\ or \NativeDatabase\ with \EncryptedExecutor\ (or \EncryptedExecutor.inDatabaseFolder\) and provide a password, while keeping the rest of the Drift API unchanged.

extras/encryption · high confidence

Add home screen UI components for the drift3\_preview demo

The home screen area for the drift3\_preview example now includes the core UI widgets required to interact with the todo list: a TodoCard for displaying and deleting entries, a CategoriesDrawer for managing category colors and selection, state management providers for the active category and filtered entries, and a TodoEditDialog for modifying entry details and due dates.

_examples/app\drift3/lib/screens/home · high confidence

Add iOS example app scaffolding

The iOS example app now includes the standard Xcode project structure and configuration files required to build and run the Flutter application on iOS devices. This adds the necessary project files, including the main application target, scene delegate, app delegate, and asset catalogs, enabling developers to open and build the iOS version of the example app directly in Xcode.

examples/app/ios · high confidence

Add legacy web test HTML template

A new HTML template file (web\_test.html.tpl) has been added to the legacy web integration test assets. This template provides the basic structure for running web-based tests, including references to the SQL WASM library and the Dart test runner.

_extras/integration\_tests/legacy\web/assets · high confidence

Add macOS target to example app

The example application now supports macOS, allowing users to build and run the app on Apple desktop devices. This change introduces the complete native macOS project structure, including the Xcode workspace, build configurations, and entitlements, alongside the necessary Flutter integration files such as the generated plugin registrant and window controller.

examples/app/macos · high confidence

Add multi-package drift example demonstrating modular build setup

Added a new example in \examples/multi\_package\ that demonstrates how to share database table definitions across multiple packages using Drift's modular build setup. The example consists of a \shared\ package containing table definitions, a \server\ package using a Postgres database, and a \client\ package using a local SQLite database. It shows how to configure \drift\_dev:analyzer\ and \drift\_dev:modular\ builders in \build.yaml\ to generate code for multiple SQL dialects (SQLite and Postgres) from a single shared source, allowing the client and server to communicate while maintaining separate database implementations.

_examples/multi\package · high confidence

Add multi-package example with shared database schema

The \examples/multi\_package/shared\ location now provides a reusable Drift database schema package containing \Users\ and \Posts\ tables, along with generated Dart code and a modular accessor (\SharedDrift\) to expose these tables to other packages. This shared layer is consumed by the server package, which defines an additional \ActiveSessions\ table and demonstrates cross-package joins and authentication logic.

_examples/multi\package/shared · high confidence

Add new cross-platform Flutter example app

A new Flutter example application has been added to demonstrate the library's capabilities on mobile and desktop platforms. The app features a simple todo-list interface with home and search screens, utilizing GoRouter for navigation and Riverpod for state management. It also includes configuration to demangle stack traces for better debugging output.

examples/app/lib · high confidence

Add new cross-platform Flutter example with WebAssembly support

A new Flutter web example has been added to the examples/app/web directory, demonstrating how to run the Drift database library using the experimental WebAssembly backend. This example includes the necessary web infrastructure files (index.html, manifest.json) and a dedicated web worker (worker.dart) that initializes the WASM database, enabling users to test and adopt the new cross-platform WebAssembly implementation in Chrome.

examples/app/web · high confidence

Add string binding benchmark for SQLite

A new benchmark has been added to the SQLite benchmark suite to measure the performance of selecting a single string variable using prepared statements. This test initializes an in-memory database, prepares a parameterized query, and executes it repeatedly to reduce variance, providing data on string binding overhead in the sqlite3 package.

extras/benchmarks/lib/src/sqlite · high confidence

Add support for SQLite built-in system tables

The SQL parser engine now recognizes and allows queries against SQLite's internal system tables: \sqlite\_master\, \sqlite\_schema\ (an alias for \sqlite\_master\ since version 3.33.0), and \sqlite\_sequence\. These tables are automatically registered by the \SqlEngine\ constructor, enabling analysis and autocomplete for standard SQLite metadata queries without requiring manual table registration.

sqlparser/lib/src/engine · high confidence

Add web assets for the Drift DevTools extension

The \extras/drift\_devtools\_extension/web\ directory now includes the standard web entry point (\index.html\), the PWA manifest (\manifest.json\) defining the extension's name and icons, and a symlink to the \sqlite3.wasm\ binary. These files provide the necessary frontend infrastructure for the Drift DevTools extension to run in a browser environment.

_extras/drift\_devtools\extension/web · high confidence

Added AST equality enforcement and metadata support utilities

The sqlparser library now includes new utility files in the utils directory to support internal AST operations. ast\_equality.dart introduces an EqualityEnforcingVisitor that performs deep equality checks on AST nodes, throwing exceptions if differences are found, which aids in testing and validation. meta.dart adds a HasMetaMixin allowing AST nodes to store and retrieve arbitrary typed metadata, enabling features like attaching variable scopes to subtrees.

sqlparser/lib/src/utils · high confidence

Added Android application scaffolding for the encrypted\_drift example

The Android side of the \encrypted\_drift\ example app now includes the standard Flutter project structure, including \AndroidManifest.xml\ files, a \MainActivity\ extending \FlutterActivity\, and launch theme resources. This scaffolding enables the example to be built and run on Android devices, supporting the integration tests mentioned in the commit history.

extras/encryption/android · high confidence

Added Android platform configuration for drift\_sqflite

The Android module for drift\_sqflite now includes the necessary project scaffolding to run on Android devices. This adds the main AndroidManifest.xml declaring the Flutter v2 embedding and MainActivity, debug and profile manifests with INTERNET permission for development tools, standard launch splash screens and themes (including dark mode support), and a Gradle wrapper configured to use version 8.1.1. A .gitignore file is also added to exclude build artifacts and sensitive keystore files.

_drift\sqflite/android · high confidence

Added Drift 3 example application

A new example application demonstrating Drift 3 has been added to the repository. This includes the complete Android project structure (manifests, MainActivity, and launch themes) and the Flutter application entry point, which sets up routing with GoRouter and state management with Riverpod for a simple 'Drift Todos' interface.

_examples/app\_drift3/android, examples/app\drift3/lib · high confidence

Added Drift Flutter example application

The drift\_flutter/example directory now includes a minimal, runnable example application demonstrating how to set up and use the Drift database library within a Flutter project. This includes the main entry point defining a simple table schema and database class, along with the corresponding generated code, providing a starting point for users to understand basic integration.

_drift\flutter/example · high confidence

Added JSON serialization for drift analysis result models

The drift development tool now includes generated JSON serialization code for its internal analysis result models (such as column constraints, Dart symbols, database accessors, and element identifiers). This enables these analysis structures to be serialized to and deserialized from JSON, which is a prerequisite for persisting or transmitting analysis data.

_drift\dev/lib/src/generated/analysis/results · high confidence

Added drift 3.x migration tool

A new upgrade tool has been added to automatically migrate projects from drift 2.x to drift 3.x. This tool updates Dart source files by rewriting table definitions, query extensions, and import statements to align with the new API, and it modifies project configuration files by replacing the 'drift' dependency with 'drift3\_preview', 'drift\_sqlite', and 'drift\_manager' in pubspec.yaml, while also configuring the necessary builder options in build.yaml.

_drift\dev/lib/src/services/upgrade · high confidence

Added iOS native project scaffolding for the Drift Sqflite runner

The iOS directory now contains the complete Xcode project structure required to build and run the application on iOS devices. This includes the \Runner.xcodeproj\ workspace, configuration files (\.xcconfig\, \Info.plist\), and native assets such as the \AppDelegate.swift\, storyboards, and app icons. This change establishes the native host environment for the Flutter integration, enabling the app to be launched and tested on iOS simulators and physical devices.

_drift\sqflite/ios · high confidence

Added low-level Dart benchmarks with result comparison

The extras/benchmarks directory now includes a new benchmark runner that executes defined benchmarks and outputs results to a JSON file. A ComparingEmitter component allows users to compare current benchmark timings against previous results stored in that file, displaying deltas for performance tracking. The benchmark generation is configured to disable the manager builder, and tests have been added to verify the comparison logic for both performance improvements and regressions.

extras/benchmarks · high confidence

Drift 1.6.0: New Wasm backend, isolate sharing, and native asset support

This release introduces a new WebAssembly (Wasm) backend for web platforms via the \drift/wasm.dart\ library, offering better performance and native OPFS/IndexedDB support compared to the deprecated \sql.js\-based \drift/web.dart\. It adds a robust API for sharing databases across isolates using \DriftIsolate\ and \NativeDatabase.createInBackground\, including a \readPool\ for concurrent read operations. The \NativeDatabase\ now supports custom SQLite bindings via the \sqlite3\ parameter to enable native assets SDK integration, and prepared statement caching is enabled by default for improved performance.

drift/lib · high confidence

Drift 3 preview module is now exported

The \future/drift3/lib/drift.dart\ file has been added to the package, serving as the public entry point that re-exports the internal \drift3\_preview\ implementation. This change makes the Drift 3 preview API available to consumers of the library through the standard \drift\ import path.

future/drift3/lib · high confidence

Experimental MariaDB backend for Drift

A new \drift\_mariadb\ package has been added to the extras directory, providing an experimental backend that allows Drift to connect to MariaDB databases. This integration introduces a \MariaDBDatabase\ class that wraps the \mysql\_client\ library, enabling users to execute standard SQL operations (select, insert, update, custom) and manage schema migrations against a MariaDB instance. The package includes an example demonstrating connection setup and a test suite using the standard Drift test cases to verify basic functionality.

_extras/drift\mariadb · high confidence

Initial PostgreSQL backend support for Drift

This change introduces the \drift\_postgres\ package, providing a new database backend that allows Drift to interact with PostgreSQL databases. It includes the core \PgDatabase\ implementation for managing connections and executing queries, along with support for PostgreSQL-specific data types such as UUIDs, points, intervals, dates, timestamps, and arrays. Users can now use Drift with PostgreSQL by integrating this new package.

_extras/drift\postgres/lib/src · high confidence

Initial package scaffolding and configuration for Drift

This change introduces the foundational configuration files for the Drift package, including the \.pubignore\ file to control publishing artifacts, \build.yaml\ and \build.test.yaml\ to define build runner targets and options for code generation, \analysis\_options.yaml\ to enforce linting rules, and \dart\_test.yaml\ to configure test execution across different platforms and compilers. It also adds the \LICENSE\ and \README.md\ files to establish the project's open-source terms and documentation.

drift · high confidence

Initial release of drift\_sqflite package

The drift\_sqflite package is introduced as a new database implementation for the drift ORM, utilizing the sqflite package for storage. This serves as a replacement for the deprecated moor\_flutter package, providing a SqfliteQueryExecutor that allows users to configure their drift databases to store data in the application's document folder. The release includes version 1.0.0 as the initial launch, followed by 2.0.0 to support drift version 2.0.0, and 2.0.1 which fixes a batch implementation issue where a second transaction was incorrectly started.

_drift\sqflite · high confidence

Initial release of drift\_sqlite for Drift 3 preview

This entry introduces the new \drift\_sqlite\ package (version 0.1.0-alpha.0), which provides the SQLite backend for the upcoming Drift 3 preview. It enables users to open database connections on native platforms using \sqliteConnectionPool\ and on the web via WebAssembly (\sqlite3.wasm\) with web workers. The package includes a \build.yaml\ configuration targeting SQLite 3.37 with \json1\, \fts5\, and \geopoly\ modules, and provides platform-specific connection examples and tests for native, in-memory, and web environments.

_future/drift\sqlite · high confidence

Initial setup of the Drift DevTools extension scaffold

Added the initial project structure and configuration files for the Drift DevTools extension, including build scripts, analysis options, and documentation. This establishes the foundation for integrating the drift database viewer into the Dart & Flutter DevTools environment, allowing users to inspect drift databases directly within the debugger.

_extras/drift\_devtools\extension · high confidence

Internal infrastructure for drift3 preview schema handling and migrations

This change introduces internal helper classes and utilities within the drift3 preview module to support schema management and migration workflows. It adds common SQL dialect type implementations (for byte arrays, doubles, and text) to standardize data handling across different SQL dialects. It also includes a runtime helper for exporting database schemas to SQL statements via isolates, which supports the \drift\_dev schema export\ command. Additionally, it provides the core classes for versioned schemas, enabling step-by-step database migrations by allowing generated code to create lightweight table snapshots and execute migration steps sequentially while managing schema version persistence.

_drift/lib/src/drift3\preview/internal · high confidence

Introduce Drift DevTools extension for database inspection

A new DevTools extension has been added that integrates a database viewer into the Flutter DevTools interface. Users can now inspect Drift databases directly within the DevTools environment, viewing a list of available databases and their details through a split-pane UI. The extension includes an info button that provides links to report issues and credits the underlying db\_viewer library.

_extras/drift\_devtools\extension/lib · high confidence

Introduce Manager API with computed fields, filters, and reference prefetching

The runtime manager implementation has been rewritten to support a new fluent API for querying and managing data. This change introduces computed fields that automatically handle necessary joins, allowing users to filter and order by related table columns without manual join setup. It also adds support for combining filters with AND/OR logic, null ordering, and a \withReferences\ mechanism that enables prefetching related data via joins or secondary queries to avoid N+1 problems. The manager now exposes methods for creating, updating, and deleting records, along with bulk operations, providing a more integrated and efficient way to interact with the database.

drift/lib/src/runtime/manager · high confidence

Introduce Manager code generation infrastructure

The drift\_dev build step now includes the core writer components for the new Manager API. This change adds the \DatabaseManagerWriter\, \TableManagerWriter\, and associated code templates that generate the entrypoint classes (e.g., \AppDatabaseManager\) and individual table managers. These generated classes provide a structured way to access table-specific managers from the database instance, laying the groundwork for the new data access layer.

_drift\dev/lib/src/writer/manager · high confidence

Introduce PostgreSQL backend for drift with native type support

The \drift\_postgres\ package now provides a dedicated backend for PostgreSQL, enabling users to store and query Postgres-specific data types directly. This includes custom types for UUIDs, intervals, JSON/JSONB, points, and various array types (boolean, integer, text, double, JSONB). It also introduces dedicated column types for dates and timestamps, including \PgDate\ for date-only storage and \PgDateTime\ for timestamps with and without time zones, ensuring proper serialization and comparison. A new \PgTypes\ class exposes these custom SQL types for use in drift database schemas.

_extras/drift\postgres/lib · high confidence

Introduce autocomplete hint descriptions for table names and tokens

The autocomplete engine now uses a new \HintDescription\ abstraction to generate suggestions. This includes \TableNameDescription\, which provides suggestions for known table names from the result sets, and \TokensDescription\, which inserts static token types with whitespace. These descriptions can be combined using \CombinedDescription\ to support more complex autocomplete contexts.

sqlparser/lib/src/engine/autocomplete/descriptions · high confidence

Introduce context-aware SQL auto-complete engine

The SQL parser now includes a new auto-complete engine that provides context-aware suggestions for SQL queries. By analyzing parse hints at specific cursor positions, the engine can suggest completions such as table names and column names, improving the developer experience when writing SQL within the analyzer plugin.

sqlparser/lib/src/engine/autocomplete · high confidence

Introduce custom select statements and query row utilities

Users can now execute raw SQL queries using the new CustomSelectStatement API, which returns results as QueryRow objects. These QueryRow instances provide a generic read\<T\>(key) method for accessing column values, along with deprecated convenience methods like readBool and readString. The change also adds SelectWithoutTables for building select expressions without a FROM clause and introduces support for compound queries (UNION) via JoinedSelectStatement.

_drift/lib/src/runtime/query\builder/statements/select · high confidence

Introduce drift3 preview with background database computation and update notification modes

This change introduces the drift3 preview API, adding a new \computeWithDatabase\ extension that allows running expensive database computations on a background isolate while sharing the database connection, which is particularly useful for heavy batch operations or complex SQL generation. It also adds an \UpdateNotificationMode\ enum to \sqliteConnectionPool\, offering a \drift\ mode that processes updates entirely in Dart to ensure streams capture changes in \WITHOUT ROWID\ tables and custom updates, complementing the default \native\ mode that relies on SQLite update hooks. Additionally, a helper file is added to support drift\_dev code generation by exporting necessary types.

_future/drift\sqlite/lib/src · high confidence

Introduce drift\_flutter package with cross-platform database connection options

The new drift\_flutter package provides a unified \driftDatabase()\ entry point that automatically selects the appropriate backend (WebAssembly for web, FFI for native) based on the runtime platform. Users can now configure platform-specific behaviors via \DriftWebOptions\ (e.g., WASM module paths, worker URIs, and initialization callbacks) and \DriftNativeOptions\ (e.g., custom database/temporary directories, isolate sharing, and setup callbacks). This abstraction simplifies database initialization across Flutter targets while supporting advanced features like isolate synchronization and sandboxed temporary file handling.

_drift\flutter/lib/src · high confidence

Introduce drift\_sqflite as a new database executor

A new \drift\_sqflite\ package is added to provide a \SqfliteQueryExecutor\, allowing users to run drift databases on top of the sqflite engine. This executor supports opening databases via absolute paths or relative to the system database folder, includes a custom creator callback for initializing databases from assets, and exposes the underlying sqflite database instance for advanced use cases.

_drift\sqflite/lib · high confidence

Introduce future drift\_sqlite package with SQLite dialect implementation

This change adds the \future/drift\_sqlite\ package, providing a new SQLite dialect implementation for the Drift ORM. It introduces a \SqliteCompiler\ that handles SQL generation, including support for \WITHOUT ROWID\ and \STRICT\ table modifiers, and configurable datetime storage (as text or unix timestamps) with appropriate SQL functions like \julianday\ and \strftime\ for comparisons. The package also includes extensions for SQLite-specific features such as the \json1\ API (\json\_extract\, \json\_each\, etc.), custom \regexp\ operators with flag support, and granular control over insert behaviors via \InsertMode\ (e.g., \insertOrIgnore\, \insertOrReplace\). Additionally, it provides utilities for complex table migrations (\alterTable\) and defines specific type mappings for booleans, integers, and JSON, ensuring compatibility with SQLite's storage classes.

_future/drift\sqlite/lib/src/dialect · high confidence

Introduce future drift\_sqlite package with native and WebAssembly support

A new \drift\_sqlite\ package is added to provide SQLite database connectivity for the upcoming drift3 preview. On native platforms, it offers a connection pool (\sqliteConnectionPool\) that supports concurrent reads via multiple reader connections, configurable prepared statement caching, and WAL journal mode. For web environments, it introduces \WasmDatabase\ utilities to open databases using SQLite compiled to WebAssembly via \sqlite3\_web\. The package also includes a schema verifier for debugging migration mismatches and exports dialect-specific types and expressions.

_future/drift\sqlite/lib · high confidence

Introduce standalone SQL parser and analyzer library

The \sqlparser\ library is now available as a standalone Dart package, providing a public API for parsing and analyzing SQL statements. This release exposes core components including the AST, parser, and tokenizer, alongside a comprehensive set of built-in SQLite extensions such as FTS5, JSON1, RTREE, GEOPOLY, DBSTAT, SPELLFIX1, MATH, and PowerSync. Users can now leverage these modules for static analysis and syntax validation within their applications.

sqlparser/lib · high confidence

Introduces AST nodes for SQL queryables, joins, aliases, and tuples

The parser's abstract syntax tree now includes dedicated classes to model the FROM clause and join structures more precisely. Users can now parse and analyze table references with optional schema names and aliases, nested select statements as sources, and various join types (including comma-separated tables, left/right/full/inner/cross joins) with ON or USING constraints. Additionally, the AST supports row values (tuples) and explicit alias clauses, enabling better resolution of forward references and support for complex query structures.

sqlparser/lib/src/ast/common · high confidence

Introduction of Dart Table Definition DSL

Drift now allows defining database tables and views directly in Dart code using a new Domain Specific Language (DSL) located in \drift/lib/src/dsl\. This change introduces the \Table\ and \View\ base classes, along with column builders (\ColumnBuilder\) and type definitions (e.g., \IntColumn\, \TextColumn\) that enable the build runner to generate the corresponding SQL schema. The DSL supports defining column types, primary keys, unique constraints, foreign key references with configurable actions (\KeyAction\), and default values, providing a code-first alternative to \.drift\ SQL files for schema management.

drift/lib/src/dsl · high confidence

Major restructuring of the query builder expression API

The query builder's expression system has been reorganized into a modular file structure, moving aggregate, algebraic, boolean, datetime, and text operations into dedicated files (e.g., \aggregate.dart\, \algebra.dart\, \datetimes.dart\). This change introduces new capabilities including bitwise operators for integers, \CASE WHEN\ expressions (with and without a base), and \EXISTS\/\NOT EXISTS\ subquery checks. It also adds support for \BigInt\ arithmetic and aggregations, custom SQL expressions, and dialect-specific type handling. Additionally, the API standardizes comparison methods (renaming \isGreaterThan\ to \isBiggerThan\ via v3 rename pragmas) and enhances datetime handling with \unixepoch\, \julianday\, and \strftime\ support.

_drift/lib/src/runtime/query\builder/expressions · high confidence

Modular code generation now supports database accessors with custom queries

The modular example project now demonstrates how to use the \@DriftAccessor\ annotation to define custom database accessors that include specific drift files and define custom queries (such as \addUser\). The generated code includes the accessor mixin, a manager for table accessors within the accessor, and integrates the accessor into the main \@DriftDatabase\ definition via the \daos\ parameter, allowing users to organize database logic into modular, reusable components.

examples/modular/lib · high confidence

Modular example adds FTS search, custom type converters, and modular accessors

The modular example in \examples/modular/lib/src\ now includes new schema and generated code for full-text search via an FTS5 virtual table (\search.drift\), a custom JSON-based type converter for user preferences (\preferences.dart\), and modular database accessors (\user\_queries.drift.dart\) that expose query methods like \findUsers\ and \follow\. These additions demonstrate advanced Drift features such as triggers for synchronizing FTS tables, mapped columns with custom converters, and modular accessor patterns for complex queries.

examples/modular/lib/src · high confidence

New AST classes for SQL schema definitions

The \sqlparser\ library now includes new AST node classes in \sqlparser/lib/src/ast/schema\ to model SQL schema structures, specifically \ColumnDefinition\ and \TableDefinition\. These additions introduce support for parsing and representing column constraints (such as \NOT NULL\, \PRIMARY KEY\, \UNIQUE\, \CHECK\, \DEFAULT\, \COLLATE\, \FOREIGN KEY\, \MAPPED BY\, and \GENERATED AS\) and table-level constraints including \KEY\ clauses (primary/unique keys with ordering and conflict handling), \CHECK\ constraints, and \FOREIGN KEY\ constraints with \DEFERRABLE\ and \INITIALLY DEFERRED\ support. This enables the parser to accurately represent complex \CREATE TABLE\ statements and their associated constraints in the abstract syntax tree.

sqlparser/lib/src/ast/schema · high confidence

New AST nodes for SQL expressions, aggregates, and windowing

The \sqlparser\ library now includes dedicated AST classes for a broad range of SQL expression types, enabling the parser to model and analyze complex queries. This change introduces nodes for aggregate and window functions (including \OVER\ clauses, window definitions, and frame specifications), standard SQL constructs like \CASE\, \CAST\, \BETWEEN\, \IN\, \IS\, \LIKE\ (with \ESCAPE\), and \COLLATE\, as well as literals (numeric, boolean, string, time constants), function calls, subqueries, \EXISTS\ checks, and variable placeholders. These additions provide the structural foundation for type resolution and semantic analysis of these expression forms.

sqlparser/lib/src/ast/expressions · high confidence

New AST nodes for SQL statements and schema operations

The \sqlparser\ library now includes a comprehensive set of new Abstract Syntax Tree (AST) nodes in \sqlparser/lib/src/ast/statements\ to represent a wide range of SQL operations. This adds structural support for CRUD statements (SELECT, INSERT, UPDATE, DELETE), including complex features like compound selects, upsert clauses, and RETURNING clauses. It also introduces nodes for schema management (CREATE/DROP/ALTER TABLE, CREATE INDEX, CREATE VIEW, CREATE TRIGGER), transaction control (BEGIN, COMMIT, ROLLBACK, SAVEPOINT), and maintenance commands (ANALYZE, REINDEX, VACUUM, PRAGMA). This expansion enables the parser to accurately model and analyze these SQL constructs for downstream tools like the Drift generator.

sqlparser/lib/src/ast/statements · high confidence

New CLI commands for schema analysis, migration generation, and drift 3 upgrade

The drift\_dev CLI now includes several new commands to help manage database schemas and migrations. The \analyze\ command allows users to lint and check their drift database code for errors. The \schema\ command provides subcommands to dump, generate utilities for, write versions of, and export the database schema. A new \make-migrations\ command automates the creation of migration steps and test files based on schema changes. Additionally, a hidden \upgrade\ command is available to assist in migrating projects to the upcoming drift version 3.

_drift\dev/lib/src/cli/commands · high confidence

New CLI commands for schema management and migration assistance

The Drift CLI now includes three new subcommands under the 'schema' namespace to streamline database schema handling. The 'schema dump' command exports the entire table structure of an existing SQLite database or Dart source into a JSON file, automatically inferring the filename based on the schema version. The 'schema export' command emits semicolon-separated SQL DDL statements for tables, supporting configurable SQL dialects. Additionally, the 'schema generate' and 'schema steps' commands help verify migrations by generating Dart code for schema versions (including optional data classes and companions) and creating step-by-step migration code between schema versions.

_drift\dev/lib/src/cli/commands/schema · high confidence

New Drift DevTools extension for database inspection and management

A new DevTools extension has been added to inspect and manage Drift databases directly from the IDE. Users can now view a list of tracked databases, browse their contents via an integrated DriftDbViewer, and validate that the runtime database schema matches the Dart definitions. The extension also provides controls to download the database file for external analysis and a button to clear all data and recreate the database structure.

_extras/drift\_devtools\extension/lib/src · high confidence

New Drift DevTools extension for database inspection and management

A new DevTools extension is now available, allowing developers to inspect and manage Drift databases directly from the Dart DevTools interface. This integration enables viewing the database schema (tables, views, indexes, and columns), executing custom SQL queries (SELECT, INSERT, UPDATE, DELETE), and subscribing to real-time table update streams. Additionally, users can download database files for export (supported on native platforms) and clear the database contents entirely. The extension is automatically registered when a database is created in non-release builds and exposes these capabilities via the \ext.drift.database\ service extension.

drift/lib/src/runtime/devtools · high confidence

New Drift encryption example for Flutter

A new example project has been added to demonstrate how to use the Drift database library with encrypted storage on Android, iOS, and macOS. The sample app uses \sqlcipher\_flutter\_libs\ to encrypt the database file and provides a simple UI for adding and viewing notes, serving as a reference implementation for integrating encrypted databases in Flutter applications.

examples/encryption · high confidence

New FTS5 and Geopoly SQLite extensions for full-text search and spatial data

Users can now leverage SQLite's FTS5 and Geopoly extensions directly within Drift queries. The new \fts5.dart\ file provides Dart helpers for full-text search, including \match\, \highlight\, \snippet\, \bm25\, and \rank\ methods on virtual tables, enabling efficient text search and relevance ranking. Additionally, \geopoly.dart\ introduces support for spatial data by defining the \GeopolyPolygonType\ and related classes (\GeopolyPolygon\, \GeopolyPolygonString\, \GeopolyPolygonBlob\) to handle polygon shapes stored in GEOPOLY virtual tables, allowing for spatial queries and data representation.

_future/drift\sqlite/lib/extensions · high confidence

New Flutter Web Worker example using WASM and shared workers

Added a new example demonstrating how to run Drift in a Flutter web application using WebAssembly and a shared web worker. The example includes platform-specific database connection logic that switches between native SQLite for mobile/desktop and a WASM-based executor for the web, along with build scripts to generate the required JavaScript worker files.

_examples/flutter\_web\_worker\example · high confidence

New Flutter example app with category management and todo editing

A new cross-platform Flutter example application has been added to demonstrate the Drift database library. This example features a home screen with a navigation drawer that allows users to manage categories, including picking custom colors and deleting categories. Users can view todo entries filtered by the active category, edit entry details such as description and due date via a dialog, and delete entries directly from the list. The app utilizes Riverpod for state management and Drift for reactive database operations.

examples/app/lib/screens/home · high confidence

New Flutter example app with search and backup features

A new cross-platform Flutter example application has been added to demonstrate the Drift database library. The app includes a home screen for managing todo entries with category support, a dedicated search page for querying todos across all categories, and backup/restore functionality accessible via the app bar. This example showcases integration with Riverpod for state management and GoRouter for navigation.

examples/app/lib/screens · high confidence

New MultiExecutor, Query Interceptors, and Nested Transaction Support

The runtime executor layer now supports delegating read and write operations to separate database connections via the new MultiExecutor API, allowing read queries to be distributed across a pool of read executors while writes go to a dedicated write executor. A new QueryInterceptor API enables wrapping executors to customize behavior, such as adding custom logging or retry logic. Additionally, the executor model now supports nested transactions and includes a DelayedStreamQueryStore to handle stream queries during asynchronous database connection initialization.

drift/lib/src/runtime/executor · high confidence

New RETURNING clause support for updates and deletes

The query builder now supports SQL RETURNING clauses for UPDATE and DELETE operations. Users can use \deleteReturning\ and \delete\'s \goAndReturn\ to retrieve the deleted rows, and \writeReturning\ on updates to get the rows after modification. This allows retrieving data in a single round-trip instead of separate read operations.

_drift/lib/src/runtime/query\builder/statements · high confidence

New SQL AST and visitor architecture in sqlparser

The \sqlparser\ library introduces a comprehensive Abstract Syntax Tree (AST) structure and a visitor pattern for parsing SQL statements. This change adds support for parsing a wide range of SQL constructs, including SELECT (with compound selects, CTEs, and window functions), INSERT/UPDATE/DELETE (with upsert clauses and RETURNING), CREATE/DROP/ALTER TABLE, transactions, and various expressions (literals, functions, aggregates, and variables). It also includes Drift-specific features like inline Dart support and declared statements, enabling more robust static analysis and code generation for SQL queries.

sqlparser/lib/src/ast · high confidence

New SQL analysis engine with type inference and reference resolution

The sqlparser library now includes a new analysis module that performs static analysis on SQL statements, including type inference, reference resolution, and linting. This enables better error detection for issues like unknown tables or columns, duplicate primary keys, and invalid function usage, while also supporting advanced features such as type inference for variables and expressions.

sqlparser/lib/src/analysis · high confidence

New SQL analysis pipeline for column resolution and linting

The SQL parser now includes a dedicated analysis phase in the \sqlparser\ library that validates SQL statements against the target SQLite version and schema. This new pipeline introduces a \ColumnResolver\ to accurately track available and result columns across complex queries (including CTEs, compound selects, and triggers), a \ReferenceResolver\ to validate column and table references with improved error messages, and a \LintingVisitor\ to enforce syntax rules such as strict table constraints, duplicate primary keys, and version-specific features like \MATERIALIZED\ hints or \ORDER BY\ in aggregates. Additionally, an \AstPreparingVisitor\ establishes proper scoping for subqueries and variables, ensuring that references are resolved correctly within their intended context.

sqlparser/lib/src/analysis/steps · high confidence

New SQL parser utility library for schema management and AST analysis

This change introduces a new \sqlparser/lib/utils\ package containing several utilities for working with SQL ASTs. It adds \SchemaBuffer\ to track and apply schema changes (CREATE, ALTER, DROP) across multiple statements, \ReferencedTablesVisitor\ and \UpdatedTablesVisitor\ to analyze which tables and views are read or written by queries, \NodeToText\ to serialize AST nodes back into SQL strings, and \CaseInsensitiveMap\ for case-insensitive key lookups.

sqlparser/lib/utils · high confidence

New SQL schema analysis model for tables, views, and references

The SQL parser now includes a dedicated schema analysis layer in \sqlparser/lib/src/analysis/schema\ that models database tables, views, and result sets for static analysis. This introduces structured classes for \Table\ and \View\ (including support for strict tables, generated columns, and rowid aliases), along with a scope-based reference resolution system (\ReferenceScope\) to manage table and column visibility in queries. A new \SchemaFromCreateTable\ utility reads table and view definitions from AST nodes, enabling the parser to resolve column types, handle \SELECT \*\ expansion, and support features like CTEs and subqueries with improved type inference.

sqlparser/lib/src/analysis/schema · high confidence

New SQL tokenizer implementation for the parser

The sqlparser library now includes a new tokenizer component (scanner.dart, token.dart, token\_source.dart) that handles lexical analysis of SQL source code. This implementation supports scanning various SQL tokens including operators, literals, identifiers, and specific variable formats like @variable, $variable, and :variable. It also handles comments, whitespace, and error recovery during tokenization. The tokenizer is designed to work with the parser's lookahead requirements and provides token streams for SQL parsing operations.

sqlparser/lib/src/reader/tokenizer · high confidence

New SQLite extension bindings for FTS5, JSON1, Geopoly, and native math functions

The \drift/lib/extensions\ directory now includes dedicated libraries for several SQLite extensions, providing first-class Dart support for full-text search, JSON manipulation, geospatial data, and native database functions. Users can now perform full-text searches on FTS5 virtual tables using \match\, \highlight\, \snippet\, \bm25\, and \rank\ methods. JSON1 capabilities are exposed via \json\, \jsonb\, \jsonArrayLength\, \jsonExtract\, \jsonEach\, \jsonTree\, and aggregate functions like \jsonGroupArray\ and \jsonbGroupArray\. Geospatial queries are supported through the \GeopolyPolygon\ type and related bindings. Additionally, \native.dart\ adds mathematical functions (\sqlPow\, \sqlSqrt\, trigonometric functions) and a case-sensitive string \contains\ method specifically for \NativeDatabase\ instances.

drift/lib/extensions · high confidence

New WASM storage backends and migration to OPFS

The WASM setup now supports the Origin Private File System (OPFS) as a primary storage backend, offering improved performance and reliability over the legacy IndexedDB approach. Users can migrate existing IndexedDB databases to OPFS using the new \moveIndexedDBDatabaseToOpfs\ utility. To ensure data consistency when multiple tabs access the same database, the system now utilizes navigator locks for OPFS operations and provides a \NavigatorLocksExecutor\ for IndexedDB-based storage. The internal worker protocol has been updated with versioning (up to v4) to support these changes, including better serialization of SQLite exceptions and configurable migration handling.

_drift/lib/src/web/wasm\setup · high confidence

New benchmarking infrastructure for performance tracking

The benchmarks library has been restructured to provide a comprehensive framework for measuring performance across the database layer. This update introduces a new base architecture supporting both synchronous and asynchronous benchmark execution, including warmup phases and configurable measurement durations. It adds specific benchmarks for key operations: prepared statement caching (comparing cached vs. non-cached performance), serial and batch key-value inserts, SQL parsing (specifically for Drift files), and low-level SQLite string binding. A new comparison emitter is also included, allowing users to track performance deltas against previous runs.

extras/benchmarks/lib · high confidence

New build system integration entry points

The drift\_dev package now exposes a dedicated integration layer for the Dart build system via the new \drift\_dev/lib/integrations/build.dart\ file. This file registers specific builders for the code generation pipeline, including a preprocess builder, a discover builder, an analyzer builder, and multiple variants of the main drift builder (monolithic shared part, monolithic part, and modular modes). It also includes a post-process builder to clean up temporary files such as \.temp.dart\ and module JSON files during the build process.

_drift\dev/lib/integrations · high confidence

New code generation infrastructure for drift3 and modular builds

The code generator has been refactored to support the new drift3 preview and modular build modes. This introduces dedicated writers for database classes, accessors, and schema versions, enabling features like modular accessors (one generated file per drift file), drift3-specific base classes and static schema entities, and optimized, compact schema version code for migrations. It also adds support for custom SQL function stubs and improved import alias management to prevent naming conflicts in generated code.

_drift\dev/lib/src/writer · high confidence

New cross-platform Flutter example app for Linux and Windows

A new cross-platform Flutter example application has been added, providing complete native runner implementations for Linux and Windows. The Linux entry point uses GTK to host the Flutter view, while the Windows entry point utilizes Win32 APIs with high-DPI support and dark mode theming. Both platforms include the necessary CMake build configurations, plugin registration, and asset installation logic to allow users to build and run the example on these desktop operating systems.

examples/app/linux, examples/app/windows · high confidence

New cross-platform Flutter example app with Drift database

The example application now includes a complete database layer using the Drift library, featuring \TodoEntries\ and \Categories\ tables with a schema version of 3. This implementation supports cross-platform execution via \drift\_flutter\, utilizing native SQLite on mobile/desktop and a WebAssembly-based backend for web. The database includes step-by-step migration logic to handle schema changes (such as adding the \dueDate\ column and triggers) and validates the schema at runtime. It also demonstrates advanced features like FTS5 full-text search via triggers, type converters for storing Flutter \Color\ objects, and Riverpod integration for state management.

examples/app/lib/database · high confidence

New drift example application with view support

Added a new example application in the \drift/example\ directory that demonstrates core drift features, including table definitions with auto-incrementing IDs, foreign key references, and computed generated columns. The example also showcases the use of database views (both DSL-defined and annotated) and provides a complete setup for creating an in-memory database, inserting data, and executing joined queries.

drift/example · high confidence

New drift3\_preview demo application

A new example application has been added at examples/app\_drift3, serving as a migration reference for upgrading to the upcoming major version of the Drift database library. This demo includes a complete Flutter project structure with platform-specific configurations for iOS, Android, and web, alongside a build configuration (build.yaml) that enables the drift3\_preview feature flag. It demonstrates the updated schema migration path through versioned JSON files (v1 through v4) and implements platform-specific database connection logic to support the new library version.

_examples/app\drift3 · high confidence

New drift\_dev CLI entry point and project configuration

The drift\_dev tool now exposes a structured command-line interface via a new \cli.dart\ entry point, registering commands for analyzing code, identifying databases, managing schemas, creating migrations, and upgrading. This CLI relies on a new \project.dart\ module to automatically detect and configure drift projects by reading build configurations and inferring Dart language versions, while \logging.dart\ provides standardized, ANSI-aware console output for user feedback.

_drift\dev/lib/src/cli · high confidence

New drift\_flutter package for Flutter database connections

A new drift\_flutter package has been introduced, providing the driftDatabase function to obtain a QueryExecutor for drift databases on Flutter apps. This function handles platform-specific setup, using a file in the application documents directory on native platforms and IndexedDB on the web, and can be passed directly to GeneratedDatabase constructors.

_drift\flutter/lib · high confidence

New internal APIs for step-by-step migrations and schema export

The drift library now exposes new internal utilities to support advanced migration and schema management workflows. A new \SchemaExporter\ class allows the DDL schema statements for a database to be collected and exported, enabling tools like \drift\_dev schema export\ to generate SQL. Additionally, a \VersionedSchema\ base class and \runMigrationSteps\ helper are introduced to facilitate step-by-step migrations, allowing developers to define and execute granular migration steps between schema versions while safely managing the database's user version. Supporting infrastructure includes \SchemaInstantiationHelper\ for verifying migrations against older schema versions and \ModularAccessor\ for modular code generation.

drift/lib/internal · high confidence

New isolate support for sharing databases across isolates

The library now includes new internal infrastructure to support sharing a single database connection across multiple Dart isolates. This change introduces a handshake mechanism that automatically detects whether message serialization is required and manages the lifecycle of isolate connections, including proper cleanup on exit. This enables the new capability to share any database across isolates, allowing for concurrent access patterns that were previously unsupported.

drift/lib/src · high confidence

New modular code generation and build pipeline

Drift now supports a modular generation mode that produces separate Dart libraries for each input file (\.drift\ or \.dart\) instead of the previous monolithic part-file approach. This is implemented via a new build pipeline in \drift\_dev/lib/src/backends/build\ that introduces dedicated builders: \PreprocessBuilder\ for extracting inline Dart expressions, \DriftDiscover\ for lightweight element discovery, \DriftAnalyzer\ for full analysis and serialization, and \DriftBuilder\ for code generation. The pipeline also adds a \fatal\_warnings\ build option to treat warnings as errors and a \preamble\ builder option to include custom code in generated outputs. Additionally, the system now respects the package's Dart language version for intermediate generated files, ensuring compatibility with features like generalized typedefs (Dart 2.13+).

_drift\dev/lib/src/backends/build · high confidence

New modular example demonstrating database accessors and manager-based queries

The examples/modular directory now includes a complete example project that showcases the modular code generation feature. This example demonstrates how to use generated database accessors (via \myAccessor\) for direct operations and how to leverage the manager API (e.g., \database.managers.posts\) for querying with references. It also includes configuration for the \drift\_dev:modular\ builder and tests to verify the modular code generation works correctly.

examples/modular · high confidence

New query builder components for advanced SQL clauses

The query builder now includes dedicated components for GROUP BY (with HAVING support), LIMIT (with OFFSET), WHERE, and ORDER BY (including random ordering and NULLS FIRST/LAST control). It also introduces support for subqueries, table-valued functions, and a comprehensive join system that now supports inner, left/right/full outer, and cross joins, with an option to exclude joined table columns from the result set.

_drift/lib/src/runtime/query\builder/components · high confidence

New tooling scripts for build, test, and dependency management

The repository now includes helper scripts in the tool directory to streamline development workflows. Users can run \generate\_all.sh\ to execute the build process via Melos, \test\_all.sh\ to run the test suite, and \upgrade\_all.sh\ to update dependencies across packages. Additionally, \docker\_test.sh\ provides a script to build and run integration tests in a Docker container, and \download\_sqlite\_wasm.dart\ automates the retrieval of SQLite WASM assets for releases.

tool · high confidence

New web worker example demonstrating real-time database synchronization

Added a new example in the \examples/web\_worker\_example\ directory that demonstrates how to use a shared web worker with the drift database library. The example configures the build system to compile the main entrypoint with dartdevc for debugging while compiling the worker with dart2js, enabling real-time data propagation across multiple browser tabs.

_examples/web\_worker\example · high confidence

Preview support for Drift 3 PostgreSQL backend

The \extras/drift\_postgres\ package now includes a preview implementation of the Drift 3 PostgreSQL backend in the \drift3\_preview\ directory. This adds a new \PostgresDialect\ that allows configuring JSON column storage to use \JSONB\ by default, and introduces support for PostgreSQL-specific types such as UUIDs, intervals, points, and date/time wrappers (\PgDateTime\, \PgDate\). It also enables array access expressions and provides the necessary session and type mapping infrastructure to interact with PostgreSQL databases using the Drift 3 API.

_extras/drift\_postgres/lib/src/drift3\preview · high confidence

Runtime schema validation and export via schema isolates

Drift now supports runtime schema validation and SQL export by executing code in a separate isolate. This allows the tool to capture the exact \CREATE\ statements for Dart-defined views and other elements that cannot be inferred statically, ensuring the serialized schema file matches the actual database structure. The new \SchemaIsolate\ service, along with \FindSchemaDifferences\ and verifier implementations for native and web backends, enables robust migration testing and schema verification against the real database state.

_drift\dev/lib/src/services/schema · high confidence

Runtime schema validation and migration testing APIs

The drift\_dev package now exposes APIs to verify database schemas at runtime and test migrations. On native platforms, the \validateDatabaseSchema\ extension method on \GeneratedDatabase\ checks that the actual database structure matches the generated code, while \SchemaVerifier\ provides utilities like \migrateAndValidate\ and \testWithDataIntegrity\ for testing migration logic. Web platforms are supported via a separate \WebSchemaVerifier\ and a platform-specific \validateDatabaseSchema\ extension. Both platforms allow configuring validation strictness (e.g., ignoring dropped tables or column constraints) via \ValidationOptions\ and support custom setup callbacks for database connections.

_drift\dev/lib/api · high confidence

Static analysis support for SQLite extensions

The sqlparser now provides static analysis for several SQLite built-in and optional extensions, including FTS5 (with fts5vocab), JSON1 (including jsonb functions in SQLite 3.51+), DBSTAT, Geopoly, RTree, Spellfix1, and the built-in math functions (SQLite 3.35+). It also adds support for the PowerSync SQLite core extension. This enables type inference, argument validation, and version-aware linting for these modules during SQL analysis.

sqlparser/lib/src/engine/module · high confidence

Support for advanced SQL clauses in the AST

The SQL parser now supports parsing and representing several advanced SQL clauses in its abstract syntax tree. Users can now utilize LIMIT clauses (including OFFSET), ORDER BY expressions with NULLS FIRST/LAST handling, Common Table Expressions (CTEs) with optional materialization hints, RETURNING clauses for INSERT/UPDATE/DELETE operations, and UPSERT logic (ON CONFLICT DO NOTHING/UPDATE). These additions expand the parser's capability to handle complex query structures beyond basic SELECT statements.

sqlparser/lib/src/ast/clauses · high confidence

Support for custom SQLite functions, existing Dart row types, and nested LIST queries

The query analysis engine now supports three major capabilities. First, users can define custom SQLite functions via Drift options, allowing the analyzer to infer argument and return types for these functions during static analysis. Second, queries can now be mapped to existing Dart row types (including records and named constructors) instead of always generating new classes, enabling seamless integration with pre-defined data structures. Third, the analyzer now supports nested queries using the LIST pseudofunction, allowing users to fetch related data in a single query while the engine handles the necessary variable binding and result collection at runtime.

_drift\dev/lib/src/analysis/resolver/queries · high confidence

Removals

Example app source code removed

The example application code located in the drift\_sqflite/example directory has been deleted. Users seeking a complete cross-platform example are directed to the main drift repository's examples/app directory instead.

_drift\sqflite/example · high confidence

Architecture

Introduces new executor helper interfaces and classes for transaction and result handling

The drift runtime now includes new helper files (\delegates.dart\, \engines.dart\, \results.dart\) that define the core abstractions for database execution. \delegates.dart\ introduces \DatabaseDelegate\, \QueryDelegate\, and \TransactionDelegate\ (including \NoTransactionDelegate\ for statement-based transactions and \SupportedTransactionDelegate\ for native support), allowing database implementations to plug in their own transaction and query execution logic. \engines.dart\ provides the base \\_BaseExecutor\ and \\_TransactionExecutor\ classes that wrap these delegates, handling synchronization, logging, and state management. \results.dart\ defines the \QueryResult\ class to standardize how select statement results (column names and rows) are returned and converted to maps. These changes refactor the internal executor architecture to be more modular and support features like nested transactions and external transaction management.

drift/lib/src/runtime/executor/helpers · high confidence

Refactored parser into state-based architecture with error recovery

The SQL parser in \sqlparser/lib/src/reader\ has been restructured to use a \ParserState\ class and extension methods, replacing the previous singleton-based approach. This change introduces a dedicated error recovery mechanism (\recovery.dart\) that allows the parser to skip to the next semicolon or comma when encountering syntax errors, enabling better resilience and the ability to parse subsequent statements even if one fails. Additionally, a \SyntacticEntity\ interface was added to standardize how source spans and positions are tracked for tokens and AST nodes, improving the accuracy of error reporting and IDE features.

sqlparser/lib/src/reader · high confidence

Behavioural changes

7 commits (1 fix) modifying extras/assets

A change to existing behaviour in extras/assets — 7 commits (1 fix), 1 file.

extras/assets · medium confidence · unverified

Android example app migrated to Flutter

The Android example application has been recreated as a Flutter app, replacing the previous native implementation. This change updates the Android project structure to use the Flutter embedding (V2), with the main activity extending FlutterActivity, and configures the build system to use Gradle 8.14. Users running this example will now see a Flutter-based UI on Android instead of the prior native Android interface.

examples/app/android · high confidence

CLI exits with non-zero code on errors

The drift\_dev command-line tool now correctly exits with a non-zero status code when a command fails, instead of exiting with code 0. This ensures that scripts and build pipelines can reliably detect when drift\_dev encounters an error.

_drift\dev/bin · high confidence

Deprecated legacy web worker support in favor of new APIs

The legacy web worker implementation in \drift/lib/web/worker.dart\ is now marked as deprecated and enters a bugfix-only mode, urging users to migrate to the new web APIs (specifically \package:drift/wasm.dart\). While the file remains present to allow existing dedicated, shared, and \dedicatedInShared\ worker topologies to continue functioning, it is no longer the recommended path for new web integrations.

drift/lib/web · high confidence

Drift 3 preview example with generated code and dialect options

The example in \future/drift3/example\ now demonstrates the Drift 3 preview workflow, including a new \main.g.dart\ file that contains generated table definitions, data classes, and companion objects for the \TodoCategories\ table. The generated code utilizes the new \SqlType\ system for type resolution and includes specific SQLite dialect options (strict tables, text-based date times, and binary JSON) configured directly on the database class.

future/drift3/example · high confidence

Drift 3.0 preview introduces major API and behavioral changes

The drift 3.0 preview (drift3\_preview) introduces significant changes to the database API. Connection management is refactored, replacing \QueryExecutor\ and \DriftConnection\ with \DriftSession\ for opened connections and \DriftConnection\ for unopened ones, and removing \package:drift/isolate.dart\ in favor of \sqliteConnectionPool\ from \drift\_sqlite/native.dart\. The query builder now supports different dialects fully, with each dialect responsible for SQL generation, and \CustomSqlType\ is replaced by \SqlType\ and \PhysicalSqlType\. Batches now report the output of statements. The Drift manager is now a standalone package, \drift\_manager\. \TransactionOptions\ are added to request read-only transactions. \Selectable.watch\ now returns a \QueryStream\ that can track which tables it watches. DML statements now support \RETURNING\ partial rows, and \FROM\ can be added to \UpdateStatement\.

_drift/lib/src/drift3\preview/src · high confidence

Drift manager APIs moved to standalone package with bulk returning support

The drift manager APIs have been extracted into a new standalone \drift\_manager\ package. This update adds a \returning\ parameter to \bulkCreate\ and \bulkUpdate\ operations, allowing users to retrieve the affected rows directly from these bulk operations.

_future/drift\manager · high confidence

Expose drift3 internal runtime helpers via re-exports

The \future/drift3/lib/internal\ directory now provides re-export wrappers for internal schema and dialect utilities (specifically \common\_dialect\, \export\_schema\, and \versioned\_schema\) sourced from the \drift/src/drift3\_preview\ package. This change makes these internal implementation details accessible through the \future/drift3\ package path, likely to support the ongoing porting of schema export runtime helpers and query generation logic for the drift3 preview.

future/drift3/lib/internal · high confidence

Generated serialization support for analysis configuration and dialects

The build runner has regenerated the JSON serialization code for the analysis subsystem, adding \dialect.g.dart\, \options.g.dart\, and \preprocess\_drift.g.dart\. This enables the \DriftOptions\, \Drift3SqliteDialect\, and \DriftPreprocessorResult\ models to be serialized to and deserialized from JSON, which is required for the new multi-dialect generation options, dialect-specific settings (such as SQLite modules and version), and the separate analyzer feature.

_drift\dev/lib/src/generated/analysis · high confidence

Improved SQL column name handling and custom row class validation

The code generator now produces more robust Dart identifiers for SQL columns by stripping illegal characters, removing leading digits, converting names to camelCase, and appending a \$\ suffix to reserved Dart keywords to prevent syntax errors. Additionally, the system enforces stricter validation for custom row classes used with insertable generation, requiring that all columns have corresponding getters in the target class, and improves support for extending existing data classes via the \@DataClassName\ annotation.

_drift\dev/lib/src/analysis/resolver/shared · high confidence

Improved transaction locking and prepared statement caching in SQLite backend

The SQLite database delegate now starts transactions with \BEGIN IMMEDIATE\ to acquire write locks earlier, reducing contention when multiple connections access the same database. Additionally, prepared statements can now be cached to improve performance, controlled by the \cachePreparedStatements\ option, while explain statements are explicitly excluded from this cache. The underlying \sqlite3\ package has been upgraded to version 3.x, which allows the removal of the deprecated \DatabaseTracker\ workaround for hot-restart deadlocks, as native finalizers now handle database closure correctly.

drift/lib/src/sqlite3 · high confidence

Integration test database schema updated to support multi-dialect generation

The integration test database definition and its generated code have been regenerated to support multiple SQL dialects (SQLite, PostgreSQL, and MariaDB). This includes dialect-specific primary key constraints in the generated schema, conditional logic in the test database methods to handle dialect-specific insert modes (e.g., \insertOrReplace\ vs \insertOrIgnore\), and updated query definitions compatible across these databases.

_extras/integration\_tests/drift\testcases/lib/database · high confidence

Migrate analysis backend to support analyzer 7.x APIs

The drift analysis backend has been updated to be compatible with the analyzer 7.x package. This change involves migrating internal implementation details to use the new element2 APIs and adjusting how the backend interacts with the Dart analysis context, ensuring that type resolution and expression evaluation continue to function correctly with the latest analyzer versions.

_drift\dev/lib/src/backends · high confidence

Migrate built\_value example to modular builder architecture

The built\_value example has been updated to use Drift's new modular builder system. The build configuration now explicitly enables the \drift\_dev:modular\ and \drift\_dev:analyzer\ builders while disabling the legacy \drift\_dev\ builder, ensuring that generated database classes (such as \$Database\ and \$DatabaseManager\) and table managers (like \$UsersTableManager\) are structured for better modularity and access control.

_examples/with\_built\value · high confidence

Migrated web backend to modern JavaScript interop and new storage APIs

The web database implementation has been rewritten to use the new \dart:js\_interop\ and \package:web\ APIs, replacing the legacy \dart:html\ and \package:js\ dependencies. This change introduces a new \DriftWebStorage\ abstraction that supports persisting data via IndexedDB (with automatic migration from local storage) or in-memory storage, and updates the underlying \sql.js\ wrapper to handle BigInt arguments correctly. Additionally, the web layer now supports cross-tab synchronization via the Broadcast Channel API and allows running multiple SQL statements in a single batch for improved performance.

drift/lib/src/web · high confidence

New Dart-based analysis resolver for tables, views, and accessors

The code generation engine now includes a new analysis resolver located in \drift\_dev/lib/src/analysis/resolver/dart\ that parses Dart-defined database structures directly from the AST. This new component introduces dedicated resolvers for \DartTableResolver\, \DartViewResolver\, \DartAccessorResolver\, and \DartIndexResolver\, alongside helper utilities in \helper.dart\ and column parsing logic in \column.dart\. This shift enables the tool to analyze and generate code for Dart-defined tables, views, accessors, and indexes using the new analyzer infrastructure, replacing or augmenting previous parsing methods.

_drift\dev/lib/src/analysis/resolver/dart · high confidence

New SQL parser integration with drift-specific linting and type mapping

The drift analyzer now integrates the \sqlparser\ package to analyze SQL statements, introducing a new \DriftSqlLinter\ that provides drift-specific checks. This includes lints for comparing \DateTime\ values (warning against lexicographical comparisons and suggesting \unixepoch()\), validating enum type literals (checking for negative values or out-of-range indices), and ensuring Dart placeholder default values are used only with expressions. A new \TypeMapping\ component bridges drift's internal type representation with the SQL parser, correctly handling drift-specific types like \DriftAny\, custom column types, type converters, and FTS5 virtual tables.

_drift\dev/lib/src/analysis/resolver/drift/sqlparser · high confidence

New SQLite connection implementation for drift3\_preview

The \future/drift\_sqlite\ package now includes a new SQLite connection layer targeting the \drift3\_preview\ API. This change introduces \SqliteConnection\ for synchronous database access and \SqlitePoolSession\ for connection pooling, along with supporting files for native SQL functions (like \regexp\ and \drift\_contains\) and shared schema version management. This replaces the previous connection implementation to align with the upcoming Drift 3 preview features.

_future/drift\sqlite/lib/src/connection · high confidence

New analysis backend and preprocessor for drift files

The code generation pipeline now uses a new analysis backend that separates the parsing of \.drift\ files from the final code generation. A new preprocessor step extracts inline Dart expressions from drift files into a temporary helper Dart file, allowing the analyzer to resolve types for expressions like type converters. The backend provides an abstraction for reading files and resolving Dart libraries, while new serializer and dialect modules handle the persistence of analysis results and multi-dialect support (SQLite, MariaDB, Postgres, DuckDB). This change enables more robust static analysis of drift files and supports features like custom result class names and Dart views.

_drift\dev/lib/src/analysis · high confidence

New analysis result model for code generation

The internal data structures used to represent database schemas, tables, views, queries, and columns have been replaced with a new set of serializable classes in the \drift\_dev/lib/src/analysis/results\ directory. This change introduces a new intermediate representation for analysis results, enabling better serialization, modular code generation, and support for advanced features like Dart views, custom parent classes, and explicit import management for generated code.

_drift\dev/lib/src/analysis/results · high confidence

New analyzer implementation for drift code generation

The drift code generator now uses a new internal analyzer to resolve and validate database schemas, replacing the previous analysis logic. This change introduces new files in the resolver module (discover.dart, file\_analysis.dart, intermediate\_state.dart, resolver.dart) that handle the discovery of Dart tables, views, and indices, as well as the analysis of SQL queries and drift files. Users benefit from improved accuracy in detecting errors, better support for modular projects, and more robust handling of complex references and circular dependencies during code generation.

_drift\dev/lib/src/analysis/resolver · high confidence

New drift file analysis resolver for tables, queries, views, and triggers

The drift file analysis pipeline now uses a new resolver implementation located in \drift\_dev/lib/src/analysis/resolver/drift/\. This change introduces dedicated resolvers for tables (\DriftTableResolver\), queries (\DriftQueryResolver\), views (\DriftViewResolver\), triggers (\DriftTriggerResolver\), and indices (\DriftIndexResolver\), along with a shared \DriftElementResolver\ for resolving Dart types and custom column types. For users, this means that drift files (\.drift\) are now analyzed using this new engine, which handles the resolution of SQL statements, Dart type references, and custom constraints within these files.

_drift\dev/lib/src/analysis/resolver/drift · high confidence

New internal utility library for async operations and lazy database handling

The drift library now includes a new internal utilities package under \drift/lib/src/utils\ containing five new files: \async.dart\ (providing \mapAsyncAndAwait\ for efficient synchronous/asynchronous mapping), \async\_map.dart\ (implementing \asyncMapPerSubscription\ to preserve broadcast stream behavior), \lazy\_database.dart\ (introducing the \LazyDatabase\ executor for deferred database connection opening), \single\_transformer.dart\ (offering stream transformers to extract single elements from list streams with improved stack traces), and \synchronized.dart\ (providing a lightweight \Lock\ class for async synchronization that handles \fake\_async\ test zones correctly). These utilities support internal drift mechanisms for better performance, error handling, and test compatibility.

drift/lib/src/utils · high confidence

New modular analysis driver with caching and import resolution

The analysis driver has been replaced with a new implementation that supports modular, isolated analysis of drift elements. This change introduces a new \DriftAnalysisDriver\ that operates in three stages: discovery, element analysis, and file analysis, allowing elements to be analyzed in isolation where possible. A new \DriftAnalysisCache\ provides in-memory caching of analysis results and handles file state changes, while the driver now correctly resolves imports across Dart files and drift files, including transitive imports. Error reporting has been unified through a new \DriftAnalysisError\ class that maps spans from both Dart AST and SQL parsing contexts. This enables more efficient incremental analysis and better support for modular code generation.

_drift\dev/lib/src/analysis/driver · high confidence

New query code generation engine for drift 3

The query code generation logic has been rewritten to support the drift 3 preview mode, introducing new writers for query handling, result sets, and SQL text generation. This change enables expanded star columns, support for LIST() queries, nested result queries, and custom column types, while also adding multi-dialect support for MariaDB and PostgreSQL. Users will see generated code that returns Iterable instead of List for query results, improved handling of type converters in views and nested queries, and stricter null-awareness in generated constructors.

_drift\dev/lib/src/writer/queries · high confidence

New remote database communication protocol and client/server implementation

The remote database layer has been rewritten to support sharing a single database instance across multiple isolates and web workers. This change introduces a new serialization protocol (with a specific variant for Web/JS objects) to transport SQL queries, results, and errors between client and server sides. Key behavioral updates include the ability to run database operations in a 'single-client mode' to optimize resource usage, support for nested transactions, and improved error handling with proper stack traces across isolate boundaries. Users connecting remotely will now interact with a new \DriftClient\ and \DriftServer\ API that manages these cross-isolate connections.

drift/lib/src/remote · high confidence

New schema verification helpers for drift 3 preview

The \schema\_verifier\ directory now contains a complete set of internal utilities for validating database schemas in the \drift3\_preview\ package. This includes a \SchemaVerifier\ class to assist with migration testing, a \VerifySelf\ extension on \GeneratedDatabase\ to validate the runtime schema against generated expectations, and core logic in \find\_differences.dart\ to compare syntactic schemas using the \sqlparser\ library. These changes support the migration of the self-schema verifier and test helpers to the new drift 3 architecture.

_future/drift\_sqlite/lib/src/schema\verifier · high confidence

New table and view code generation architecture

The code generator for tables and views has been restructured into dedicated writers (DataClassWriter, TableWriter, UpdateCompanionWriter, ViewWriter). This change introduces support for drift3's new mapping API (createMapperFromPositions), enables configurable data class options like required constructor arguments and custom parent classes, and improves handling of type converters, JSON serialization, and view aliases.

_drift\dev/lib/src/writer/tables · high confidence

New type inference engine with improved nullability and join analysis

The SQL parser now uses a new type inference system that provides more accurate nullability detection for SQL expressions. This change ensures that columns from LEFT OUTER joins are correctly marked as nullable, while inner joins remain non-nullable. It also improves type resolution for aggregate functions, subqueries, and various SQL functions like COALESCE, IFNULL, and CAST, fixing previous issues where these were incorrectly assumed to be non-nullable. The new engine also supports type hints for specific data types like booleans, dates, and large integers.

sqlparser/lib/src/analysis/types · high confidence

New utility helpers for code generation and analysis

Added several new utility files in drift\_dev/lib/src/utils to support the code generator: dartfmt.dart provides a helper to format Dart code with a specific language version; entity\_reference\_sorter.dart introduces topological sorting of DriftElements and a CircularReferenceException for handling reference cycles; header.dart defines a standard generated-file header comment; options\_reader.dart centralizes reading DriftOptions from build configuration; string\_escaper.dart adds utilities for escaping Dart strings and stripping leading numerics from class names; and type\_utils.dart provides helpers to identify Drift-specific types (Columns, Expressions) and access type metadata. These utilities support the broader generator refactoring and analyzer migration.

_drift\dev/lib/src/utils · high confidence

Platform-specific database connection and schema validation for the example app

The example app now uses conditional exports to provide platform-specific database connection logic, supporting native (via FFI), web (via WASM), and unsupported platforms. This includes runtime schema validation that works across these platforms, ensuring developers get early warnings if table definitions change without corresponding migrations.

examples/app/lib/database/connection · high confidence

Ported drift3 database example with schema version 4 and migration steps

The database layer in the \app\_drift3\ example has been updated to use the \drift3\_preview\ package, introducing a schema version bump to 4. This change includes new migration steps (specifically \from3To4\) to handle the upgrade, adds support for FTS5 full-text search via the \text\_entries\ virtual table and associated triggers, and implements a \search\ method for querying todo entries. The database now also validates its schema at runtime and initializes default data on first launch.

_examples/app\drift3/lib/database · high confidence

Preview of drift\_flutter for drift 3 with updated web and native options

This release introduces a preview version of the drift\_flutter package designed to work with the upcoming drift 3 preview. For users, the primary change is the removal of the \shareAcrossIsolates\, \isolateDebugLog\, and \isolateSetup\ options from \DriftNativeOptions\, simplifying native database configuration. On the web, the package now utilizes \package:sqlite3\_web\ types within \DriftWebOptions\, providing a \WasmDatabaseResult\ callback to inform users about the chosen database implementation and missing browser features. The package also includes a new example and tests demonstrating the integration with the \drift3\_preview\ dialect.

_future/drift3\_flutter\preview · high confidence

Recreated example app with full cross-platform support and new build tooling

The example application has been recreated to support Android, iOS, macOS, Linux, Windows, and Web platforms. It now includes a custom build configuration (build.yaml) that sets up the drift\_dev code generator for SQLite 3.38 with FTS5, configures the web worker compilation via build\_web\_compilers, and adds a custom builder to copy the compiled JS worker to the web directory. The app also integrates with Flutter DevTools for database inspection and includes documentation on running build\_runner and managing schema migrations.

examples/app · high confidence

Redesigned runtime API with new connection and batch abstractions

The runtime API in \drift/lib/src/runtime/api\ has been restructured to introduce a dedicated \DatabaseConnection\ class that explicitly manages the underlying \QueryExecutor\ and \StreamQueryStore\, replacing the previous implicit connection handling. A new \Batch\ class has been added to allow collecting multiple SQL statements (inserts, updates, deletes) into a single efficient execution, supporting bulk operations and \INSERT FROM SELECT\ patterns. The \DatabaseConnectionUser\ base class now wraps this connection, providing a unified interface for database operations, DAOs (\DatabaseAccessor\), and generated databases (\GeneratedDatabase\). Additionally, platform-specific implementations for \computeWithDatabase\ have been added to enable running database computations in isolates on native platforms while falling back to the current context on web.

drift/lib/src/runtime/api · high confidence

Refactored JSON type converters and added binary JSONB support

The \TypeConverter.json\ method is now deprecated because it caused double JSON encoding when serializing data classes to JSON; users should migrate to the new \TypeConverter.json2\ method which fixes this behavior. Additionally, a new \TypeConverter.jsonb\ static method has been added to support storing complex Dart objects in binary columns using SQLite's native JSONB representation, which is more efficient for queries using JSON operators. The underlying implementation has been decoupled, introducing \JsonTypeConverter2\ to handle the distinction between SQL storage types and JSON serialization types.

drift/lib/src/runtime/types · high confidence

Refactored code generation utilities for column constraints, equality, and string representation

The code generation logic in drift\_dev has been reorganized into dedicated utility files to improve how generated Dart code handles column constraints, object equality, and debugging output. The new column\_constraints.dart module now generates dialect-specific SQL constraints (such as auto-increment syntax for MariaDB vs. SQLite and boolean check constraints) and supports new features like deferred foreign keys. Additionally, hash\_and\_equals.dart introduces specialized handling for blob/list fields in equality checks, override\_toString.dart ensures proper escaping of property names containing special characters like '$', and memoized\_getter.dart standardizes the generation of lazy initialization getters using nnbd-compatible 'late final' syntax.

_drift\dev/lib/src/writer/utils · high confidence

Refactored schema reflection internals with dialect-aware SQL generation

The schema reflection layer in the query builder has been restructured to support multi-dialect SQL generation and improved type safety. Column definitions now explicitly handle dialect-specific escaping (e.g., backticks for MariaDB) and support generated columns (VIRTUAL/STORED) and custom constraints. Table and view metadata classes (TableInfo, ViewInfo) now expose dialect-specific SQL statements via maps rather than single strings, and unique keys can now handle multiple columns. These changes ensure that schema introspection and SQL generation are consistent across SQLite, PostgreSQL, and MariaDB.

_drift/lib/src/runtime/query\builder/schema · high confidence

Runtime API overhaul: cancellation support, explicit value handling, and new exception types

The runtime library has been restructured to improve reliability and control. Asynchronous operations now support explicit cancellation via a new \CancellationToken\ and \CancellationException\, allowing users to cleanly abort long-running tasks. Data insertion and updates now use a \Value\ wrapper with an \absentIfNull\ constructor, giving precise control over whether null fields are treated as absent (using defaults) or explicitly null. Additionally, new exception types like \InvalidDataException\ and \DriftWrappedException\ provide clearer error reporting for data integrity issues and underlying database errors.

drift/lib/src/runtime · high confidence

Runtime query builder and migration API overhaul

The runtime query builder has been restructured into a new modular architecture, introducing a \GenerationContext\ to manage SQL generation state and helper extensions for writing result sets and handling dialect-specific SQL. This change adds support for multiple database dialects (SQLite, PostgreSQL, DuckDB, and MariaDB) with specific type mappings and identifier escaping rules. A new \Migrator\ class and \MigrationStrategy\ provide a step-by-step API for schema migrations, including methods to create, drop, and alter tables, views, and indexes. Additionally, convenience extensions on tables and views now expose utility methods such as \all()\, \count()\, \insertAll\, \deleteAll\, and \insertReturningOrNull\ to simplify common data operations.

_drift/lib/src/runtime/query\builder · high confidence

Simplified web worker setup for drift in the Flutter example

The flutter\_web\_worker\_example now provides a streamlined entry point for running drift in a web worker. The new worker.dart file uses the drift wasm package's workerMainForOpen API, allowing developers to easily initialize the database and register custom functions (such as 'my\_function') within the worker context. The example's index.html has been updated to load the application, and a symlink ensures the required sqlite3.wasm binary is available.

_examples/flutter\_web\_worker\example/web · high confidence

Support for expanding star parameters in SQL function calls

The analysis engine now correctly handles the expansion of the star (\) parameter when used within SQL function invocations. When a star parameter is encountered, the system resolves it to all available columns in the current scope, while specifically excluding the function call itself from the expansion to prevent self-referential errors (e.g., in expressions like \SELECT SUM(\)\). This logic is implemented via a new \ExpandParameters\ extension on \SqlInvocation\.

sqlparser/lib/src/analysis/utils · high confidence

Updated migration example to use step-by-step migration API

The migrations example has been updated to demonstrate the new step-by-step migration API. The database schema now tracks 11 versions, and the migration strategy uses \VersionedSchema.runMigrationSteps\ with explicit step definitions (e.g., \from1To2\, \from2To3\) instead of legacy alter-table blocks. The example also includes runtime schema validation via \validateDatabaseSchema\ and demonstrates adding columns, tables, views, and constraints across multiple schema versions.

_examples/migrations\example · high confidence

Web worker example updated to use WASM-based database

The web worker example has been updated to use the WASM-based database implementation. The main entry point now initializes a WasmDatabase with a remote database configuration, and the worker script uses WasmDatabase.workerMainForOpen to set up the database in a web worker context. The example includes a simple UI for adding and displaying database entries, demonstrating the new WASM-based approach for web workers.

_examples/web\_worker\example/web · high confidence

Fixes

Introduce graph-based type inference with nullability propagation

The SQL parser's type analysis now uses a directed graph to resolve types and propagate nullability across expressions. This change introduces new relationship classes (such as \NullableIfSomeOtherIs\, \CopyTypeFrom\, and \CopyEncapsulating\) and a \TypeGraph\ engine that prioritizes resolving types with known nullability first. This ensures that nullability is correctly inferred for complex expressions, including handling nullable results from \LEFT OUTER\ joins, \COALESCE\, \IFNULL\, and aggregate functions like \SUM\.

sqlparser/lib/src/analysis/types/graph · high confidence

Test coverage

Add SQL parser benchmarks for drift file parsing and tokenization; Add Web/WASM integration test database schema; Add web Wasm integration test harness; Added CLI integration tests for migration generation; Added DDC test runner utility for drift/tool; Added Web Wasm integration test infrastructure; Added analysis tests for SQL reference resolution; Added comprehensive parser tests for SQL and Drift file syntax; Added comprehensive test coverage for the Manager API; Added comprehensive test suite for Drift Postgres integration; Added comprehensive test suite for database operations; Added comprehensive tests for database type handling and converters; Added database migration and schema tests for the example app; Added generated test fixtures for custom types and complex table schemas; Added generated test fixtures for drift3\_preview; Added integration tests for DevTools schema validation; Added integration tests for Web WASM database operations; Added integration tests for drift3\_preview; Added integration tests for legacy web database storage; Added migration integrity tests for the drift example; Added sample data and test exports for drift integration tests; Added scanner unit tests; Added test coverage for FFI platform features; Added test coverage for SQL parser utility functions; Added test coverage for SQLite extension modules; Added test coverage for drift3\_preview database operations; Added test coverage for new SQL SELECT parsing capabilities; Added test coverage for the new drift analysis backend; Added test utilities for drift3\_preview; Added test utilities for emulating Drift builds; Added test utilities for the drift3\_preview database layer; Added tests for CLI schema dump, export, and steps commands; Added tests for Dart code generation and AST annotation; Added tests for Drift 3 preview boolean type handling in Postgres dialect; Added tests for FTS5, JSON, and InsertMode features in Drift 3; Added tests for FTS5, JSON1, Geopoly, and native extension functions; Added tests for SQL analysis error reporting; Added tests for SQL autocomplete engine; Added tests for SQL parser engine behavior and error handling; Added tests for SQL schema analysis and column resolution; Added tests for code generation utilities; Added tests for database expression generation; Added tests for drift utility components; Added tests for drift3 DevTools integration; Added tests for drift3 query builder statements; Added tests for drift3 type handling and conversion; Added tests for drift\_flutter database path, isolate, and stream closing behavior; Added tests for entity reference sorting, options reading, and string escaping; Added tests for multi-executor, delegated database, and query interceptor engines; Added tests for query and SQL writer components; Added tests for query builder expressions in drift3\_preview; Added tests for schema validation, serialization, and stream update rule detection; Added tests for the Drift 3 migration tool; Added tests for the build backend and builder; Added tests for the code generation writer components; Added tests for the new Dart analysis resolver; Added tests for the new drift file and Dart library analysis resolver; Added tests for the new types2 type inference engine; Added tests for the query analysis resolver; Added tests for type converter linting in SQL parser; Added unit tests for database statement generation and execution; Added web platform tests for BigInt support, binary string encoding, storage migration, and WASM concurrency; Expanded integration test coverage for drift database operations; Expanded test coverage for Drift isolate, remote, and serialization features; Expanded test coverage for the new drift file analyzer; New FFI integration test project for Drift on Flutter; Restructured integration test suite for database implementations; Restructured test utilities for platform-specific database connections; Updated migration example schema tests to cover 11 database versions.

Dependencies

Upgrade to Dart 3.10 SDK and Flutter 3.35

The drift core packages (drift, drift\_dev, drift\_flutter, drift\_sqflite) and the documentation website have been updated to require the Dart 3.10 SDK and Flutter 3.35. This upgrade ensures compatibility with the latest Dart language features and Flutter tooling, and includes corresponding updates to the example applications and workspace configuration.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 59 → 69 (+10.2)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 95 → 85 (-10.0)
  • Architecture 99 → 94 (-4.7)
  • Maturity 61 → 61 (+0.4)
  • Readiness 55 → 79 (+23.8)
  • Security 48 → 65 (+16.9)
  • Domain Modelling 100 → 100 (+0.0)

Resolved (43)

  • Change coupling: cache.dart ↔ resolver.dart (drift_dev/lib/src/analysis/driver/cache.dart)
  • Change coupling: intermediate_state.dart ↔ serializer.dart (drift_dev/lib/src/analysis/resolver/intermediate_state.dart)
  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 23 more

New (534)

  • AccessorWriter.write (cognitive 16) (drift_dev/lib/src/writer/drift_accessor_writer.dart)
  • AstPreparingVisitor.visitSelectStatement (cognitive 17) (sqlparser/lib/src/analysis/steps/prepare_ast.dart)
  • BaseElementResolver.resolveTableReferences (cognitive 16) (drift_dev/lib/src/analysis/resolver/resolver.dart)
  • Boundary-crossing change coupling: protocol.dart ↔ main.dart (drift/lib/src/web/wasm_setup/protocol.dart)
  • Change coupling: isolate.dart ↔ server_impl.dart (drift/lib/src/isolate.dart)
  • ClassTooLong: ColumnParser (drift_dev/lib/src/analysis/resolver/dart/column.dart)
  • ClassTooLong: ColumnResolver (sqlparser/lib/src/analysis/steps/column_resolver.dart)
  • ClassTooLong: ElementDeserializer (drift_dev/lib/src/analysis/serializer.dart)
  • ClassTooLong: EqualityEnforcingVisitor (sqlparser/lib/src/utils/ast_equality.dart)
  • ClassTooLong: LintingVisitor (sqlparser/lib/src/analysis/steps/linting_visitor.dart)
  • ClassTooLong: QueryAnalyzer (drift_dev/lib/src/analysis/resolver/queries/query_analyzer.dart)
  • ClassTooLong: TypeResolver (sqlparser/lib/src/analysis/types/resolving_visitor.dart)
  • ColumnParser._driftConstraintsFromCustomConstraints (cognitive 21) (drift_dev/lib/src/analysis/resolver/dart/column.dart)
  • ColumnParser._driftConstraintsFromCustomConstraints (cyclomatic 16) (drift_dev/lib/src/analysis/resolver/dart/column.dart)
  • ColumnParser._tryExtractingStartMethod (cognitive 38) (drift_dev/lib/src/analysis/resolver/dart/column.dart)
  • ColumnParser._tryExtractingStartMethod (cyclomatic 17) (drift_dev/lib/src/analysis/resolver/dart/column.dart)
  • ColumnParser.parse (cognitive 113) (drift_dev/lib/src/analysis/resolver/dart/column.dart)
  • ColumnParser.parse (cyclomatic 65) (drift_dev/lib/src/analysis/resolver/dart/column.dart)
  • ColumnResolver._handle (cognitive 28) (sqlparser/lib/src/analysis/steps/column_resolver.dart)
  • ColumnResolver._handle (cyclomatic 19) (sqlparser/lib/src/analysis/steps/column_resolver.dart)
  • …and 514 more

Changes since last survey

  • 61 commits — 56 feature/other, 5 fixes

By area

  • drift/lib — 12 commits
  • drift_dev/lib — 10 commits
  • future/drift3 — 7 commits
  • .github/workflows — 5 commits
  • docs/content — 5 commits
  • docs/lib — 3 commits
  • drift/test — 3 commits
  • .github/dependabot.yml — 2 commits
  • drift/CHANGELOG.md — 2 commits
  • examples/app_drift3 — 2 commits
  • (repo) — 1 commit
  • (root) — 1 commit
  • drift_dev/CHANGELOG.md — 1 commit
  • drift_dev/test — 1 commit
  • examples/app — 1 commit
  • extras/assets — 1 commit
  • extras/drift_devtools_extension — 1 commit
  • extras/integration_tests — 1 commit
  • future/drift_sqlite — 1 commit
  • sqlparser/lib — 1 commit

Notable commits

  • fix: Fix CI failures
  • fix: Fix a few tokenizer errors
  • fix: Fix dependency version in drift3 preview
  • fix: Fix new analysis warnings in Dart 3.13
  • fix: Fix source code tests
  • change: Add FTS5 Dart helpers: match, highlight, snippet, bm25 and rank (#3843) (#3855)
  • change: Add dependabot
  • change: Also remove export
  • change: Bump actions/cache from 3 to 6
  • change: Bump actions/checkout from 4 to 7
  • change: Bump nanasess/setup-chromedriver from 2 to 3
  • change: Bump nwtgck/actions-netlify from 3 to 4
  • change: Close receive port for failed schema isolate
  • change: Document DriftIsolates via IsolateNameServer
  • change: Don 't special case table references for queries
  • change: Fix more typos
  • change: Fix typos in docs and contributing guide
  • change: Format with Dart 3.13
  • change: Handle unexpected close of drift remote client
  • change: Include type args when reading manager references
  • …and 41 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

simolus3/drift was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 9d2330b31fe0788d9911a7d8c09fdf976b770fd2 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.