DriftSqlType<T extends Object> enum Null safety

An enumation of type mappings that are builtin to drift and drift_dev.

Inheritance

Constructors

DriftSqlType()
const

Values

bool → const DriftSqlType<bool>

A boolean type, represented as 0 or 1 (int) in SQL.

string → const DriftSqlType<String>

A textual type, represented as TEXT in sqlite.

bigInt → const DriftSqlType<BigInt>

A 64-bit int type that is represented a BigInt in Dart for better compatibility with the web. Represented as an INTEGER in sqlite or as a bigint in postgres.

int → const DriftSqlType<int>

A 64-bit int.

Represented as an INTEGER in sqlite or as a bigint in postgres.

dateTime → const DriftSqlType<DateTime>

A DateTime value.

Depending on the options choosen at build-time, this is either stored as an unix timestamp (the default) or as a ISO 8601 string.

blob → const DriftSqlType<Uint8List>

A Uint8List value.

This is stored as a BLOB in sqlite or as a bytea type in postgres.

double → const DriftSqlType<double>

A double value, stored as a REAL type in sqlite.

Properties

hashCode int
The hash code for this object.
read-onlyinherited
index int
A numeric identifier for the enumerated value.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
sqlTypeName(GenerationContext context) String
Returns a suitable representation of this type in SQL.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

forNullableType<Dart>() DriftSqlType<Object>
A variant of forType that also works for nullable Dart types.
forType<Dart extends Object>() DriftSqlType<Dart>
Attempts to find a suitable SQL type for the Dart type passed to this method.

Constants

values → const List<DriftSqlType<Object>>
A constant List of the values in this enum, in order of their declaration.
[bool, string, bigInt, int, dateTime, blob, double]