Class MySqlFunctions
MySQL/MariaDB-only SQL surface: the native string/conditional idioms (find_in_set,
field, elt, substring_index, format), the %-templated date
conversion and Unix-epoch functions, the hexadecimal hash functions, the IPv4 conversion pair, the
JSON mutation family, the binary UUID pair and the MariaDB-only names (extended regexp,
nvl/nvl2, the Oracle-compatible date/number conversions, kdf, xxh3/
xxh32, json_detailed/json_compact, the JSON canonicalisation pair
json_equals/json_normalize and sequence access). It also carries the MySQL 8.4
JSON constructor/query catalogue and the ->/->>/MEMBER OF operators
(with the JSON_TABLE shape refusal), the
string, numeric and bit catalogue: bin, export_set, hex, make_set,
oct, ord, quote, soundex, strcmp, the Base64/hex codecs,
weight_string, conv, crc32, log2, rand, truncate,
bit_count and the bit_and/bit_or/bit_xor aggregates, and the
date/time catalogue (adddate/subdate, addtime/subtime,
convert_tz, get_format, time_to_sec and the remaining temporal accessors).
Exposed through MySql; every member is gated per name by the dialect's IMySqlFunctions capability object and rejected by providers that do not opt in. MariaDB supports most of this surface through its composed MySQL renderer, excludes the names it does not implement and adds the MariaDB-only names; MySQL rejects those names with a clear message.
public class MySqlFunctions : CommonFunctions
- Inheritance
-
MySqlFunctions
- Inherited Members
- Extension Methods
Methods
_rowid()
_rowid is refused: the pseudo-column needs a source table with exactly one integer
primary-key column, a table-dependent requirement the function surface cannot validate. On any
other table the server reports error 1054. Referencing this member throws
NotSupportedException in the body as well as when the expression is translated.
public int? _rowid()
Returns
- int?
Never returns; the call is refused when the query is translated.
add_months(DateTime?, int)
add_months(date, months): date shifted by months,
clamped to the last day of a shorter month. MariaDB-only (MariaDB 10.6.1+).
public DateTime? add_months(DateTime? date, int months)
Parameters
Returns
adddate(DateTime?, int?)
adddate(date, days): date plus days calendar days.
This is the numeric-days form only; the INTERVAL unit form is not modelled. MySQL-only;
MariaDB rejects the call.
public DateTime? adddate(DateTime? date, int? days)
Parameters
Returns
addtime(DateTime?, TimeSpan?)
addtime(datetime, time): datetime plus the duration
time. MySQL-only; MariaDB rejects the call.
public DateTime? addtime(DateTime? datetime, TimeSpan? time)
Parameters
Returns
addtime(TimeSpan?, TimeSpan?)
addtime(time1, time2): the sum of two durations. MySQL-only; MariaDB rejects the call.
public TimeSpan? addtime(TimeSpan? time1, TimeSpan? time2)
Parameters
Returns
aes_decrypt(byte[]?, byte[]?)
aes_decrypt(data, key): data decrypted with the AES algorithm and
key. MySQL 8.4 uses aes-128-ecb (ECB) with a 128-bit key by default.
Returns null when either argument is SQL NULL, or when the input is invalid or padded
incorrectly. MySQL-only; MariaDB rejects the call.
public byte[]? aes_decrypt(byte[]? data, byte[]? key)
Parameters
Returns
- byte[]
aes_decrypt(byte[]?, byte[]?, byte[]?)
aes_decrypt(data, key, iv): as the two-argument form, with iv selecting
the CBC mode prescribed by the vendor manual for the three-argument form. MySQL-only.
public byte[]? aes_decrypt(byte[]? data, byte[]? key, byte[]? iv)
Parameters
databyte[]The data to decrypt.
keybyte[]The encryption key.
ivbyte[]The initialisation vector.
Returns
- byte[]
aes_decrypt(byte[]?, byte[]?, byte[]?, string?)
aes_decrypt(data, key, iv, kdf): as the three-argument form, with
kdf choosing the key-derivation function. Which names the server accepts is
validated by the server; this surface only forwards the literal. MySQL-only.
public byte[]? aes_decrypt(byte[]? data, byte[]? key, byte[]? iv, string? kdf)
Parameters
databyte[]The data to decrypt.
keybyte[]The encryption key.
ivbyte[]The initialisation vector.
kdfstringThe key-derivation function name.
Returns
- byte[]
aes_decrypt(byte[]?, byte[]?, byte[]?, string?, byte[]?)
aes_decrypt(data, key, iv, kdf, salt): as the four-argument form, adding the
salt the derived-key forms require. Which KDF names are valid is validated by
the server. MySQL-only.
public byte[]? aes_decrypt(byte[]? data, byte[]? key, byte[]? iv, string? kdf, byte[]? salt)
Parameters
databyte[]The data to decrypt.
keybyte[]The encryption key.
ivbyte[]The initialisation vector.
kdfstringThe key-derivation function name.
saltbyte[]The salt for the derived-key forms.
Returns
- byte[]
aes_decrypt(byte[]?, byte[]?, byte[]?, string?, byte[]?, int?)
aes_decrypt(data, key, iv, kdf, salt, iterations): the derived-key form with the
iterations count. Which KDF names are valid is validated by the server.
MySQL-only.
public byte[]? aes_decrypt(byte[]? data, byte[]? key, byte[]? iv, string? kdf, byte[]? salt, int? iterations)
Parameters
databyte[]The data to decrypt.
keybyte[]The encryption key.
ivbyte[]The initialisation vector.
kdfstringThe key-derivation function name.
saltbyte[]The salt for the derived-key form.
iterationsint?The iteration count for the derived-key form.
Returns
- byte[]
aes_decrypt(byte[]?, byte[]?, byte[]?, string?, byte[]?, string?)
aes_decrypt(data, key, iv, kdf, salt, info): the derived-key form with the
info context value. Which KDF names are valid is validated by the server.
MySQL-only.
public byte[]? aes_decrypt(byte[]? data, byte[]? key, byte[]? iv, string? kdf, byte[]? salt, string? info)
Parameters
databyte[]The data to decrypt.
keybyte[]The encryption key.
ivbyte[]The initialisation vector.
kdfstringThe key-derivation function name.
saltbyte[]The salt for the derived-key form.
infostringThe context info for the derived-key form.
Returns
- byte[]
aes_encrypt(byte[]?, byte[]?)
aes_encrypt(data, key): data encrypted with the AES algorithm and
key. MySQL 8.4 uses aes-128-ecb (ECB) with a 128-bit key by default.
Returns null when either argument is SQL NULL. MySQL-only; MariaDB rejects the call.
public byte[]? aes_encrypt(byte[]? data, byte[]? key)
Parameters
Returns
- byte[]
aes_encrypt(byte[]?, byte[]?, byte[]?)
aes_encrypt(data, key, iv): as the two-argument form, with iv selecting
the CBC mode prescribed by the vendor manual for the three-argument form. MySQL-only.
public byte[]? aes_encrypt(byte[]? data, byte[]? key, byte[]? iv)
Parameters
databyte[]The data to encrypt.
keybyte[]The encryption key.
ivbyte[]The initialisation vector.
Returns
- byte[]
aes_encrypt(byte[]?, byte[]?, byte[]?, string?)
aes_encrypt(data, key, iv, kdf): as the three-argument form, with
kdf choosing the key-derivation function. Which names the server accepts is
validated by the server; this surface only forwards the literal. MySQL-only.
public byte[]? aes_encrypt(byte[]? data, byte[]? key, byte[]? iv, string? kdf)
Parameters
databyte[]The data to encrypt.
keybyte[]The encryption key.
ivbyte[]The initialisation vector.
kdfstringThe key-derivation function name.
Returns
- byte[]
aes_encrypt(byte[]?, byte[]?, byte[]?, string?, byte[]?)
aes_encrypt(data, key, iv, kdf, salt): as the four-argument form, adding the
salt the derived-key forms require. Which KDF names are valid is validated by
the server. MySQL-only.
public byte[]? aes_encrypt(byte[]? data, byte[]? key, byte[]? iv, string? kdf, byte[]? salt)
Parameters
databyte[]The data to encrypt.
keybyte[]The encryption key.
ivbyte[]The initialisation vector.
kdfstringThe key-derivation function name.
saltbyte[]The salt for the derived-key forms.
Returns
- byte[]
aes_encrypt(byte[]?, byte[]?, byte[]?, string?, byte[]?, int?)
aes_encrypt(data, key, iv, kdf, salt, iterations): the derived-key form with the
iterations count. Which KDF names are valid is validated by the server.
MySQL-only.
public byte[]? aes_encrypt(byte[]? data, byte[]? key, byte[]? iv, string? kdf, byte[]? salt, int? iterations)
Parameters
databyte[]The data to encrypt.
keybyte[]The encryption key.
ivbyte[]The initialisation vector.
kdfstringThe key-derivation function name.
saltbyte[]The salt for the derived-key form.
iterationsint?The iteration count for the derived-key form.
Returns
- byte[]
aes_encrypt(byte[]?, byte[]?, byte[]?, string?, byte[]?, string?)
aes_encrypt(data, key, iv, kdf, salt, info): the derived-key form with the
info context value. Which KDF names are valid is validated by the server.
MySQL-only.
public byte[]? aes_encrypt(byte[]? data, byte[]? key, byte[]? iv, string? kdf, byte[]? salt, string? info)
Parameters
databyte[]The data to encrypt.
keybyte[]The encryption key.
ivbyte[]The initialisation vector.
kdfstringThe key-derivation function name.
saltbyte[]The salt for the derived-key form.
infostringThe context info for the derived-key form.
Returns
- byte[]
benchmark(long?, object?)
benchmark(count, expression): evaluates expression
count times and returns 0. The server executes the expression for its
side effects only, so this is a timing probe, not a value function. MySQL-only; MariaDB rejects
the call.
public long? benchmark(long? count, object? expression)
Parameters
Returns
- long?
bin(ulong?)
bin(value): the binary representation of value as an unsigned 64-bit
two's-complement value, without a 0b prefix. MySQL-only.
public string? bin(ulong? value)
Parameters
valueulong?
Returns
bin_to_uuid(byte[]?)
bin_to_uuid(binary): converts the 16-byte binary UUID to its textual representation.
public string? bin_to_uuid(byte[]? binary)
Parameters
binarybyte[]
Returns
binlog_gtid_pos(string?, ulong)
binlog_gtid_pos(file, position): the GTID position of a binary-log file/offset pair, as
domain-server-sequence text. MariaDB-only; the server reports error 1381 when binary
logging is off.
public string? binlog_gtid_pos(string? file, ulong position)
Parameters
Returns
bit_and(byte[]?)
bit_and(value): the bitwise AND of every binary value in the group. MySQL-only.
public byte[]? bit_and(byte[]? value)
Parameters
valuebyte[]
Returns
- byte[]
bit_and(ulong?)
bit_and(value): the bitwise AND of every non-null value in the group, or null when
the group has no rows. MySQL-only.
public ulong? bit_and(ulong? value)
Parameters
valueulong?
Returns
bit_count(byte[]?)
bit_count(value): the number of set bits in the binary value. MySQL-only.
public long? bit_count(byte[]? value)
Parameters
valuebyte[]
Returns
- long?
bit_count(ulong?)
bit_count(value): the number of set bits in the 64-bit representation of
value. MySQL-only.
public long? bit_count(ulong? value)
Parameters
valueulong?
Returns
- long?
bit_or(byte[]?)
bit_or(value): the bitwise OR of every binary value in the group. MySQL-only.
public byte[]? bit_or(byte[]? value)
Parameters
valuebyte[]
Returns
- byte[]
bit_or(ulong?)
bit_or(value): the bitwise OR of every non-null value in the group, or null when
the group has no rows. MySQL-only.
public ulong? bit_or(ulong? value)
Parameters
valueulong?
Returns
bit_xor(byte[]?)
bit_xor(value): the bitwise XOR of every binary value in the group. MySQL-only.
public byte[]? bit_xor(byte[]? value)
Parameters
valuebyte[]
Returns
- byte[]
bit_xor(ulong?)
bit_xor(value): the bitwise XOR of every non-null value in the group, or null when
the group has no rows. MySQL-only.
public ulong? bit_xor(ulong? value)
Parameters
valueulong?
Returns
charset(object?)
charset(expression): the character set of expression. MySQL-only;
MariaDB rejects the call.
public string? charset(object? expression)
Parameters
expressionobjectThe expression whose character set is reported.
Returns
chr(int?)
chr(code): the character with the given code point. MariaDB-only (MySQL spells the same
conversion CHAR()).
public string? chr(int? code)
Parameters
codeint?
Returns
coercibility(object?)
coercibility(expression): the coercibility value MySQL uses to resolve collation conflicts
for expression. MySQL-only; MariaDB rejects the call.
public long? coercibility(object? expression)
Parameters
expressionobjectThe expression whose coercibility is reported.
Returns
- long?
collation(object?)
collation(expression): the collation of expression. MySQL-only;
MariaDB rejects the call.
public string? collation(object? expression)
Parameters
expressionobjectThe expression whose collation is reported.
Returns
column_add(byte[]?, params object?[])
column_add(dynamicColumn, name, value, ...): the dynamic-columns blob with the given
name/value pairs added or replaced. MariaDB-only.
public byte[]? column_add(byte[]? dynamicColumn, params object?[] keyValues)
Parameters
Returns
- byte[]
column_check(byte[]?)
column_check(dynamicColumn): 1 when the dynamic-columns blob is well formed.
MariaDB-only.
public int? column_check(byte[]? dynamicColumn)
Parameters
dynamicColumnbyte[]
Returns
- int?
column_create(params object?[])
column_create(name, value, ...): the MariaDB dynamic-columns blob built from the given
name/value pairs. MariaDB-only.
public byte[]? column_create(params object?[] keyValues)
Parameters
keyValuesobject[]
Returns
- byte[]
column_default<TValue>(TValue)
default(column): the default value of the named column. The argument must be a column
reference; constants, parameters, casts and computed expressions are refused before SQL is
emitted. MySQL-only; MariaDB rejects the call.
public TValue column_default<TValue>(TValue column)
Parameters
columnTValueThe column whose default is returned.
Returns
- TValue
Type Parameters
TValueThe column's value type.
column_delete(byte[]?, params string?[])
column_delete(dynamicColumn, name, ...): the dynamic-columns blob with the named columns
removed. MariaDB-only.
public byte[]? column_delete(byte[]? dynamicColumn, params string?[] names)
Parameters
Returns
- byte[]
column_exists(byte[]?, string?)
column_exists(dynamicColumn, name): 1 when the named dynamic column exists, otherwise
0. MariaDB-only.
public int? column_exists(byte[]? dynamicColumn, string? name)
Parameters
Returns
- int?
column_get(object?, string)
COLUMN_GET(dynamic_column, 'name' AS type) is refused: the AS type clause is
mandatory and selects the CLR type at parse time, so the clause has no safe compile-time
representation on a scalar function surface. Referencing this member throws
NotSupportedException in the body as well as when the expression is translated.
public object? column_get(object? dynamicColumn, string name)
Parameters
Returns
- object
Never returns; the call is refused when the query is translated.
column_json(byte[]?)
column_json(dynamicColumn): the dynamic-columns blob rendered as a JSON object.
MariaDB-only.
public string? column_json(byte[]? dynamicColumn)
Parameters
dynamicColumnbyte[]
Returns
column_list(byte[]?)
column_list(dynamicColumn): the comma-separated names of the dynamic columns, each quoted
with a backtick. MariaDB-only.
public string? column_list(byte[]? dynamicColumn)
Parameters
dynamicColumnbyte[]
Returns
compress(byte[]?)
compress(value): value compressed with the zlib algorithm, prefixed by
its uncompressed length, or null when the argument is SQL NULL. MySQL-only; MariaDB
rejects the call.
public byte[]? compress(byte[]? value)
Parameters
valuebyte[]The value to compress.
Returns
- byte[]
conv(string?, int?, int?)
conv(value, fromBase, toBase): value re-expressed as a string in the
target base (bases 2–36, and -1 for a signed interpretation). MySQL-only.
public string? conv(string? value, int? fromBase, int? toBase)
Parameters
Returns
convert_tz(DateTime?, string?, string?)
convert_tz(datetime, fromTimeZone, toTimeZone): datetime converted from
the fromTimeZone to the toTimeZone IANA zone, or
null when either zone is unknown to the server. MySQL-only; MariaDB rejects the call.
public DateTime? convert_tz(DateTime? datetime, string? fromTimeZone, string? toTimeZone)
Parameters
Returns
crc32(byte[]?)
crc32(value): the unsigned 32-bit CRC-32 checksum of the binary value, widened to
ulong (the value always fits), or null for SQL NULL. MySQL-only.
public ulong? crc32(byte[]? value)
Parameters
valuebyte[]
Returns
crc32(string?)
crc32(value): the unsigned 32-bit CRC-32 checksum of the text's bytes. MySQL-only.
public ulong? crc32(string? value)
Parameters
valuestring
Returns
crc32c(string?)
crc32c(value): the Castagnoli CRC-32C of value. MariaDB-only.
public uint? crc32c(string? value)
Parameters
valuestring
Returns
- uint?
current_role()
current_role(): the active roles of the current session, or NONE when no role is
active. MySQL-only; MariaDB rejects the call.
public string? current_role()
Returns
date_format(DateTime?, string?)
date_format(value, format): formats the date/time using a MySQL %-style
format string.
public string? date_format(DateTime? value, string? format)
Parameters
Returns
dayname(DateTime?)
dayname(date): the weekday name of date (for example
Wednesday). MySQL-only; MariaDB rejects the call.
public string? dayname(DateTime? date)
Parameters
dateDateTime?
Returns
decode(byte[]?, string?)
decode(value, password): the plaintext of the value ciphertext under
password; the pair of encode. MariaDB-only.
public byte[]? decode(byte[]? value, string? password)
Parameters
Returns
- byte[]
decode_histogram(string?, string?)
decode_histogram(bucket, value): the bucket fractions of a stored histogram decoded for
value. MariaDB-only.
public string? decode_histogram(string? bucket, string? value)
Parameters
Returns
decode_oracle(object?, object?, string?, params object?[])
decode_oracle(expression, search, result, ...): the result of the first matching
search, or the trailing default (or null when there is none). MariaDB-only; the
vendor spelling is DECODE(...).
public string? decode_oracle(object? expression, object? search, string? result, params object?[] rest)
Parameters
Returns
des_decrypt(byte[]?)
des_decrypt(value): the plaintext of the value DES ciphertext under the
first key of the server's DES key file. MariaDB-only; removed in MariaDB 13.0.
public byte[]? des_decrypt(byte[]? value)
Parameters
valuebyte[]
Returns
- byte[]
des_decrypt(byte[]?, string?)
des_decrypt(value, key): the plaintext of the value DES ciphertext under
the literal key. MariaDB-only; removed in MariaDB 13.0.
public byte[]? des_decrypt(byte[]? value, string? key)
Parameters
Returns
- byte[]
des_encrypt(string?)
des_encrypt(value): the DES ciphertext under the first key of the server's DES key file.
MariaDB-only; removed in MariaDB 13.0.
public byte[]? des_encrypt(string? value)
Parameters
valuestring
Returns
- byte[]
des_encrypt(string?, string?)
des_encrypt(value, key): the DES ciphertext under the literal key.
MariaDB-only; removed in MariaDB 13.0.
public byte[]? des_encrypt(string? value, string? key)
Parameters
Returns
- byte[]
elt<T>(int, params T?[])
elt(index, values...): the index-th (1-based) element of the
values list, or null when the index is out of range.
public T? elt<T>(int index, params T?[] values)
Parameters
indexintvaluesT[]
Returns
- T
Type Parameters
T
encode(string?, string?)
encode(value, password): the symmetric ciphertext of value under
password; the historical pair of decode. MariaDB-only.
public byte[]? encode(string? value, string? password)
Parameters
Returns
- byte[]
encrypt(string?)
encrypt(value): the Unix crypt() hash of value with a random
two-character salt. MariaDB-only.
public byte[]? encrypt(string? value)
Parameters
valuestring
Returns
- byte[]
encrypt(string?, string?)
encrypt(value, salt): the Unix crypt() hash of value with the
two-character salt, which makes the result deterministic. MariaDB-only.
public byte[]? encrypt(string? value, string? salt)
Parameters
Returns
- byte[]
export_set(ulong?, string?, string?)
export_set(bits, on, off): builds a string by reading the bits of bits
from the least significant upward, appending on for a set bit and
off for a clear one, joined by a comma for 64 bits. MySQL-only; the
separator and count are supplied by the longer overloads.
public string? export_set(ulong? bits, string? on, string? off)
Parameters
Returns
export_set(ulong?, string?, string?, string?)
export_set(bits, on, off, separator): the same bit-string construction with an explicit
separator and the default 64-bit count. MySQL-only.
public string? export_set(ulong? bits, string? on, string? off, string? separator)
Parameters
Returns
export_set(ulong?, string?, string?, string?, int?)
export_set(bits, on, off, separator, count): the same bit-string construction for
count bits. MySQL-only; a constant count outside
[0, 64] is refused before SQL is generated.
public string? export_set(ulong? bits, string? on, string? off, string? separator, int? count)
Parameters
Returns
field<T>(T?, params T?[])
field(value, values...): the 1-based index of value in the
values list, or 0 when it is absent.
public int? field<T>(T? value, params T?[] values)
Parameters
valueTvaluesT[]
Returns
- int?
Type Parameters
T
find_in_set(string?, string?)
find_in_set(value, set): the 1-based position of value in the
comma-separated set, or 0 when it is absent (and null when
either argument is null).
public int? find_in_set(string? value, string? set)
Parameters
Returns
- int?
format(decimal?, int)
format(value, decimals): formats the number with a thousands separator and
decimals fractional digits (returns a string).
public string? format(decimal? value, int decimals)
Parameters
Returns
format_pico_time(long?)
format_pico_time(picoseconds): the duration rendered with the largest fitting unit.
MariaDB-only.
public string? format_pico_time(long? picoseconds)
Parameters
picosecondslong?
Returns
found_rows()
found_rows(): the row count the last SELECT would have returned without its
LIMIT. The value depends on the session that ran that statement. MySQL-only; MariaDB
rejects the call.
public long? found_rows()
Returns
- long?
from_base64(string?)
from_base64(value): the binary value decoded from the Base64 text, or null when the
text is not valid Base64. MySQL-only.
public byte[]? from_base64(string? value)
Parameters
valuestring
Returns
- byte[]
from_days(long?)
from_days(days): the date corresponding to the day number
days (days since year 0). MySQL-only; MariaDB rejects the call.
public DateTime? from_days(long? days)
Parameters
dayslong?
Returns
from_unixtime(long?)
from_unixtime(unixTimestamp): converts a Unix epoch (seconds) to a date/time in the
session time zone.
public DateTime? from_unixtime(long? unixTimestamp)
Parameters
unixTimestamplong?
Returns
get_format(MySqlFormatKind, string?)
get_format(kind, format): the MySQL %-style format string for the platform format
named format (USA, JIS, ISO, EUR or
INTERNAL) of the kind family. Both arguments must be compile-time
constants; an invalid pair is refused before SQL is generated. MySQL-only; MariaDB rejects the
call.
public string? get_format(MySqlFormatKind kind, string? format)
Parameters
kindMySqlFormatKindformatstringThe platform format name, as a compile-time literal.
Returns
grouping(params object?[])
grouping(expressions...): the rollup grouping bitmap for the given expressions, for use
with GROUP BY ... WITH ROLLUP. Every argument must exactly match an expression of the
GROUP BY clause; that rule is a caller obligation the expression translator cannot check
because it never sees the grouping list. MySQL-only; MariaDB rejects the call.
public long? grouping(params object?[] expressions)
Parameters
expressionsobject[]The grouped expressions, in the
GROUP BYorder.
Returns
- long?
hex(byte[]?)
hex(value): the hexadecimal representation of the binary value. MySQL-only.
public string? hex(byte[]? value)
Parameters
valuebyte[]
Returns
hex(ulong?)
hex(value): the 16-digit hexadecimal representation of a 64-bit integer. MySQL-only.
public string? hex(ulong? value)
Parameters
valueulong?
Returns
hex(string?)
hex(value): the hexadecimal representation of the text's bytes. MySQL-only.
public string? hex(string? value)
Parameters
valuestring
Returns
icu_version()
icu_version(): the ICU library version the server was built with, or an empty string when
it was built without ICU. MySQL-only; MariaDB rejects the call.
public string? icu_version()
Returns
inet_aton(string?)
inet_aton(value): the numeric (network-order) representation of the dotted-quad IPv4
address value.
public long? inet_aton(string? value)
Parameters
valuestring
Returns
- long?
inet_ntoa(long?)
inet_ntoa(value): the dotted-quad IPv4 address for the numeric
value.
public string? inet_ntoa(long? value)
Parameters
valuelong?
Returns
is_uuid(string?)
is_uuid(value): 1 when value is a syntactically valid string
UUID, otherwise 0 (and null when the argument is SQL NULL). MySQL-only; MariaDB
rejects the call.
public long? is_uuid(string? value)
Parameters
valuestringThe string to validate as a UUID.
Returns
- long?
json_array(params object?[])
json_array(values...): a JSON array of the arguments (each argument is a SQL value, so
strings become JSON strings). MySQL-only; MariaDB rejects the call.
public string? json_array(params object?[] values)
Parameters
valuesobject[]
Returns
json_array_append(string?, string?, string?)
json_array_append(json, path, value): appends the value to the array at path.
public string? json_array_append(string? json, string? path, string? value)
Parameters
Returns
json_array_insert(string?, string?, string?)
json_array_insert(json, path, value): inserts the value into the array at path without replacing an existing element.
public string? json_array_insert(string? json, string? path, string? value)
Parameters
Returns
json_array_intersect(string?, string?, params string?[])
json_array_intersect(json, json, ...): the array of elements common to every argument array.
MariaDB-only (MariaDB 11.2+).
public string? json_array_intersect(string? first, string? second, params string?[] rest)
Parameters
Returns
json_arrayagg(object?)
json_arrayagg(value): aggregates the group's values into a single JSON array. MySQL-only;
MariaDB rejects the call.
public string? json_arrayagg(object? value)
Parameters
valueobject
Returns
json_arrow(string?, string)
column -> path: the value at the JSON path of the
column. MySQL requires a column identifier on the left and a string literal
on the right, so column must be a mapped column and path a
compile-time string; any other shape is refused before SQL is emitted. MySQL-only; MariaDB
rejects the call.
public string? json_arrow(string? column, string path)
Parameters
Returns
json_arrow_text(string?, string)
column ->> path: the unquoted value at the JSON path of the
column (equivalent to JSON_UNQUOTE(JSON_EXTRACT(column, path))). The
same column/literal restrictions as json_arrow(string?, string) apply. MySQL-only; MariaDB rejects
the call.
public string? json_arrow_text(string? column, string path)
Parameters
Returns
json_compact(string?)
json_compact(json): the JSON document with all unnecessary whitespace removed.
MariaDB-only.
public string? json_compact(string? json)
Parameters
jsonstring
Returns
json_contains(string?, string?)
json_contains(target, candidate): 1 when candidate is contained
in target, otherwise 0. MySQL-only; MariaDB rejects the call.
public long? json_contains(string? target, string? candidate)
Parameters
Returns
- long?
json_contains(string?, string?, string?)
json_contains(target, candidate, path): 1 when candidate is
contained in the value at path of target, otherwise
0. MySQL-only; MariaDB rejects the call.
public long? json_contains(string? target, string? candidate, string? path)
Parameters
Returns
- long?
json_contains_path(string?, string, params string?[])
json_contains_path(json, one_or_all, paths...): 1 when the document contains the
paths, otherwise 0. oneOrAll must be the compile-time literal
"one" or "all" and every path a compile-time string literal; any other shape is
refused before SQL is emitted. MySQL-only; MariaDB rejects the call.
public long? json_contains_path(string? json, string oneOrAll, params string?[] paths)
Parameters
Returns
- long?
json_depth(string?)
json_depth(json): the maximum nesting depth of the JSON document.
public int? json_depth(string? json)
Parameters
jsonstring
Returns
- int?
json_detailed(string?)
json_detailed(json): the JSON document re-indented for readability. MariaDB-only.
public string? json_detailed(string? json)
Parameters
jsonstring
Returns
json_equals(string?, string?)
json_equals(json1, json2): 1 when the two JSON documents are equal (object key
order does not matter), 0 when they differ, and null when either argument is SQL
NULL. MariaDB-only.
public int? json_equals(string? json1, string? json2)
Parameters
Returns
- int?
json_insert(string?, string?, string?)
json_insert(json, path, value): inserts the value at path, keeping any existing value.
public string? json_insert(string? json, string? path, string? value)
Parameters
Returns
json_key_value(string?, string?)
json_key_value(json, path): the key/value pairs of the object selected by the JSON
path, as a JSON array. MariaDB-only (MariaDB 11.2+).
public string? json_key_value(string? json, string? path)
Parameters
Returns
json_keys(string?)
json_keys(json): the top-level keys of the JSON object as a JSON array.
public string? json_keys(string? json)
Parameters
jsonstring
Returns
json_length(string?)
json_length(json): the number of elements in the top-level JSON array or object.
public int? json_length(string? json)
Parameters
jsonstring
Returns
- int?
json_loose(string?)
json_loose(json): the JSON document re-formatted with readable whitespace but without the
strict validity check. MariaDB-only.
public string? json_loose(string? json)
Parameters
jsonstring
Returns
json_merge(string?, string?, params string?[])
json_merge(first, second, rest...): merges the JSON documents, preserving duplicate keys.
MySQL deprecates JSON_MERGE() in favour of JSON_MERGE_PATCH() and
JSON_MERGE_PRESERVE(). MySQL-only; MariaDB rejects the call.
public string? json_merge(string? first, string? second, params string?[] rest)
Parameters
Returns
json_merge_patch(string?, string?)
json_merge_patch(json, other): merges two JSON documents using the RFC 7396 merge-patch algorithm.
public string? json_merge_patch(string? json, string? other)
Parameters
Returns
json_merge_preserve(string?, string?)
json_merge_preserve(json, other): merges two JSON documents, preserving duplicate keys.
public string? json_merge_preserve(string? json, string? other)
Parameters
Returns
json_normalize(string?)
json_normalize(json): the canonical text of the JSON document with sorted object keys and
no unnecessary whitespace (idempotent), or null when json is SQL NULL.
MariaDB-only.
public string? json_normalize(string? json)
Parameters
jsonstring
Returns
json_object(params object?[])
json_object(keyValues...): a JSON object built from the alternating key/value arguments;
the key positions must be strings and the argument count even, which is validated before any SQL
is emitted. MySQL-only; MariaDB rejects the call.
public string? json_object(params object?[] keyValues)
Parameters
keyValuesobject[]
Returns
json_object_filter_keys(string?, params string?[])
json_object_filter_keys(json, keys...): the object reduced to the named keys, or an empty
object when none is present. MariaDB-only (MariaDB 11.2+).
public byte[]? json_object_filter_keys(string? json, params string?[] keys)
Parameters
Returns
- byte[]
json_object_to_array(string?)
json_object_to_array(json): the object as an array of [key, value] pairs.
MariaDB-only (MariaDB 11.2+).
public byte[]? json_object_to_array(string? json)
Parameters
jsonstring
Returns
- byte[]
json_objectagg(string?, object?)
json_objectagg(key, value): aggregates the group's key/value pairs into a single JSON
object. MySQL-only; MariaDB rejects the call.
public string? json_objectagg(string? key, object? value)
Parameters
Returns
json_overlaps(string?, string?)
json_overlaps(left, right): 1 when the two JSON documents have at least one value
in common, otherwise 0. MySQL-only; MariaDB rejects the call.
public long? json_overlaps(string? left, string? right)
Parameters
Returns
- long?
json_pretty(string?)
json_pretty(json): the JSON document re-indented for readability. MySQL-only; MariaDB
rejects the call.
public string? json_pretty(string? json)
Parameters
jsonstring
Returns
json_quote(string?)
json_quote(value): the argument as a JSON string literal. MySQL-only; MariaDB rejects the
call.
public string? json_quote(string? value)
Parameters
valuestring
Returns
json_remove(string?, string?)
json_remove(json, path): removes the value at path.
public string? json_remove(string? json, string? path)
Parameters
Returns
json_replace(string?, string?, string?)
json_replace(json, path, value): replaces an existing value at path.
public string? json_replace(string? json, string? path, string? value)
Parameters
Returns
json_schema_valid(string?, string?)
json_schema_valid(schema, document): 1 when document validates
against the JSON schema, otherwise 0. MySQL-only; MariaDB rejects the
call.
public long? json_schema_valid(string? schema, string? document)
Parameters
Returns
- long?
json_schema_validation_report(string?, string?)
json_schema_validation_report(schema, document): a JSON report of the validation of
document against the JSON schema. MySQL-only; MariaDB
rejects the call.
public string? json_schema_validation_report(string? schema, string? document)
Parameters
Returns
json_search(string?, string, string?)
json_search(json, one_or_all, search): the path or paths whose string value contains
search, or null when none does. MySQL-only; MariaDB rejects the call.
public string? json_search(string? json, string oneOrAll, string? search)
Parameters
Returns
json_search(string?, string, string?, string?)
json_search(json, one_or_all, search, escape): as
json_search(string?, string, string?) with the escape character; the escape must be
a compile-time single-character literal. MySQL-only; MariaDB rejects the call.
public string? json_search(string? json, string oneOrAll, string? search, string? escape)
Parameters
Returns
json_search(string?, string, string?, string?, params string?[])
json_search(json, one_or_all, search, escape, paths...): as above restricted to the given
paths. oneOrAll must be the compile-time literal "one" or "all"
and every path a compile-time string literal; any other shape is refused before SQL is emitted.
MySQL-only; MariaDB rejects the call.
public string? json_search(string? json, string oneOrAll, string? search, string? escape, params string?[] paths)
Parameters
Returns
json_set(string?, string?, string?)
json_set(json, path, value): inserts or updates the value at path.
public string? json_set(string? json, string? path, string? value)
Parameters
Returns
json_storage_free(string?)
json_storage_free(json): the bytes freed in the binary representation of a MySQL
JSON column value after it was updated in place by JSON_SET, JSON_REPLACE or
JSON_REMOVE. Returns 0 for a literal, a captured value or a column whose update
freed nothing, and null when json is SQL NULL; an argument that is not
valid JSON fails on the server. Server-side only: the count describes MySQL's binary JSON
storage, not a portable JSON-text length, and providers that cannot express the operation reject
the call with NotSupportedException.
public long? json_storage_free(string? json)
Parameters
jsonstring
Returns
- long?
json_storage_size(string?)
json_storage_size(json): the bytes used to store the JSON document (the length of its
binary representation for a column). MySQL-only; MariaDB rejects the call.
public long? json_storage_size(string? json)
Parameters
jsonstring
Returns
- long?
json_table()
JSON_TABLE(...) is a table-producing construct, not a scalar function: it requires a
FROM/join position and a COLUMNS definition list, so no scalar expression can
reference it. The member exists only to carry the refusal; calling it throws
NotSupportedException in the body as well as when the expression is translated,
so a projection the planner folds client-side cannot silently evaluate to null.
public static object? json_table()
Returns
json_type(string?)
json_type(json): the type name of the top-level JSON value.
public string? json_type(string? json)
Parameters
jsonstring
Returns
kdf(string?, string?, string?, string?)
kdf(password, salt, info, kdf_name): derives a key with the named key-derivation function.
MariaDB-only (MariaDB 11.3+).
public byte[]? kdf(string? password, string? salt, string? info, string? kdfName)
Parameters
Returns
- byte[]
last_insert_id()
last_insert_id(): the first automatically generated value produced by the last statement
that inserted into an AUTO_INCREMENT column on this connection. MySQL-only; MariaDB rejects
the call.
public ulong? last_insert_id()
Returns
last_insert_id(ulong?)
last_insert_id(value): sets the session's last-insert identifier to
value and returns it. MySQL-only; MariaDB rejects the call.
public ulong? last_insert_id(ulong? value)
Parameters
valueulong?The identifier to record for the session.
Returns
lastval(string?)
lastval(sequence): the last value generated by the named sequence for the current
connection. MariaDB-only; the sequence name is emitted as an identifier.
public long? lastval(string? sequence)
Parameters
sequencestring
Returns
- long?
lengthb(string?)
lengthb(value): the length of value in bytes. MariaDB-only.
public int? lengthb(string? value)
Parameters
valuestring
Returns
- int?
log2(double?)
log2(value): the base-2 logarithm of value. MySQL-only.
public double? log2(double? value)
Parameters
valuedouble?
Returns
make_set(ulong?, params string?[])
make_set(bits, values...): a comma-separated list of the values whose 1-based position
corresponds to a set bit of bits (the first value for bit 0), or an empty
string when no bit is set (null when bits is SQL NULL). MySQL-only.
public string? make_set(ulong? bits, params string?[] values)
Parameters
Returns
makedate(int?, int?)
makedate(year, dayOfYear): the date built from year and the 1-based
dayOfYear, or null when the day is outside the year. MySQL-only;
MariaDB rejects the call.
public DateTime? makedate(int? year, int? dayOfYear)
Parameters
Returns
maketime(int?, int?, decimal?)
maketime(hour, minute, second): the duration built from the parts, or null when a
part is out of range. MySQL-only; MariaDB rejects the call.
public TimeSpan? maketime(int? hour, int? minute, decimal? second)
Parameters
Returns
md5(string?)
md5(value): the MD5 hash of value as a 32-character hexadecimal string.
public string? md5(string? value)
Parameters
valuestring
Returns
median<T>(T?)
percentile_cont(0.5) within group (order by value) over (...): the median as the native
analytic composition (neither MySQL nor MariaDB has a median function). Complete the call
with Over(...): a partition-only window (or an empty over ()) is supported, while a
window ORDER BY or a frame is refused. The result keeps one row per input row, unlike an
aggregate. MariaDB supports the form (MariaDB 10.3+, double(18,10)); MySQL has neither the
function nor the WITHIN GROUP grammar and refuses the call with
NotSupportedException naming MySQL. Requires
SupportsPercentileWindow.
public WindowFunction<double?> median<T>(T? value)
Parameters
valueTThe value to take the median of.
Returns
- WindowFunction<double?>
The interpolated median of the window, or SQL NULL when the window has no non-null values.
Type Parameters
TThe value expression's type.
member_of(object?, string)
value MEMBER OF (jsonArray): 1 when value is an element of the
JSON array literal jsonArray, otherwise 0. jsonArray
must be a compile-time string literal; any other shape is refused before SQL is emitted.
MySQL-only; MariaDB rejects the call.
public long? member_of(object? value, string jsonArray)
Parameters
Returns
- long?
microsecond(DateTime?)
microsecond(datetime): the microseconds part of datetime
(0–999999). MySQL-only; MariaDB rejects the call.
public long? microsecond(DateTime? datetime)
Parameters
datetimeDateTime?
Returns
- long?
microsecond(TimeSpan?)
microsecond(time): the microseconds part of the duration. MySQL-only; MariaDB rejects
the call.
public long? microsecond(TimeSpan? time)
Parameters
timeTimeSpan?
Returns
- long?
monthname(DateTime?)
monthname(date): the month name of date (for example May).
MySQL-only; MariaDB rejects the call.
public string? monthname(DateTime? date)
Parameters
dateDateTime?
Returns
months_between(DateTime?, DateTime?)
months_between(a, b): the (fractional) number of months between two dates, negative when
a is earlier. MariaDB-only (MariaDB 12.2.1+): an unversioned or older MariaDB
dialect rejects it with NotSupportedException instead of substituting
timestampdiff (integer truncation, no fractional months).
public double? months_between(DateTime? a, DateTime? b)
Parameters
Returns
name_const<TValue>(string?, TValue)
name_const(name, value): returns value under the column label
name. The name must be a compile-time string literal; a non-constant or null
name is refused before SQL is emitted. MySQL-only; MariaDB rejects the call.
public TValue name_const<TValue>(string? name, TValue value)
Parameters
namestringThe column label, as a compile-time literal.
valueTValueThe value to return.
Returns
- TValue
Type Parameters
TValueThe value expression's type.
natural_sort_key(string?)
natural_sort_key(value): a sort key that orders embedded digit runs numerically rather than
lexically. MariaDB-only.
public string? natural_sort_key(string? value)
Parameters
valuestring
Returns
next_value_for(string?)
next value for sequence: the next value of the named sequence. MariaDB-only; the
sequence name is emitted as an identifier.
public long? next_value_for(string? sequence)
Parameters
sequencestring
Returns
- long?
nextval(string?)
nextval(sequence): the next value of the named sequence. MariaDB-only; the
sequence name is emitted as an identifier.
public long? nextval(string? sequence)
Parameters
sequencestring
Returns
- long?
nvl2<T>(T?, T?, T?)
nvl2(value, whenNotNull, whenNull): whenNotNull when
value is not null, otherwise whenNull. MariaDB-only.
public T? nvl2<T>(T? value, T? whenNotNull, T? whenNull)
Parameters
valueTwhenNotNullTwhenNullT
Returns
- T
Type Parameters
T
nvl<T>(T?, T?)
nvl(value, fallback): value when it is not null, otherwise
fallback (a synonym of IFNULL). MariaDB-only.
public T? nvl<T>(T? value, T? fallback)
Parameters
valueTfallbackT
Returns
- T
Type Parameters
T
oct(ulong?)
oct(value): the octal representation of value as an unsigned 64-bit
value. MySQL-only.
public string? oct(ulong? value)
Parameters
valueulong?
Returns
old_password(string?)
old_password(value): the pre-4.1 (16-character) MySQL password hash. MariaDB-only.
public string? old_password(string? value)
Parameters
valuestring
Returns
ord(string?)
ord(value): the numeric code of the leftmost character of value, or
0 for an empty string and null for SQL NULL. A multi-byte character yields the
value MySQL computes from its bytes. MySQL-only.
public long? ord(string? value)
Parameters
valuestring
Returns
- long?
percentile<T>(double, T?)
percentile: not supported by MySQL or MariaDB. The native spellings are the window
CommonFunctions.percentile_cont (interpolated) and
CommonFunctions.percentile_disc (an input value) completed with Over(...), which
differ in whether the result is interpolated; a generic alias would hide that difference.
Referencing this member throws NotSupportedException at translation time, naming the
actual provider. The fraction is a fraction in [0, 1], not a percentage.
public WindowFunction<double?> percentile<T>(double fraction, T? value)
Parameters
fractiondoubleThe percentile fraction, in
[0, 1].valueTThe value to take the percentile of.
Returns
- WindowFunction<double?>
Never returns; the call is refused when the query is translated.
Type Parameters
TThe value expression's type.
period_add(long?, long?)
period_add(period, months): the YYMM/YYYYMM period
period shifted by months. MySQL-only; MariaDB rejects the
call.
public long? period_add(long? period, long? months)
Parameters
Returns
- long?
period_diff(long?, long?)
period_diff(period1, period2): the number of months from period2 to
period1, both in YYMM/YYYYMM form. MySQL-only; MariaDB rejects
the call.
public long? period_diff(long? period1, long? period2)
Parameters
Returns
- long?
previous_value_for(string?)
previous value for sequence: the value the current connection's last
NEXT VALUE FOR produced for the named sequence. MariaDB-only; the
sequence name is emitted as an identifier.
public long? previous_value_for(string? sequence)
Parameters
sequencestring
Returns
- long?
quote(string?)
quote(value): value as a single-quoted SQL literal with embedded
quotes and backslashes escaped, or the four-character word NULL when it is SQL NULL.
MySQL-only.
public string? quote(string? value)
Parameters
valuestring
Returns
rand()
rand(): a random double in [0, 1) for the current session. MySQL-only.
public double? rand()
Returns
rand(long?)
rand(seed): a random double in [0, 1) from the given
seed; the same seed reproduces the same sequence within a session. MySQL-only.
public double? rand(long? seed)
Parameters
seedlong?
Returns
random_bytes(int?)
random_bytes(length): length cryptographically random bytes, or
null when the argument is SQL NULL. MySQL-only; MariaDB rejects the call.
public byte[]? random_bytes(int? length)
Parameters
lengthint?The number of bytes to generate.
Returns
- byte[]
regexp_instr(string?, string?)
regexp_instr(subject, pattern): the 1-based position of the regular-expression match in
value, or 0 when there is none. MariaDB-only.
public int? regexp_instr(string? value, string? pattern)
Parameters
Returns
- int?
regexp_replace(string?, string?, string?)
regexp_replace(subject, pattern, replace): value with every
regular-expression match replaced. MariaDB-only.
public string? regexp_replace(string? value, string? pattern, string? replacement)
Parameters
Returns
regexp_substr(string?, string?)
regexp_substr(subject, pattern): the part of value matching the regular
expression, or an empty string when it does not match. MariaDB-only (MySQL has no
REGEXP_SUBSTR).
public string? regexp_substr(string? value, string? pattern)
Parameters
Returns
row_count()
row_count(): the number of rows affected by the last statement on this connection.
MySQL-only; MariaDB rejects the call.
public long? row_count()
Returns
- long?
rownum()
ROWNUM(): the 1-based position of the row in the result. MariaDB-only, and only the
zero-argument function form — the bare ROWNUM pseudo-column needs sql_mode=ORACLE on
the verified 11.4 baseline and is not exposed.
public ulong? rownum()
Returns
sec_to_time(decimal?)
sec_to_time(seconds): the duration represented by seconds, with a
fractional part when the input has one. MySQL-only; MariaDB rejects the call.
public TimeSpan? sec_to_time(decimal? seconds)
Parameters
secondsdecimal?
Returns
setval(string?, long)
setval(sequence, value): sets the next value to be returned for the named sequence.
MariaDB-only; the sequence name is emitted as an identifier.
public long? setval(string? sequence, long value)
Parameters
Returns
- long?
sformat(string?, params object?[])
sformat(format, values...): the arguments formatted with an fmtlib-style {} format
string. MariaDB-only.
public string? sformat(string? format, params object?[] values)
Parameters
Returns
sha1(string?)
sha1(value): the SHA-1 hash of value as a 40-character hexadecimal string.
public string? sha1(string? value)
Parameters
valuestring
Returns
sha2(string?, int)
sha2(value, hashLength): the SHA-2 hash of value with the digest length
hashLength (224, 256, 384 or 512 bits).
public string? sha2(string? value, int hashLength)
Parameters
Returns
sleep(double?)
sleep(seconds): pauses the statement for seconds and returns 0,
or 1 when the sleep was interrupted. MySQL-only; MariaDB rejects the call.
public long? sleep(double? seconds)
Parameters
secondsdouble?The number of seconds to pause, possibly fractional.
Returns
- long?
soundex(string?)
soundex(value): the Soundex code of value (a four-character string such
as R163), or an empty string when the value contains no alphabetic characters. MySQL-only.
public string? soundex(string? value)
Parameters
valuestring
Returns
statement_digest(string?)
statement_digest(statement): the SHA-256 digest of the normalised statement text, or
null when the argument is SQL NULL. MySQL-only; MariaDB rejects the call.
public string? statement_digest(string? statement)
Parameters
statementstringThe SQL statement text.
Returns
statement_digest_text(string?)
statement_digest_text(statement): the normalised form of the statement text, or
null when the argument is SQL NULL. MySQL-only; MariaDB rejects the call.
public string? statement_digest_text(string? statement)
Parameters
statementstringThe SQL statement text.
Returns
str_to_date(string?, string?)
str_to_date(value, format): parses value using a MySQL
%-style format string.
public DateTime? str_to_date(string? value, string? format)
Parameters
Returns
strcmp(string?, string?)
strcmp(left, right): -1, 0 or 1 as left sorts
before, equal to or after right in the collation, or null when either
argument is SQL NULL. MySQL-only.
public long? strcmp(string? left, string? right)
Parameters
Returns
- long?
subdate(DateTime?, int?)
subdate(date, days): date minus days calendar days.
This is the numeric-days form only; the INTERVAL unit form is not modelled. MySQL-only;
MariaDB rejects the call.
public DateTime? subdate(DateTime? date, int? days)
Parameters
Returns
substring_index(string?, string?, int)
substring_index(value, delimiter, count): the substring before the
count-th occurrence of delimiter (counting from the left
when count is positive, from the right when it is negative).
public string? substring_index(string? value, string? delimiter, int count)
Parameters
Returns
subtime(DateTime?, TimeSpan?)
subtime(datetime, time): datetime minus the duration
time. MySQL-only; MariaDB rejects the call.
public DateTime? subtime(DateTime? datetime, TimeSpan? time)
Parameters
Returns
subtime(TimeSpan?, TimeSpan?)
subtime(time1, time2): the difference of two durations. MySQL-only; MariaDB rejects the
call.
public TimeSpan? subtime(TimeSpan? time1, TimeSpan? time2)
Parameters
Returns
sys_guid()
sys_guid(): a random 32-character hexadecimal identifier. MariaDB-only.
public string? sys_guid()
Returns
time(DateTime?)
time(datetime): the time-of-day part of datetime. MySQL-only; MariaDB
rejects the call.
public TimeSpan? time(DateTime? datetime)
Parameters
datetimeDateTime?
Returns
time(TimeSpan?)
time(time): the duration unchanged, rounded to whole seconds. MySQL-only; MariaDB rejects
the call.
public TimeSpan? time(TimeSpan? time)
Parameters
timeTimeSpan?
Returns
time_format(TimeSpan?, string?)
time_format(time, format): the duration formatted with a MySQL %-style
format string. MySQL-only; MariaDB rejects the call.
public string? time_format(TimeSpan? time, string? format)
Parameters
Returns
time_to_sec(TimeSpan?)
time_to_sec(time): the duration converted to whole seconds. MySQL 8.4 returns an integer
number of seconds, so any sub-second component of the argument is discarded by the server. The
argument is the duration to convert; a SQL NULL argument yields SQL NULL. MySQL-only; MariaDB
rejects the call.
public long? time_to_sec(TimeSpan? time)
Parameters
timeTimeSpan?
Returns
- long?
timediff(DateTime?, DateTime?)
timediff(datetime1, datetime2): the duration from datetime2 to
datetime1. MySQL-only; MariaDB rejects the call.
public TimeSpan? timediff(DateTime? datetime1, DateTime? datetime2)
Parameters
Returns
timediff(TimeSpan?, TimeSpan?)
timediff(time1, time2): the duration from time2 to
time1. MySQL-only; MariaDB rejects the call.
public TimeSpan? timediff(TimeSpan? time1, TimeSpan? time2)
Parameters
Returns
timestamp(DateTime?)
timestamp(datetime): datetime as a DATETIME. MySQL-only;
MariaDB rejects the call.
public DateTime? timestamp(DateTime? datetime)
Parameters
datetimeDateTime?
Returns
timestamp(DateTime?, TimeSpan?)
timestamp(datetime, time): datetime plus the duration
time. MySQL-only; MariaDB rejects the call.
public DateTime? timestamp(DateTime? datetime, TimeSpan? time)
Parameters
Returns
to_base64(byte[]?)
to_base64(value): the Base64 encoding of the binary value, wrapped at 76 characters per
line. MySQL-only.
public string? to_base64(byte[]? value)
Parameters
valuebyte[]
Returns
to_char(DateTime?, string?)
to_char(value, format): formats the date/time using an Oracle-style format string.
MariaDB-only (MariaDB 10.6+).
public string? to_char(DateTime? value, string? format)
Parameters
Returns
to_date(string?, string?)
to_date(value, format): parses a date/time from an Oracle-style format string.
MariaDB-only (MariaDB 12.3+): an unversioned or older MariaDB dialect rejects it with
NotSupportedException instead of substituting str_to_date (% masks,
not Oracle masks).
public DateTime? to_date(string? value, string? format)
Parameters
Returns
to_days(DateTime?)
to_days(date): the day number of date (days since year 0). MySQL-only;
MariaDB rejects the call.
public long? to_days(DateTime? date)
Parameters
dateDateTime?
Returns
- long?
to_number(string?, string?)
to_number(value, format): parses a number from an Oracle-style format string (the result
is a DOUBLE). MariaDB-only (MariaDB 12.2 family; the enforced minimum is 12.2.1): an
unversioned or older MariaDB dialect rejects it with NotSupportedException instead
of substituting a decimal cast, which has no Oracle format model.
public double? to_number(string? value, string? format)
Parameters
Returns
to_seconds(DateTime?)
to_seconds(date): the second number of date (seconds since year 0).
MySQL-only; MariaDB rejects the call.
public long? to_seconds(DateTime? date)
Parameters
dateDateTime?
Returns
- long?
trim_oracle(string?)
trim_oracle(value): Oracle-compatible TRIM, which removes the spaces both leading and
trailing. MariaDB-only.
public string? trim_oracle(string? value)
Parameters
valuestring
Returns
trunc(object?)
TRUNC(...) is refused: the verified MariaDB 11.4 baseline does not implement the name in
default mode or under sql_mode=ORACLE. Referencing this member throws
NotSupportedException in the body as well as when the expression is translated; use
truncate for numeric truncation.
public object? trunc(object? value)
Parameters
valueobjectThe value to truncate; never read.
Returns
- object
Never returns; the call is refused when the query is translated.
truncate(decimal?, int?)
truncate(value, places): value truncated toward zero to
places decimal places (a negative count zeroes the integer part on the left).
MySQL-only.
public decimal? truncate(decimal? value, int? places)
Parameters
Returns
truncate(double?, int?)
truncate(value, places): the same truncation for a floating-point value. MySQL-only.
public double? truncate(double? value, int? places)
Parameters
Returns
uncompress(byte[]?)
uncompress(value): the value decompressed from the COMPRESS format, or null
when the argument is SQL NULL or is not a compressed value. MySQL-only; MariaDB rejects the call.
public byte[]? uncompress(byte[]? value)
Parameters
valuebyte[]The compressed value.
Returns
- byte[]
uncompressed_length(byte[]?)
uncompressed_length(value): the uncompressed length recorded in the COMPRESS header,
or null when the argument is SQL NULL or is not a compressed value. MySQL-only; MariaDB
rejects the call.
public long? uncompressed_length(byte[]? value)
Parameters
valuebyte[]The compressed value.
Returns
- long?
unhex(string?)
unhex(value): the binary value decoded from a pair of hexadecimal digits per byte, or
null when value has an odd length or a non-hexadecimal character.
MySQL-only.
public byte[]? unhex(string? value)
Parameters
valuestring
Returns
- byte[]
unix_timestamp(DateTime?)
unix_timestamp(value): converts the date/time to Unix epoch seconds (or the current
epoch when called without an argument).
public long? unix_timestamp(DateTime? value)
Parameters
valueDateTime?
Returns
- long?
uuid()
uuid() is refused: MySQL generates UUID version 1, while this API's UUID contract is v4
(gen_random_uuid()) or v7 (uuidv7()), and
a v1 value is never substituted for it. Referencing this member throws
NotSupportedException at translation time. Use uuidv7() to generate an
identifier, or UUID() through raw SQL when v1 is genuinely intended.
public Guid? uuid()
Returns
- Guid?
Never returns; the call is refused when the query is translated.
uuid_short()
uuid_short(): a 64-bit unsigned identifier unique to this server instance, derived from
the server start time and a monotonic counter. MySQL-only; MariaDB rejects the call.
public ulong? uuid_short()
Returns
uuid_to_bin(string?)
uuid_to_bin(uuid): converts the textual UUID to its 16-byte binary representation.
public byte[]? uuid_to_bin(string? uuid)
Parameters
uuidstring
Returns
- byte[]
validate_password_strength(string?)
validate_password_strength(password): the server's password-strength grade for
password. Meaningful grading depends on the server's password-validation
configuration: on a server without the validate_password component the call still
executes, but VALIDATE_PASSWORD_STRENGTH('abc') evaluates to 0 and the value
carries no active policy. MySQL-only; MariaDB rejects the call.
public long? validate_password_strength(string? password)
Parameters
passwordstringThe password to grade.
Returns
- long?
values<TValue>(TValue)
values(column) is refused: the name is deprecated in MySQL 8.4 and has no
scalar-expression contract — it refers to the new row only inside the upsert mutation builder.
Referencing this member throws NotSupportedException at translation time; use the
mutation builder's upsert API instead.
public TValue values<TValue>(TValue column)
Parameters
columnTValueThe column to refer to; never read.
Returns
- TValue
Never returns; the call is refused when the query is translated.
Type Parameters
TValueThe column's value type.
vec_distance(object?, object?)
VEC_DISTANCE(left, right) is refused: the vector functions arrived in MariaDB 11.7 and the
verified baseline is 11.4. Referencing this member throws NotSupportedException at
translation time.
public double? vec_distance(object? left, object? right)
Parameters
Returns
- double?
Never returns; the call is refused when the query is translated.
vec_distance_cosine(object?, object?)
VEC_DISTANCE_COSINE(left, right) is refused: the vector functions arrived in MariaDB 11.7
and the verified baseline is 11.4. Referencing this member throws
NotSupportedException at translation time.
public double? vec_distance_cosine(object? left, object? right)
Parameters
Returns
- double?
Never returns; the call is refused when the query is translated.
vec_distance_euclidean(object?, object?)
VEC_DISTANCE_EUCLIDEAN(left, right) is refused: the vector functions arrived in MariaDB
11.7 and the verified baseline is 11.4. Referencing this member throws
NotSupportedException at translation time.
public double? vec_distance_euclidean(object? left, object? right)
Parameters
Returns
- double?
Never returns; the call is refused when the query is translated.
vec_from_text(string?)
VEC_FromText(text) is refused: the vector functions arrived in MariaDB 11.7 and the verified
baseline is 11.4. Referencing this member throws NotSupportedException at
translation time; the dialect never switches to a newer server.
public object? vec_from_text(string? text)
Parameters
textstringThe vector text; never read.
Returns
- object
Never returns; the call is refused when the query is translated.
vec_to_text(object?)
VEC_ToText(vector) is refused: the vector functions arrived in MariaDB 11.7 and the verified
baseline is 11.4. Referencing this member throws NotSupportedException at
translation time.
public string? vec_to_text(object? vector)
Parameters
vectorobjectThe vector value; never read.
Returns
- string
Never returns; the call is refused when the query is translated.
weight_string(string?)
weight_string(value): the weight of value as a binary string. MySQL-only;
MariaDB has no WEIGHT_STRING and rejects the call.
public byte[]? weight_string(string? value)
Parameters
valuestring
Returns
- byte[]
weight_string(string?, MySqlWeightStringCast, int)
weight_string(value as {char|binary}(length)): the weight of value after
padding it (or truncating it) to length characters with spaces
(Char) or bytes with 0x00
(Binary). Both modifiers must be compile-time constants.
MySQL-only; MariaDB rejects the call.
public byte[]? weight_string(string? value, MySqlWeightStringCast cast, int length)
Parameters
valuestringThe string whose weight is computed.
castMySqlWeightStringCastThe padding/truncation unit.
lengthintThe number of characters or bytes; at least
1.
Returns
- byte[]
wsrep_last_seen_gtid()
wsrep_last_seen_gtid(): the GTID of the last write the node received from the cluster,
as domain-server-sequence text. MariaDB-only; readable on a non-Galera server too.
public byte[]? wsrep_last_seen_gtid()
Returns
- byte[]
wsrep_last_written_gtid()
wsrep_last_written_gtid(): the GTID of the last write the node applied locally.
MariaDB-only; readable on a non-Galera server too.
public byte[]? wsrep_last_written_gtid()
Returns
- byte[]
wsrep_sync_wait_upto_gtid(string?)
wsrep_sync_wait_upto_gtid(gtid): waits until the node has applied up to
gtid, returning 1. MariaDB-only.
public string? wsrep_sync_wait_upto_gtid(string? gtid)
Parameters
gtidstring
Returns
xxh3(string?)
xxh3(value): the fast 64-bit xxHash of a text value. MariaDB-only (MariaDB 13.1+).
public ulong? xxh3(string? value)
Parameters
valuestring
Returns
xxh32(string?)
xxh32(value): the fast 32-bit xxHash of a text value, widened to a long
(the unsigned 32-bit result always fits). MariaDB-only (MariaDB 13.1+).
public long? xxh32(string? value)
Parameters
valuestring
Returns
- long?
yearweek(DateTime?)
yearweek(date): the year and week of date under the default week
mode. MySQL-only; MariaDB rejects the call.
public long? yearweek(DateTime? date)
Parameters
dateDateTime?
Returns
- long?
yearweek(DateTime?, int?)
yearweek(date, mode): the year and week of date under the given
week mode. MySQL-only; MariaDB rejects the call.
public long? yearweek(DateTime? date, int? mode)
Parameters
Returns
- long?