Add more docs, changelog

This commit is contained in:
Simon Binder 2022-02-18 15:09:51 +01:00
parent 9bcac38e98
commit 6184892217
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
4 changed files with 39 additions and 4 deletions

View File

@ -1,3 +1,8 @@
## 1.5.0-dev
- Add `DataClassName.extending` to control the superclass of generated row
classes.
## 1.4.0
- Most methods to compose statements are now available as an extension on

View File

@ -184,7 +184,37 @@ class DataClassName {
/// {@macro drift_custom_data_class}
final String name;
/// The parent class of generated data class. Class must extends [DataClass]!
/// The parent type of the data class generated by drift.
///
/// The [extending] type must refer to an interface type (usually just a
/// class name), and the parent class must extend [DataClass].
///
/// The extended class can optionally have a type parameter, which is
/// instantiated to the actual data class generated by drift.
///
/// For example,
///
/// ```dart
/// abstract class BaseModel extends DataClass {
/// abstract final String id;
/// }
///
/// abstract class TypedBaseModel<T> extends DataClass {
///
/// }
///
/// @DataClassName('Company', extending: BaseModel)
/// class Companies extends Table {
/// TextColumn get id => text()();
/// TextColumn get name => text().named('name')();
/// }
///
/// // The actual generated class will extend `TypedBaseModel<Employee>`.
/// @DataClassName('Employee', extending: TypedBaseModel)
/// class Employees extends Table {
/// TextColumn get id => text()();
/// }
/// ```
final Type? extending;
/// Customize the data class name for a given table.

View File

@ -1,6 +1,6 @@
name: drift
description: Drift is a reactive library to store relational data in Dart and Flutter applications.
version: 1.4.0
version: 1.5.0-dev
repository: https://github.com/simolus3/moor
homepage: https://drift.simonbinder.eu/
issue_tracker: https://github.com/simolus3/moor/issues

View File

@ -1,6 +1,6 @@
name: drift_dev
description: Dev-dependency for users of drift. Contains a the generator and development tools.
version: 1.4.0
version: 1.5.0-dev
repository: https://github.com/simolus3/moor
homepage: https://drift.simonbinder.eu/
issue_tracker: https://github.com/simolus3/moor/issues
@ -25,7 +25,7 @@ dependencies:
io: ^1.0.3
# Drift-specific analysis and apis
drift: '>=1.4.0 <1.5.0'
drift: '>=1.5.0 <1.6.0'
sqlite3: '>=0.1.6 <2.0.0'
sqlparser: ^0.20.0