Add the TypeConverter.extensionType factory to create type converters for extension types.
Fix invalid SQL syntax being generated for BLOB literals on postgres.
Add a setup parameter to SchemaVerifier. It is called when the verifier creates database connections (similar to the callback on NativeDatabase) and can be used to register custom functions.
Generator
Adds companion entry to DataClassName to override the name of the generated companion class.
Fix drift using the wrong import alias in generated part files.
Add the use_sql_column_name_as_json_key builder option.
Fix parsing binary literals in drift files.
Expand support for IN expressions in drift files, they now support tuples on the left-hand side and the shorthand syntax for table references and table-valued functions.
Allow custom class names for CREATE VIEW statements.
Support the INT64 hint for CREATE TABLE statements.
Drift 2.16.0 mostly contains performance and stability improvements:
When a migration throws, the database will now block subsequent operations instead of potentially allowing them to operate on a database in an inconsistent state.
Improve stack traces for errors happening on drift isolates (which includes usages of NativeDatabase.createInBackground).
Statements built through the Dart query builder will now run in the context active while they are running, instead of the context active at the time they were created. For instance, creating an UpdateStatement with database.update outside of a transaction and then calling UpdateStatement.write inside of a transaction will now perform the update inside of the transaction, instead of causing a deadlock.
Improve performance when reading results from joined statements with many rows.
Deprecate Value.ofNullable in favor of Value.absentIfNull, which is more explicit about its behavior and allows nullable types too.
Migrate WasmDatabase to dart:js_interop and package:web.
Improvements to the generator
Allow selecting from virtual tables using the table-valued function syntax.
Keep import alias when referencing existing elements in generated code (#2845).
Improvements to drift_postgres
Drift's comparable expression operators are now available for expressions using postgres-specific date or timestamp types.
Drift 2.15.0
Drift 2.15 introduces new features improving web support and for sharing database classes against different databases (e.g. sqlite3 and Postgres):
Better support for custom SQL types:
Custom types are now applied consistently in the query builder API.
Add DialectAwareSqlType, a custom type depending on the runtime dialect. This allows writing "polyfill" types that use native date types on Postgres while falling back to a textual representation on sqlite3 for instance.
Initial JSONB support: sqlite 3.45 supports a binary JSON format aiming at reducing size and improving performance for JSON operations in SQL. Drift 2.15.0 supports jsonb functions in the query builder through package:drift/extensions/json1.dart. jsonb functions are also supported by sqlparser when analyzing drift files.
Runtime improvements:
Wasm databases hosted in workers are closed after the last client disconnects.
Add enableMigrations parameter to NativeDatabase to disable migrations, a flag useful for existing databases managed with an external schema tool.
Add analysis errors for illegal unqualified references to old and new in CREATE TRIGGER statements.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps drift and drift_dev. These dependencies needed to be updated together. Updates
drift
from 2.14.1 to 2.17.0Release notes
Sourced from drift's releases.
... (truncated)
Commits
9bcaedd
Upgrade dev dependencies in drift11e31cc
Prepare 2.17 releaseac4947f
SupportINT64
type for bigints in drift filesca0dee4
docs: minimise the copy/think/paste needed to get the minimal impleme… (#2951)c6f0fa2
sqlparser: Extend support forIN
expressions74fb269
Avoid encoding to hex twice43b7f72
sqlparser: Fix parsing binary literals039838b
Support bytea sql literal in postgres (#2943)37f120d
Add setup param to schema verifier82123e5
Raise language version in examplesUpdates
drift_dev
from 2.14.1 to 2.17.0Commits
9bcaedd
Upgrade dev dependencies in drift11e31cc
Prepare 2.17 releaseac4947f
SupportINT64
type for bigints in drift filesca0dee4
docs: minimise the copy/think/paste needed to get the minimal impleme… (#2951)c6f0fa2
sqlparser: Extend support forIN
expressions74fb269
Avoid encoding to hex twice43b7f72
sqlparser: Fix parsing binary literals039838b
Support bytea sql literal in postgres (#2943)37f120d
Add setup param to schema verifier82123e5
Raise language version in examplesDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show