Sqlite class
An annotation used to specify how a field is serialized. Heavily inspired by JsonKey
Constructors
- Sqlite({Column? columnType, String? defaultValue, bool? enumAsString, String? fromGenerator, bool? ignore, bool? ignoreTo, bool? ignoreFrom, bool? index, String? name, bool? nullable, bool? onDeleteCascade, bool? onDeleteSetDefault, String? toGenerator, bool? unique})
-
Creates a new Sqlite instance.
const
Properties
- columnType → Column?
-
In very exceptional circumstance, the SQLite column type can be declared.
final
- defaultValue → String?
-
The value to use if the source's value is
null
. This is often directly injected to the adapter, and wrapping is required for strings. (e.g.defaultValue: "'Missing Last Name'"
)final - enumAsString → bool
-
By default, all enums are assumed to be delivered as
int
. However, this requires order to be maintained; additionally some providers deliver enums asString
(e.g.{"party", "baseball", ...}
). This field value should apply to Iterable and single field types ofenum
.final - fromGenerator → String?
-
Manipulates output for the field in the deserialize generator.
The instance's field name is automatically defined. While the build method is ultimately
responsible for how the output is applied, it is most often directly injected as the
value of the field in the deserialize adapter.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- ignore → bool
-
true
if the generator should ignore this field completely. Whentrue
, takes precedence over ignoreFrom and ignoreTo. Defaults tofalse
.final - ignoreFrom → bool
-
true
if this field should be ignored only during deserializization (when remote data is converted to Dart code). Defaults tofalse
.final - ignoreTo → bool
-
true
if this field should be ignored only during serializization (when Dart code is sent to a remote source). Defaults tofalse
.final - index → bool
-
Create an
INDEX
on a single column. AUNIQUE
index will be created when unique istrue
. When unique istrue
and index is absent orfalse
, an index is not created.final - name → String?
-
The column name to use when reading and writing values corresponding
to the annotated fields.
final
- nullable → bool
-
When
false
, the column will be inserted asNOT NULL
and a value will be required in subsequent operations. Takes precedence over SqliteSerializable's#nullable
. Defaults totrue
.final - onDeleteCascade → bool
-
When true, deletion of the referenced record by
foreignKeyColumn
on theforeignTableName
this record. For example, if the foreign table is "departments" and the local table is "employees," whenever that department is deleted, "employee" will be deleted. Defaultsfalse
.final - onDeleteSetDefault → bool
-
When true, deletion of a parent will set this table's referencing column to the default,
usually
NULL
unless otherwise declared. Defaultsfalse
.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toGenerator → String?
-
Manipulates output for the field in the SqliteSerializeGenerator
The serializing key is defined from Sqlite or the default naming of the field.
final
- unique → bool
-
When
true
, the column will be inserted with aUNIQUE
constraint. Unique columns will also be listed in the adapter for querying if implemented by the invoking provider. Defaults tofalse
. Does not apply to associations.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited