Nodes class
Routing table — stores every node this device has ever learned about through direct encounter or gossip relay.
- Implementers
Constructors
- Nodes()
Properties
- batteryLevel → IntColumn
-
Battery level of the node (0-100).
no setter
-
customConstraints
→ List<
String> -
Custom table constraints that should be added to the table.
no setterinherited
- displayName → TextColumn
-
Human-readable display name chosen by the user.
no setter
- 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 setterinherited - groupId → TextColumn
-
Optional group affiliation. Null means the node is ungrouped.
Used by NodeRole.group nodes for filtered routing.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasInternetAccess → BoolColumn
-
Whether the node has internet access.
no setter
- hopCount → IntColumn
-
How many relay hops away this node was last known to be.
0 = direct encounter, 1 = one hop away, etc.
no setter
- isStrict → bool
-
Whether this table is
STRICT.no setterinherited - lastSeen → IntColumn
-
Epoch milliseconds of the last time this node was encountered
(directly or via gossip).
no setter
- metadata → TextColumn
-
Extensible JSON blob for future metadata (e.g., capabilities, version).
no setter
- nodeId → TextColumn
-
Unique node identifier (UUID v4, generated on first launch).
no setter
-
primaryKey
→ Set<
Column< Object> > -
Override this to specify custom primary keys:
no setter
- role → IntColumn
-
The node's mesh role, stored as an integer mapping to NodeRole.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- 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
Tableclass namedLocalSettingswill be calledlocal_settingsby 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 setterinherited -
uniqueKeys
→ List<
Set< ?Column< >Object> > -
Unique constraints in this table.
no setterinherited
- withoutRowId → bool
-
Whether to append a
WITHOUT ROWIDclause in theCREATE TABLEstatement. This is intended to be used by generated code only.no setterinherited
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
-
customType<
T extends Object> (UserDefinedSqlType< T> type) → ColumnBuilder<T> -
Defines a column with a custom
typewhen 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
enumclassT.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
enumclassT.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited