Improve documentation of withLength (#947)

This commit is contained in:
Simon Binder 2020-12-01 09:21:43 +01:00
parent 3602ba43b4
commit 472560684a
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 7 additions and 5 deletions

View File

@ -203,11 +203,13 @@ class RealColumnBuilder
class TextColumnBuilder
extends ColumnBuilder<TextColumnBuilder, TextColumn, String?> {
/// Puts a constraint on the minimum and maximum length of text that can be
/// stored in this column (will be validated whenever this column is updated
/// or a value is inserted). If [min] is not null and one tries to write a
/// string so that [String.length] is smaller than [min], the query will throw
/// an exception when executed and no data will be written. The same applies
/// for [max].
/// stored in this column.
///
/// Both [min] and [max] are inclusive. This constraint will be validated in
/// Dart, it doesn't have an impact on the database schema. If [min] is not
/// null and one tries to write a string which [String.length] is
/// _strictly less_ than [min], an exception will be thrown. Similarly, you
/// can't insert strings with a length _strictly greater_ than [max].
TextColumnBuilder withLength({int? min, int? max}) => _isGenerated();
}