DatabaseColumn<T, R> class abstract

Base class of declaring column, must to be const

  • T - type of data represents in Dart
  • R - type of data represents in database (this must be one of int, double, String, Uint8List)

data levels:

  • json - Json representation of contains value
  • bin - bytes representation of contains value
  • dart - T dart representation of contains value
  • raw - R database representation of contains value
  • db - R? contained directly in db of this column
Implementers
Annotations
  • @immutable

Constructors

DatabaseColumn(String name, String type, {String constraints = 'NOT NULL', bool unique = false, bool indexed = false})
const

Properties

columnDefinition String
Column definition for sqlite3
no setter
constraints String
Constraints of that column
final
hashCode int
The hash code for this object.
no setterinherited
indexed bool
Needs to create index for this column
final
name String
Column name
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Declared type of column
final
unique bool
Unique values in column
final

Methods

binRead(BinaryReader reader) → R
Read raw database value from reader
binWrite(R value, BinaryWriter writer) → void
Wrtie raw database value to writer
dartDecode(T value) → R
Converting T dart object to raw database value
dartEncode(R value) → T
Converting raw database value to T dart object
databaseLoadMutator(R? value) → R
Mutate db value after select to raw value
databaseSaveMutator(R value) → R?
Mutate raw value to db before insert it to database
jsonDecode(Object? value) → R
Converting json to raw database value
jsonEncode(R value) Object?
Converting raw database value to json
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited