SafeRow<R extends Record> class

R is the Expected Record type (enables compile-time key validation via custom linters).

Available extensions

Constructors

SafeRow(Row _raw, ResultSchema _schema)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

get<T>(String key) → T
Reads a value. Throws if the database value is null. Throws if the key is missing from the schema or the type mismatches.
getOptional<T>(String key) → T?
Reads a value. Allows the database value to be null. Throws if the key is missing from the schema or the type mismatches.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse<T, DB>(String key, T parser(DB dbValue)) → T
Reads a primitive database value DB and parses it into a custom type T. Throws if the column is null, missing from schema, or if parsing fails.
parseDateTime(String key) DateTime

Available on SafeRow<Record>, provided by the SafeRowConvenience extension

Parses a SQLite value (epoch integer or ISO-8601 string) into a Dart DateTime.
parseDateTimeOptional(String key) DateTime?

Available on SafeRow<Record>, provided by the SafeRowConvenience extension

Parses an optional SQLite value (epoch integer or ISO-8601 string) into a Dart DateTime.
parseEnumByName<T extends Enum>(String key, Iterable<T> values) → T

Available on SafeRow<Record>, provided by the SafeRowConvenience extension

Parses a SQLite String into a Dart Enum using its name.
parseEnumByNameOptional<T extends Enum>(String key, Iterable<T> values) → T?

Available on SafeRow<Record>, provided by the SafeRowConvenience extension

Parses an optional SQLite String into a Dart Enum using its name.
parseOptional<T, DB>(String key, T parser(DB dbValue)) → T?
Same as parse, but allows the database value to be null.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String key) → dynamic
Unsafe, dynamic map access (bypasses schema and type checks).