JsonTable extension type
A table of JsonRows whose shape each case chooses.
Why an extension type: it is exactly a DbTable<JsonRow> (so the
database keeps it as one), with a constructor that names the shape.
Constructors
-
JsonTable(String name, {String key = 'id', bool autoIncrementKey = false, List<
List< indexes = const [], List<String> >List< uniqueIndexes = const [], String? syncWith})String> > -
A table
namekeyed bykey, withindexesover the named fields anduniqueIndexes(each index is named after its fields), synchronized with the remotesyncWithwhen given.
Properties
- autoIncrement → bool
-
Rows inserted without a primary key get the next integer.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
indexes
→ List<
Index> -
Secondary indexes, maintained in the same transaction as the rows.
finalinherited
-
primaryKey
→ Field<
Object> -
The field that identifies a row.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schema → TableSchema
-
The definition sent to the engine.
no setterinherited
- syncWith → String?
-
The remote this table synchronizes with, or
nullfor a local table.finalinherited - tableName → String
-
Name of the table.
finalinherited
Methods
-
all(
) → SelectQuery< JsonRow> -
Every row (
SELECT * FROM table).inherited -
belongingTo<
V extends Object> (Iterable< V> parentKeys, Field<V> foreignKey) → SelectQuery<JsonRow> -
The rows whose
foreignKeyis one ofparentKeys: the children of some parents, in one query (Diesel'sbelonging_to). Group them withAssociations.groupedBy.inherited -
delete(
) → DeleteQuery< JsonRow> -
Deletes rows (
delete(table).filter(...)).inherited -
field<
V extends Object> (String name, {Object? encode(V value)?, V? decode(Object stored)?}) → Field< V> -
The field at
nameof the rows, compared and read as values ofV(see Field for how values are encoded, andencode/decodefor a model that stores a value another way).inherited -
filter(
Expression condition) → SelectQuery< JsonRow> -
Rows matching
condition.inherited -
find(
Object key) → FindQuery< JsonRow> -
The row whose primary key is
key.inherited -
groupBy(
List< Field< keys) → GroupQuery<Object> >JsonRow> -
Every row grouped by
keys(GROUP BY).inherited -
innerJoin(
DbTable< Object?> table, {required Field<Object> on, required Field<Object> equals}) → JoinQuery -
This table joined with
tablewhere theequalsfield oftableequals theonfield of this one (INNER JOIN).inherited -
insert(
Iterable< JsonRow> rows) → InsertQuery<JsonRow> -
Inserts
rows(insert_into(table).values(rows)).inherited -
leftJoin(
DbTable< Object?> table, {required Field<Object> on, required Field<Object> equals}) → JoinQuery -
Like innerJoin, keeping the rows of this table without a match
(
LEFT JOIN).inherited -
mapRow(
Map< String, Object?> json) → Result<JsonRow, DbError> -
The row of a stored
json, or DbErrorCode.rowMapping when the model cannot read it: a stored row that does not fit the model is data to report, not a crash.inherited -
mapRows(
List< Map< json) → Result<String, Object?> >List< JsonRow> , DbError> -
The rows of
json, or the error of the first one that does not fit.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
order(
OrderingTerm term) → SelectQuery< JsonRow> -
Every row, sorted by
term.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
update(
) → UpdateQuery< JsonRow> -
Updates rows (
update(table).filter(...).set(...)).inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited