drift 1.7.0
drift: ^1.7.0 copied to clipboard
Drift is a reactive library to store relational data in Dart and Flutter applications.
1.7.0 #
- Add the
int64()column builder to store large integers. These integers are still stored as 64-bit ints in the database, but represented as aBigIntin Dart. This enables better web support for integers larger than 2^52. More details are in the documentation. - Add
filteranddistinctsupport togroupConcat. - Fix a deadlock with the
sqflite-based implementation if the first operation in atransactionis a future backed by a query stream.
1.6.0 #
- Add the
unique()method to columns and theuniqueKeysoverride for tables to define unique constraints in Dart tables. - Add the
check()method to the Dart column builder to generateCHECKcolumn constraints. - Also apply type converters for json serialization and deserialization if they
mix in
JsonTypeConverter. - Add the very experimental
package:drift/wasm.dartlibrary. It uses WebAssembly to access sqlite3 without any external JavaScript libraries, but requires you to add a WebAssembly module to theweb/folder. Please note that this specific library is not subject to semantic versioning until it leaves its experimental state. It also isn't suitable for production use at the moment. - Internally use
package:jsto wrap sql.js.
1.5.0 #
- Add
DataClassName.extendingto control the superclass of generated row classes. - Add
setupparameter to the constructors ofWebDatabasetoo. - Don't write variables for expressions in
CREATE VIEWstatements. - Improve stack traces for errors on a remote isolate.
- Add
MultiExecutor.withReadPoolconstructor to load-balance between multiple reading executors. This can be used in a multi-isolate approach if some queries are expensive.
1.4.0 #
- Most methods to compose statements are now available as an extension on
tables. As an alternative to
update(todos).replace(newEntry), you can now writetodos.replaceOne(newEntry). - Deprecate the
from(table)API introduced in 1.3.0. Having the methods on the table instances turned out to be even easier! - In drift files, you can now use
LIST(SELECT ...)as a result column to get all results of the inner select as aListin the result set.
1.3.0 #
- Add the
from(table)method to generated databases. It can be used to write common queries more concisely. - Make
groupConcatnullable in the Dart API. - Throw an exception in a
NativeDatabasewhen multiple statements are run in a single call. In previous versions, parts of the SQL string would otherwise be ignored. - Close the underlying database when a drift isolate is shut down.
1.2.0 #
- Properly support stream update queries on views.
- Reading blobs from the database is more lenient now.
- Provide a stack trace when
getSingle()orwatchSingle()is used on a query emitting more than one row.
1.1.1 #
- Rollback transactions when a commit fails.
- Revert a change from 1.1.0 to stop serializing messages over isolates.
Instead, please set the
serializeparameter tofalseon theDriftIsolatemethods.
1.1.0 #
- Add the
referencesmethod toBuildColumnto reference a column declared in another Dart table. - Add the
generateInsertableoption to@UseRowClass. When enabled, the generator will emit an extension to use the row class as anInsertable. Thanks to @westito. - Allow the generator to emit correct SQL code when using arrays with the
new_sql_code_generationoption in specific scenarios. - Add support for strict tables in
.driftfiles. - Add the
generatedAsmethod to declare generated columns for Dart tables. - Add
OrderingTerm.randomto fetch rows in a random order. - Improved support for pausing query stream subscriptions. Instead of buffering events, query streams will suspend fetching data if all listeners are paused.
- Drift isolates no longer serialize messages into a primitive format. This will reduce the overhead of using isolates with Drift.