VirtualColumn class base

A description used within a Scheme to define a generated virtual column.

A virtual column is added to the mapping table and is useful for extracting the result of an sql expression that operates on other columns. For example, an expression may return a particular data element from a JSON value stored in the value column. An expression is evaluated only for rows whose kinds are included in the kinds property; rows of other kinds will have NULL as the value of the virtual column.

In the following fragment, a virtual column named "numFlatware" calculates the total number of forks and spoons for rows of the "Kitchen" kind using SqlJX in the expression:

var vc = VirtualColumn(
  version: 1,
  name: "numFlatware",
  kinds: ["Kitchen"],
  sql: SqlJX.std("numForks") + SqlJX.std("numSpoons"),
);
/* ... */

See also: PartialIndex.

Inheritance
Annotations
  • @immutable

Constructors

VirtualColumn({required int version, required String name, required KindList kinds, required Sql sql})
Creates a description of a virtual column using the given parameters.

Properties

hashCode → int
The hash code for this object.
no setterinherited
kinds → KindList
The kinds of rows to which the evaluation of the column value is limited.
final
name → String
A string representing the name of the provided description.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sql → Sql
The expression whose result forms the value of the virtual column.
final
version → int
An integer representing the version of the provided description.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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