BASE64_ENCODE()

All functions > STRING > BASE64_ENCODE()

Encodes a string as standard Base64 text.

Signatures

Returns: Base64-encoded representation

BASE64_ENCODE(string: VARCHAR) → VARCHAR
sql
ParameterTypeRequiredDescription
stringVARCHARYesInput text to encode

Notes

  • Uses the usual Base64 alphabet with padding
  • Operates on the underlying byte representation of the text
  • Returns NULL if the input is NULL (use NULL(VARCHAR); bare NULL fails inference)
  • Pair with BASE64_DECODE to recover the original string when the payload is valid Base64

See also

Examples

FeatureQL
SELECT
    f1 := BASE64_ENCODE('hello'), -- ASCII text
    f2 := BASE64_ENCODE(''), -- Empty string
    f3 := BASE64_ENCODE(NULL(VARCHAR)) -- NULL yields NULL
;
Result
f1 VARCHARf2 VARCHARf3 VARCHAR
aGVsbG8=(empty)NULL

Last update at: 2026/05/26 17:22:09