$MessagesTable class
Properties
$columns
→ List <GeneratedColumn<Object > >
All columns from this table or view.
no setter
$primaryKey
→ Set <GeneratedColumn<Object > >
The primary key of this table. Can be empty if no custom primary key has
been specified.
no setter
actualTableName
→ String
The name of the table in the database. Unlike aliasedName , this can not
be aliased.
no setter
aliasedName
→ String
The (potentially aliased) name of this table or view.
no setter
asDslTable
→ $MessagesTable
Type system sugar. Implementations are likely to inherit from both
TableInfo and Tbl and can thus just return their instance.
no setter inherited
attachedDatabase
→ GeneratedDatabase
The generated database instance that this view or table is attached to.
final
columnsByName
→ Map <String , GeneratedColumn<Object > >
Gets all $columns in this table or view, indexed by their (non-escaped)
name.
no setter inherited
createdAt
→ GeneratedColumn<int >
Epoch milliseconds when the message was originally created.
late final
customConstraints
→ List <String >
Custom table constraints that should be added to the table.
no setter inherited
dontWriteConstraints
→ bool
Drift will write some table constraints automatically, for instance when
you override primaryKey. You can turn this behavior off if you want to.
This is intended to be used by generated code only.
no setter inherited
entityName
→ String
The (unalised) name of this entity in the database.
no setter inherited
hashCode
→ int
The hash code for this object.
no setter inherited
isStrict
→ bool
Whether this table is STRICT.
no setter inherited
mediaAvailability
→ GeneratedColumn<int >
Availability state of the media binary on this device.
See MediaAvailability . Defaults to 0 (notApplicable — text message).
late final
mediaFileName
→ GeneratedColumn<String >
Original filename of the attached media (e.g., 'photo_001.jpg').
Null for text-only messages.
late final
mediaFileSize
→ GeneratedColumn<int >
Size of the full media file in bytes.
Used by the UI to display file size and decide auto-download.
late final
mediaHash
→ GeneratedColumn<String >
SHA-256 hash of the full media file for integrity verification.
Computed on send, verified on receive after FILE transfer.
late final
mediaLocalPath
→ GeneratedColumn<String >
Local filesystem path to the downloaded media binary.
Null until the binary is successfully transferred.
late final
mediaMimeType
→ GeneratedColumn<String >
MIME type of the media (e.g., 'image/jpeg', 'video/mp4').
Null for text-only messages.
late final
mediaThumbnail
→ GeneratedColumn<Uint8List >
Compressed thumbnail bytes (JPEG, ≤5 KB) for instant preview.
Embedded directly in the epidemic sync payload so users see
a preview even before the full file is transferred.
late final
mediaType
→ GeneratedColumn<int >
The type of media attached (0 = text, 1 = image, 2 = video, etc.).
See MediaType . Defaults to 0 (text — no media).
late final
messageId
→ GeneratedColumn<String >
Globally unique message identifier (UUID v4).
late final
payload
→ GeneratedColumn<Uint8List >
The encoded message content (arbitrary bytes).
late final
primaryKey
→ Set <Column<Object > >
Override this to specify custom primary keys:
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
senderId
→ GeneratedColumn<String >
The originating node's ID.
late final
signature
→ GeneratedColumn<String >
Optional HMAC-SHA256 signature for message integrity verification.
Computed by MessageSigner when the message is created locally.
Relaying nodes can verify the signature to detect tampering.
late final
status
→ GeneratedColumn<int >
Delivery status, stored as an integer mapping to MessageStatus .
late final
tableName
→ String ?
The sql table name to be used. By default, drift will use the snake_case
representation of your class name as the sql table name. For instance, a
Table class named LocalSettings will be called local_settings by
default.
You can change that behavior by overriding this method to use a custom
name. Please note that you must directly return a string literal by using
a getter. For instance @override String get tableName => 'my_table'; is
valid, whereas @override final String tableName = 'my_table'; or
@override String get tableName => createMyTableName(); is not.
no setter inherited
targetId
→ GeneratedColumn<String >
The destination node's ID. Use '*' for broadcast messages.
late final
ttl
→ GeneratedColumn<int >
Remaining hop budget. Decremented on each relay.
When this reaches 0, the message is marked MessageStatus.expired .
late final
uniqueKeys
→ List <Set <GeneratedColumn<Object > > >
The unique key of this table. Can be empty if no custom primary key has
been specified.
no setter inherited
withoutRowId
→ bool
Whether to append a WITHOUT ROWID clause in the CREATE TABLE
statement. This is intended to be used by generated code only.
no setter inherited
Methods
blob ()
→ ColumnBuilder<Uint8List >
Use this as the body of a getter to declare a column that holds arbitrary
data blobs, stored as an Uint8List . Example:
inherited
boolean ()
→ ColumnBuilder<bool >
Use this as the body of a getter to declare a column that holds bools.
Example (inside the body of a table class):
inherited
createAlias (String alias )
→ $MessagesTable
Creates an alias of this table or view that will write the name alias
when used in a query.
customType <T extends Object > (UserDefinedSqlType<T > type )
→ ColumnBuilder<T >
Defines a column with a custom type when used as a getter.
inherited
dateTime ()
→ ColumnBuilder<DateTime >
Use this as the body of a getter to declare a column that holds date and
time values.
inherited
int64 ()
→ ColumnBuilder<BigInt >
Use this as the body of a getter to declare a column that holds a 64-big
integer as a BigInt .
inherited
integer ()
→ ColumnBuilder<int >
Use this as the body of a getter to declare a column that holds integers.
inherited
intEnum <T extends Enum > ()
→ ColumnBuilder<int >
Creates a column to store an enum class T.
inherited
map (Map <String , dynamic > data , {String ? tablePrefix })
→ Message
Maps the given row returned by the database into the fitting data class.
mapFromCompanion (Insertable<Message > companion , DatabaseConnectionUser database )
→ Future <Message >
Converts a companion to the real model class, D.
inherited
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
real ()
→ ColumnBuilder<double >
Use this as the body of a getter to declare a column that holds floating
point numbers. Example
inherited
sqliteAny ()
→ ColumnBuilder<DriftAny >
Use this as a the body of a getter to declare a column that holds
arbitrary values not modified by drift at runtime.
inherited
text ()
→ ColumnBuilder<String >
Use this as the body of a getter to declare a column that holds strings.
Example (inside the body of a table class):
inherited
textEnum <T extends Enum > ()
→ ColumnBuilder<String >
Creates a column to store an enum class T.
inherited
toString ()
→ String
A string representation of this object.
inherited
validateIntegrity (Insertable<Message > instance , {bool isInserting = false })
→ VerificationContext
Validates that the given entity can be inserted into this table, meaning
that it respects all constraints (nullability, text length, etc.).