From 110d775a90d22d590f96c42edce2f6ade110beac Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Sat, 15 Jun 2019 09:30:07 +0200 Subject: [PATCH] Provide an example usage in the `withDefault` method --- moor/lib/src/dsl/columns.dart | 6 ++++++ moor/pubspec.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/moor/lib/src/dsl/columns.dart b/moor/lib/src/dsl/columns.dart index 017222b7..beb8a193 100644 --- a/moor/lib/src/dsl/columns.dart +++ b/moor/lib/src/dsl/columns.dart @@ -89,6 +89,12 @@ class ColumnBuilder< /// Particularly, you can use methods like [and], [or] and [not] to form /// expressions here. /// + /// If you need a column that just stores a static default value, you could + /// use this method with a [Constant]: + /// ```dart + /// IntColumn get level => int().withDefault(const Constant(1))(); + /// ``` + /// /// See also: /// - [Constant], which can be used to model literals that appear in CREATE /// TABLE statements. diff --git a/moor/pubspec.yaml b/moor/pubspec.yaml index 60be9e00..eab96aad 100644 --- a/moor/pubspec.yaml +++ b/moor/pubspec.yaml @@ -1,6 +1,6 @@ name: moor description: Moor is a safe and reactive persistence library for Dart applications -version: 1.4.0 +version: 1.4.0+1 repository: https://github.com/simolus3/moor homepage: https://moor.simonbinder.eu/ issue_tracker: https://github.com/simolus3/moor/issues