addColumns method Null safety

void addColumns(
  1. Iterable<Expression<Object>> expressions
)

Adds a custom expression to the query.

The database will evaluate the Expression for each row found for this query. The value of the expression can be extracted from the TypedResult by passing it to TypedResult.read.

As an example, we could calculate the length of a column on the database:

final contentLength = todos.content.length;
final results = await select(todos).addColumns([contentLength]).get();

// we can now read the result of a column added to addColumns
final lengthOfFirst = results.first.read(contentLength);

See also:

Implementation

void addColumns(Iterable<Expression> expressions) {
  _selectedColumns.addAll(expressions);
}