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.
Values
- postgres → const SQLRegExpSyntax
-
PostgreSQL:
value ~ pattern(~*,!~,!~*). A non-text value is cast toTEXT. A word boundary\b/\Bis rewritten as\y/\Y(in PostgreSQL\bis a backspace, and\Ba 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) againstvalue(a column).castToTextfor 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
$ofpatternas\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]), ornullfor anullargument. -
wordBoundaryAsPostgres(
String pattern) → String -
Rewrites each word boundary
\b/\Bofpatternas 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.