Releases: simolus3/drift
Drift 2.14.1
This minor release fixes bugs in the drift
and the drift_dev
packages:
- Fix
WasmProbeResult.open
ignoring theìnitializeDatabase
callback. - Fix inconsistencies when generating
Variable
instances for columns with custom types. - Fix a build performance regression introduced in version 2.14.0 related to analyzing imports in drift files.
Drift 2.14
New features in drift:
- Add the
QueryInterceptor
API to easily monitor or transform all database calls made by drift. - Add the
count()
extension on tables to easily count rows in tables or views. - For updates made in drift files, we now support the column-name-list syntax.
Changes to the generator:
- Breaking change: The name of the generated row class derived from the name of the Dart table name now supports more forms of plurals. For instance, a table without a
@DataClassName
annotation namedCategories
would now generate aCategory
class instead ofCategorie
. This is done in a minor release because we assume users previously running into this are already using@DataClassName
as a workaround. - Make versioned schema snapshots generated by
drift_dev schema steps
public. - Don't generate
const
row classes when they are extending a class which isn't const. - Fix indices attached to tables not generating reliably.
Drift 2.13
Core Library
- Add support for custom types, which are useful when extending drift to support other database engines.
- Add
Expression.and
andExpression.or
to create disjunctions and conjunctions of sub-predicates. - Step-by-step migrations now save the intermediate schema version after each step.
- The
TypeConverter.json
factory reduces the boilerplate needed to define type converters doing JSON conversions.
Backends
- Add APIs to setup Wasm databases with custom drift workers.
- The
drift_postgres
package is now available on pub.dev.
Utilities
- Drift now provides a DevTools extension embedding the drift inspector written by Koen Van Looveren. When opening DevTools from Flutter's beta channel, a Drift tab is available to inspect open databases.
Drift 2.12.1
This minor release fixes the following issues:
- Fix
readWithConverter
throwing an exception for null values in non-nullable columns (#2640). - Fix
*
columns in analyzed SQL queries expanding to more columns than what would be correct (#2641). - Fix invalid types listed in
views
crashing the generator (#2636). - Fix a generator crash when seeing an index referencing expressions instead of columns (#2643).
Drift 2.12.0
This drift release adds support for defining a database index in Dart and improves JSON support.
Full list of changes:
- Add support for table-valued functions in the Dart query builder.
- Support the
json_each
andjson_tree
table-valued functions. - Add the
@TableIndex
annotation for table classes to add an index to the table. - Add the
TypeConverter.json
method to define type converters storing JSON values more easily. - Add
TypedResult.readWithConverter
to read a column with a type converter from a join result row.
Drift 2.11.1
This minor drift release contains bug fixes and performance improvements for the builder:
- Allow references to
sqlite_schema
in drift files. - Support the
timediff
andoctet_length
functions from sqlite 3.43.0. - Reduce the amount of assets read by drift, improving build performance and enabling faster incremental rebuilds.
- Fix missing import references around
@UseRowClass
withgenerateInsertable: true
when modular code generation is enabled. - Allow using
.read()
for a column added to a join from the table, fixing a regression in drift 2.11.0. - Make step-by-step migrations easier to customize with
Migrator.runMigrationSteps
.
Drift 2.11.0
This release adds new features to the Dart query builder API:
- Add support for subqueries in the Dart query builder.
- Add
isInExp
andisNotInExp
to constructIS IN
expressions with arbitrary expressions. - Add the
substr
extension onExpression<String>
to call the sqlite3 function from the Dart API.
Other new additions to drift:
- Add
isolateSetup
toNativeDatabase.createInBackground()
to override native libraries or perform other database-unrelated setup work. - Add
WasmDatabase.probe()
, a method probing for available implementations and existing databases on the web without opening one directly.
drift_dev
has also seen some optimizations in how it generates query code, which enables new features:
- Nested result columns in drift files can now refer to any result set (e.g. a table-valued function or a subquery). They were restricted to direct table references before.
- Add the
dialects
builder option to generate code supporting multiple SQL dialects. - Add the
preamble
option for non-shared or modular build setups to mirror thepreamble
option fromsource_gen:combining_builder
.
Drift 2.10.0
The main new feature of drift 2.10 is the drift_dev schema steps
command, which generates a single Dart file with all schema versions of your database available.
A generated API in that file makes it easy to write incremental schema migrations.
Additionally, this release fixes an issue with the new WASM implementation when the set of available storage implements in a browser changes and makes drift_dev
print a warning when Dart tables are implicitly added to a database through a transitive import.
Drift 2.9.0
Drift 2.9.0
The biggest feature of this release is stable web support! The WasmDatabase.open
factory with a drift web worker is a performant and reliable web implementation for drift. The new web documentation at https://drift.simonbinder.eu/web/ shows how to use the new API and how to migrate from the old and experimental drift web APIs.
In addition to the new web API, this release
- introduces the
fatal_warnings
builder option, causing the build to fail whendrift_dev
reports warnings. - forbids returning
0
from theschemaVersion
getter. This has always been broken, so the explicit check leads to a better error message.
Drift 2.8.1
This patch release fixes the following issues in the core drift
package:
- Fix a deadlock after rolling back a transaction in a remote isolate.
- Remove unintended log messages when using
connectToDriftWorker
.
Also, drift_dev: 2.8.3
and sqlparser: 0.30.1
have been released with these changes:
- Allow Dart-defined tables to reference imported tables through SQL #2433.
- Report syntax error for
WITH
clauses in triggers.