Skip to content

Releases: simolus3/drift

Drift 2.9.0

18 Jun 19:51
drift-2.9.0
5fe28cb
Compare
Choose a tag to compare

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 when drift_dev reports warnings.
  • forbids returning 0 from the schemaVersion getter. This has always been broken, so the explicit check leads to a better error message.

Drift 2.8.1

01 Jun 09:38
drift-2.8.1
232140c
Compare
Choose a tag to compare

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.

Drift 2.8.0

10 May 09:24
drift-2.8.0
1dad8a0
Compare
Choose a tag to compare

This drift release adds support for named constructors for existing row types in drift files (#2399) and allows targeting partial indices in DoUpdate (#2394).

It also fixes the following noteworthy bugs:

  • Don't keep databases in an unusable state if the setup callback throws an exception. Instead, drift will retry the next time the database is used.
  • Fix deadlocks when computeWithDatabase is called inside a transaction().
  • Fix compilation issues with analyzer: 5.12.0.

Drift 2.7.0

10 Apr 21:49
drift-2.7.0
d7f1bfb
Compare
Choose a tag to compare
  • Add support for CASE expressions without a base in the Dart API with the CaseWhenExpression class.
  • Add the new package:drift/web/workers.dart library which makes it easier to create web workers for drift.
  • Make validateDatabaseSchema() work in migration tests.
  • Fix queries from transitive imports in drift files not being analyzed reliably.
  • Fix false-positive warnings about AS aliases in subqueries used in triggers.
  • Fix false-positive warnings about referencing a result column in a GROUP BY or HAVING clause.

Drift 2.5.0

29 Jan 15:58
drift-2.5.0
e42dd91
Compare
Choose a tag to compare

This release adds support for general IS operators to the query builder, makes drift isolates much easier to use and allows applying type converters on columns in queries.

Query builder

  • Add isExp, isValue, isNotExp and isNotValue methods to Expression to generate the IS operator in SQL.
  • Add all() extension on tables and views to quickly query all rows.

Isolate improvements

  • Add serializableConnection() and computeWithDatabase() as extensions on databases. The methods allow sharing any drift database between isolates, regardless of how the database has been set up.
  • The DatabaseConnection class now implements QueryExecutor, meaning that you no longer need a special .connect() constructor to use it.
  • The generate_connect_constructor option is now deprecated, as a DatabaseConnection can be passed whereever a QueryExecutor is used too.

Drift files

  • Support MAPPED BY for individual columns in queries or in views defined with SQL.
  • Support a CAST to an enum type in drift files.
  • Consistently interpret CAST (x AS DATETIME) and CAST(x AS TEXT) in drift files.
  • Support two different queries using LIST() columns having the same result class name.

Miscellaneous changes and fixes

  • Fix table classes not extending defining Dart classes with modular generation.
  • Fix @UseDataClass with extending not working with modular generation.
  • Fix generating invalid code when using a type converter with a nullable JSON type.
  • Avoid unecessary async modifier when mapping queries to existing row classes.

Drift 2.4.2

03 Jan 10:45
fafcf11
Compare
Choose a tag to compare

drift 2.4.2

  • Fix an exception when a client disconnects from a drift remote server while processing a pending table update.

drift_dev 2.4.1

  • Improvements and fixes for schema files:
    • Fix views with an existing row type generating invalid SQL in schema files.
    • Fix schema generate --companions implicitly requiring --data-classes as well.
    • Fix toColumns() not being generated correctly.
    • Fix conflicting names being generated by schema generate when using existing row types on views.

sqlparser 0.26.0

  • Remove token parameter from constructor in Literal subclasses and NumberedVariable.

Drift 2.4.0

29 Dec 11:23
a98890b
Compare
Choose a tag to compare

This drift release extends support for existing row classes to queries, allows storing enums by their name and handles ANY columns. A full list of improvements and new features:

New features

  • Support existing row types on queries defined in drift files.
  • Enums can now be stored by their name instead of their index - use the textEnum() column in Dart or the ENUMNAME column type in .drift files.
  • Add the DriftAny type to handle arbitrary SQL values. It will be used by the generator for columns types declared as ANY in strict tables.
  • drift_dev schema dump can now dump the schema of existing sqlite3 database files as well.
  • Adds the case_from_dart_to_sql option with the possible values: preserve, camelCase, CONSTANT_CASE, snake_case, PascalCase, lowercase and UPPERCASE (default: snake_case).
  • Add updates parameter to Batch.customStatement - it can be used to specify which tables are affected by the custom statement.
  • Add likeExp to generate LIKE expressions with any comparison expression.

Notable improvements

  • Fix UNIQUE keys declared in drift files being written twice.
  • Lazily load columns in TypedResult.read, increasing performance for joins with lots of tables or columns.
  • Work-around an issue causing complex migrations via Migrator.alterTable not to work if a view references the altered table.
  • Warn about suspicious int or text literals being inserted into enum columns.
  • For Dart-defined columns, customConstraints are now parsed and respected by the generator.
  • It is now allowed to interleave queries and tables in a drift file.

This drift release also adds experimental support for record types as existing types for tables or queries. Note that records are experimental in the Dart language, so the feature may be updated or removed depending on its development in the language.

Drift 2.3.0

27 Nov 18:05
a837e51
Compare
Choose a tag to compare
  • Add the JsonTypeConverter2 mixin. It behaves similar to the existing json type converters, but can use a different SQL and JSON type.
  • Add isInValues and isNotInValues methods to columns with type converters. They can be used to compare the column against a list of Dart expressions that will be mapped through a type converter.
  • Add TableStatements.insertAll to atomically insert multiple rows.
  • Add singleClientMode to remote() and DriftIsolate connections to make the common case with one client more efficient.
  • Fix a concurrency issue around transactions.
  • Add NativeDatabase.createInBackground as a drop-in replacement for NativeDatabase(). It creates a drift isolate behind the scenes, avoiding all of the boilerplate usually involved with drift isolates.
  • Experimental: Add a modular generation mode in which drift will generate multiple smaller files instead of one very large one with all tables and generated queries.

Drift 2.2.0

06 Oct 11:52
a2e10d9
Compare
Choose a tag to compare
  • Potentially breaking bug-fix: Fix the nullability of columns generated for Dart-defined views. See the documentation for details.
  • Always escape column names, avoiding the costs of using a regular expression to check whether they need to be escaped.
  • Add extensions for binary methods on integer expressions: operator ~, bitwiseAnd and bitwiseOr.
  • Serialize uniqueKeys overrides into a database schema, allowing them to be properly tested in schema tests.
  • Support the latest version of the analyzer package.

Drift 2.1.0

29 Aug 21:16
ce35a27
Compare
Choose a tag to compare

Changes in drift version 2.1.0:

  • Improve stack traces when using watchSingle() with a stream emitting a non-singleton list at some point.
  • Add OrderingTerm.nulls to control the NULLS FIRST or NULLS LAST clause in Dart.

Changes in drift_dev version 2.1.0 and sqlparser version 0.23.2:

  • Analysis support for fts5 tables with external content tables.
  • Analysis support for the rtree module.
  • Internally prepare for an upcoming breaking analyzer change around how classes are mapped to elements.
  • Improve static analysis around subqueries in SQL.