CustomExpression<D> class Null safety

A custom expression that can appear in a sql statement. The CustomExpression.content will be written into the query without any modification.

See also:

Inheritance
Available Extensions

Constructors

CustomExpression(String content, {Iterable<TableInfo<Table, dynamic>> watchedTables = const [], Precedence precedence = Precedence.unknown})
Constructs a custom expression by providing the raw sql content.
const

Properties

content String
The SQL of this expression
final
hashCode int
The hash code for this object. [...]
read-only, override
isLiteral bool
Whether this expression is a literal. Some use-sites need to put parentheses around non-literals.
read-only, inherited
precedence Precedence
The precedence of this expression. This can be used to automatically put parentheses around expressions as needed.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
watchedTables Iterable<TableInfo<Table, dynamic>>
Additional tables that this expression is watching. [...]
final

Methods

caseMatch<T>({required Map<Expression<D>, Expression<T?>> when, Expression<T?>? orElse}) Expression<T?>
A CASE WHEN construct using the current expression as a base. [...]
inherited
cast<D2>() Expression<D2>
Generates a CAST(expression AS TYPE) expression. [...]
inherited
dartCast<D2>() Expression<D2>
Casts this expression to an expression of D. [...]
inherited
equals(D compare) Expression<bool>
Whether this column is equal to the given value, which must have a fitting type. The compare value will be written as a variable using prepared statements, so there is no risk of an SQL-injection.
inherited
equalsExp(Expression<D> compare) Expression<bool>
Whether this expression is equal to the given expression.
inherited
findType(SqlTypeSystem types) SqlType<D>
Finds the runtime implementation of D in the provided types.
inherited
isIn(Iterable<D> values) Expression<bool?>
An expression that is true if this resolves to any of the values in values.
inherited
isInQuery(BaseSelectStatement select) Expression<bool?>
An expression checking whether this is included in any row of the provided select statement. [...]
inherited
isNotIn(Iterable<D> values) Expression<bool?>
An expression that is true if this does not resolve to any of the values in values.
inherited
isNotInQuery(BaseSelectStatement select) Expression<bool?>
An expression checking whether this is not included in any row of the provided select statement. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
writeAroundPrecedence(GenerationContext context, Precedence precedence) → void
Writes this expression into the GenerationContext, assuming that there's an outer expression with precedence. If the Expression.precedence of this expression is lower, it will be wrap}ped in [...]
inherited
writeInner(GenerationContext ctx, Expression inner) → void
If this Expression wraps an inner expression, this utility method can be used inside writeInto to write that inner expression while wrapping it in parentheses if necessary.
@protected, inherited
writeInto(GenerationContext context) → void
Writes this component into the context by writing to its GenerationContext.buffer or by introducing bound variables. When writing into the buffer, no whitespace around the this component should be introduced. When a component consists of multiple composed component, it's responsible for introducing whitespace between its child components.
override

Operators

operator ==(Object other) bool
The equality operator. [...]
override