Functions

The following functions are supported by Opteryx. Click a name for details.

Array Functions

Conversion Functions

  • HUMANIZE — Format number in human-readable form.

Date & Time Functions

Hash & Encoding Functions

Numeric Functions

  • ABS — Absolute value.
  • CEILING — Round up to nearest integer.
  • E — Euler's number e.
  • FLOOR — Round down to nearest integer.
  • LOG — Logarithm with arbitrary base.
  • PHI — Golden ratio φ.
  • PI — Mathematical constant π.
  • POWER — Raise base to exponent (SQL-92).
  • ROUND — Round to nearest integer.
  • SIGN — Sign of number (-1, 0, 1).
  • SQRT — Square root.
  • TRUNC — Truncate a numeric or temporal value.

String Functions

  • ASCII — Return ASCII codepoint of first character.
  • CHAR — Convert codepoint to character.
  • CONCAT — Concatenate strings.
  • CONCAT_WS — Concatenate with separator.
  • INITCAP — Capitalise first letter of each word.
  • LEFT — Return leftmost N characters.
  • LENGTH — Return length of string.
  • LEVENSHTEIN — Levenshtein edit distance between two strings.
  • LOWER — Convert string to lowercase.
  • LPAD — Left-pad string to width.
  • LTRIM — Trim leading characters.
  • MATCH — Full-text match.
  • POSITION — Find position of substring.
  • REGEXP_REPLACE — Replace regex matches.
  • REPLACE — Replace occurrences of substring.
  • REVERSE — Reverse a string.
  • RIGHT — Return rightmost N characters.
  • RPAD — Right-pad string to width.
  • RTRIM — Trim trailing characters.
  • SOUNDEX — Return Soundex phonetic code.
  • SPLIT — Split string into array.
  • SUBSTRING — Extract substring.
  • TRIM — Trim leading and trailing characters.
  • UPPER — Convert string to uppercase.

Struct/JSON Functions

Utility Functions

  • COALESCE — Return first non-null argument.
  • CONNECTION_ID — Current connection identifier.
  • DATABASE — Current database name.
  • IFNOTNULL — Return second argument if first is not null.
  • IFNULL — Return value if not null, else default.
  • IIF — Inline if: return second or third arg based on condition.
  • NORMAL — Generate normally-distributed random numbers.
  • NULLIF — Return null if equal, else first value.
  • RANDOM — Generate random numbers.
  • RANDOM_STRING — Generate random strings.
  • USER — Current user name.
  • UTC_TIMESTAMP — Current UTC timestamp.
  • VERSION — Database version string.

Vector / Embedding Functions