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
andisNotValue
methods toExpression
to generate theIS
operator in SQL. - Add
all()
extension on tables and views to quickly query all rows.
Isolate improvements
- Add
serializableConnection()
andcomputeWithDatabase()
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 implementsQueryExecutor
, meaning that you no longer need a special.connect()
constructor to use it. - The
generate_connect_constructor
option is now deprecated, as aDatabaseConnection
can be passed whereever aQueryExecutor
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)
andCAST(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
withextending
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.