Table class

Implemented types

Constructors

Table(String name, List<ColumnDef> columns, {List<TableConstraint>? constraints, bool strict = false, bool withoutRowid = false})

Properties

autoInc → Map<String, int>
AUTOINCREMENT counters keyed by column name. Reset by TRUNCATE.
final
columnNames → List<String>
Column names in declaration order.
no setteroverride
columns → List<ColumnDef>
final
constraints → List<TableConstraint>
final
hashCode → int
The hash code for this object.
no setterinherited
indexDefs → Map<String, IndexDef>
final
indexes → Map<String, SplayTreeMap<Object, List<int>>>
final
kind → TableBackendKind
Which storage engine backs this table.
no setteroverride
name ↔ String
getter/setter pair
rows → List<List<Object?>>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
strict ↔ bool
True for CREATE TABLE ... STRICT. Type checking rejects mismatched values instead of coercing.
getter/setter pair
tableName → String
User-visible table name as known to the SQL layer.
no setteroverride
withoutRowid ↔ bool
True for CREATE TABLE ... WITHOUT ROWID. Affects how the table is serialized into the SQLite file format (stored as an INDEX B-tree keyed by the PK record, not as a rowid table). The in-memory engine stores rows the same way regardless.
getter/setter pair

Methods

addColumn(ColumnDef col) → void
Add a new column with the given default for existing rows.
buildIndexKey(IndexDef def, List<Object?> values) → Object?
Build the storage key for def from a single row's values. Returns null when the index should skip this row (any indexed column is NULL — matching SQLite's default treatment of NULL in indexes).
clone() → Table
Deep clone (used for transaction snapshots).
columnIndex(String colName) → int
createIndex(IndexDef def) → void
dropIndex(String name) → void
insertRow(List<Object?> values) → int
Insert a single row. Values must already be coerced to the column types. Returns the new row id (index into rows).
invalidateKeyCache() → void
Drop cached row-key strings. Call after renaming the table or mutating the column list so the next rowToMap rebuilds them.
invalidateUniqueCaches() → void
Drop the per-column unique-value caches. Call after any mutation to rows that does not go through insertRow.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rowToMap(List<Object?> row, {String? alias}) → Map<String, Object?>
Build a column-name -> value view of row. Both bare and table.col keys are populated so qualified expressions resolve.
toJson() → Map<String, Object?>
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

fromJson(Map<String, Object?> j) → Table