SQLRegExpSyntax enum

How a SQL dialect matches a regular expression (KeyConditionRegExp).

Every syntax has the same semantics (PostgreSQL's): the pattern matches anywhere in the value, . also matches a line terminator, and ^/$ match only at the start/end of the whole value.

Inheritance
Available extensions

Values

postgres → const SQLRegExpSyntax

PostgreSQL: value ~ pattern (~*, !~, !~*). A non-text value is cast to TEXT. A word boundary \b/\B is rewritten as \y/\Y (in PostgreSQL \b is a backspace, and \B a backslash).

mysql → const SQLRegExpSyntax

MySQL 8.0.4+: REGEXP_LIKE(value, pattern, 'cn'): c/i (case), n (. matches a line terminator). A $ is rewritten as \z: ICU's $ also matches before a final line terminator.

function → const SQLRegExpSyntax

A regexp(pattern, value, flags) function, that the adapter registers (SQLite), with the semantics of KeyConditionRegExp.toDartRegExp.

dart → const SQLRegExpSyntax

Not executed by a database: the condition is matched in memory (KeyConditionRegExp.matchesEntityMap). Written as function.

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

adaptPattern(String pattern) → String
The pattern to bind as the parameter of matchSQL.
matchSQL(String value, String pattern, {required bool caseInsensitive, required bool not, bool castToText = false}) → String
The SQL matching the regexp pattern (a placeholder) against value (a column). castToText for a column that may not be text.
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

Static Methods

dollarAsEndOfInput(String pattern) → String
Rewrites each $ of pattern as \z (end of input) for ICU (MySQL): not an escaped one (\$), nor in a class ([...], also nested: [[:digit:]$]), nor quoted (\Q...\E).
regexpFunction(Object? pattern, Object? value, [Object? flags]) → bool?
The SQL function function (see SQLRegExpSyntax.function): regexp(pattern, value [, flags]), or null for a null argument.
wordBoundaryAsPostgres(String pattern) → String
Rewrites each word boundary \b/\B of pattern as PostgreSQL's \y/\Y: not in a class ([\b] is a backspace, as in PostgreSQL).

Constants

values → const List<SQLRegExpSyntax>
A constant List of the values in this enum, in order of their declaration.