Precedence enum Null safety

Used to order the precedence of sql expressions so that we can avoid unnecessary parens when generating sql statements.

Inheritance
Implemented types

Values

unknown → const Precedence

Precedence is unknown, assume lowest. This can be used for a CustomExpression to always put parens around it.

Precedence._(-1)
or → const Precedence

Precedence for the OR operator in sql

Precedence._(10)
and → const Precedence

Precedence for the AND operator in sql

Precedence._(11)
comparisonEq → const Precedence

Precedence for most of the comparisons operators in sql, including equality, is (not) checks, in, like, glob, match, regexp.

Precedence._(12)
comparison → const Precedence

Precedence for the <, <=, >, >= operators in sql

Precedence._(13)
bitwise → const Precedence

Precedence for bitwise operators in sql

Precedence._(14)
plusMinus → const Precedence

Precedence for the (binary) plus and minus operators in sql

Precedence._(15)
mulDivide → const Precedence

Precedence for the *, / and % operators in sql

Precedence._(16)
stringConcatenation → const Precedence

Precedence for the || operator in sql

Precedence._(17)
unary → const Precedence

Precedence for unary operators in sql

Precedence._(20)
postfix → const Precedence

Precedence for postfix operators (like collate) in sql

Precedence._(21)
primary → const Precedence

Highest precedence in sql, used for variables and literals.

Precedence._(100)

Properties

hashCode int
The hash code for this object.
read-onlyinherited
index int
A numeric identifier for the enumerated value.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

compareTo(Precedence other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator <(Precedence other) bool
Returns true if this Precedence is lower than other.
operator <=(Precedence other) bool
Returns true if this Precedence is lower or equal to other.
operator ==(Object other) bool
The equality operator.
inherited
operator >(Precedence other) bool
Returns true if this Precedence is higher than other.
operator >=(Precedence other) bool
Returns true if this Precedence is higher or equal to other.

Constants

values → const List<Precedence>
A constant List of the values in this enum, in order of their declaration.
[unknown, or, and, comparisonEq, comparison, bitwise, plusMinus, mulDivide, stringConcatenation, unary, postfix, primary]