Strings: Difference between revisions

From MemCP
Jump to navigation Jump to search
No edit summary
(Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference)
 
Line 1: Line 1:
<!-- Copyright (C) 2026 Carl-Philip Haensch -->
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
<span id="strings"></span>
= Strings =
= Strings =


The '''Strings''' module provides comprehensive string manipulation and processing functions for the SCM programming language. This module includes:
<!-- Generated from MemCP c42e19eba on 2026-08-27; do not edit manually. -->
 
<div class="mw-message-box mw-message-box-notice">Generated from MemCP commit <code>c42e19eba</code> on 27 August 2026. See [[Full SCM API documentation]].</div>
* '''String validation''': Functions to check string types and properties (string?, strlen)
* '''String manipulation''': Concatenation (concat), substring extraction (substr), and case conversion (toLower, toUpper)
* '''Pattern matching''': Wildcard pattern matching (strlike) and string replacement (replace)
* '''String parsing''': Splitting strings (split) and data type simplification (simplify)
* '''Encoding/Decoding''': URL encoding/decoding, HTML entities, JSON processing, and binary conversion
* '''Internationalization''': Collation support for natural sorting and language-specific comparisons


These functions provide the essential tools for text processing, data formatting, and string-based operations in SCM programs.
The '''Strings''' module provides text and binary-string processing for Scheme and SQL compatibility. It includes:


← Back to [[Full SCM API documentation]]
* validation, length, concatenation, slicing, padding, trimming, and case conversion;
* splitting, searching, replacement, wildcard/regular-expression matching, and simplification;
* locale-aware collation and natural ordering;
* URL, HTML, Base64, hexadecimal, JSON, BSON, and SQL-string conversion;
* hashes, checksums, random data, and SQL-dialect compatibility functions.


Indexing and length semantics can differ between bytes and Unicode characters; consult each function's parameter description rather than assuming one unit for every operation.


<span id="string"></span>
<span id="string"></span>
Line 30: Line 33:
=== Returns ===
=== Returns ===


<code>bool</code>
* '''value''' (<code>bool</code>)


== concat ==
== concat ==
Line 47: Line 50:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== sql_concat ==
== sql_concat ==
Line 64: Line 67:
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== substr ==
== substr ==
Line 82: Line 85:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== sql_substr ==
== sql_substr ==
Line 100: Line 103:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== simplify ==
== simplify ==


turns a stringable input value in the easiest-most value (e.g. turn strings into numbers if they are numeric
Converts numeric text to a number. Text beginning with { or [ becomes a native JSON value when it is valid JSON; other input remains a string.


'''Allowed number of parameters:''' 1–1
'''Allowed number of parameters:''' 1–1
Line 111: Line 114:
=== Parameters ===
=== Parameters ===


* '''value''' (<code>any</code>): value to simplify
* '''value''' (<code>any</code>): value to interpret as a number or JSON value


<span id="returns-5"></span>
<span id="returns-5"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== strlen ==
== strlen ==
Line 132: Line 135:
=== Returns ===
=== Returns ===


<code>int</code>
* '''value''' (<code>int</code>)


== strlike ==
== strlike ==
Line 150: Line 153:
=== Returns ===
=== Returns ===


<code>bool</code>
* '''value''' (<code>bool</code>)


== strlike_cs ==
== strlike_cs ==
Line 168: Line 171:
=== Returns ===
=== Returns ===


<code>bool</code>
* '''value''' (<code>bool</code>)


<span id="tolower"></span>
<span id="tolower"></span>
Line 185: Line 188:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


<span id="toupper"></span>
<span id="toupper"></span>
Line 202: Line 205:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== replace ==
== replace ==
Line 220: Line 223:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== strtrim ==
== strtrim ==
Line 236: Line 239:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== strltrim ==
== strltrim ==
Line 252: Line 255:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== strrtrim ==
== strrtrim ==
Line 268: Line 271:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== sql_trim ==
== sql_trim ==
Line 284: Line 287:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== sql_ltrim ==
== sql_ltrim ==
Line 300: Line 303:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== sql_rtrim ==
== sql_rtrim ==
Line 316: Line 319:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== split ==
== split ==
Line 333: Line 336:
=== Returns ===
=== Returns ===


<code>list</code>
* '''value''' (<code>list</code>)


== string_repeat ==
== string_repeat ==
Line 350: Line 353:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== collate ==
== collate ==
Line 367: Line 370:
=== Returns ===
=== Returns ===


<code>func(a:any, b:any) -&gt; bool</code>
* '''relation''' (<code>func</code>): compares two values using the selected collation and direction
** '''Parameters'''
*** '''a''' (<code>any</code>): left operand
*** '''b''' (<code>any</code>): right operand
** '''Returns'''
*** '''ordered''' (<code>bool</code>): whether a sorts before b


== htmlentities ==
== htmlentities ==
Line 383: Line 391:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== urlencode ==
== urlencode ==
Line 399: Line 407:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== urldecode ==
== urldecode ==
Line 415: Line 423:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== json_encode ==
== json_encode ==
Line 431: Line 439:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== json_quote ==
== json_quote ==
Line 442: Line 450:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-25"></span>
<span id="returns-25"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_encode_assoc ==
== json_encode_assoc ==
Line 463: Line 471:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== json_decode ==
== json_decode ==
Line 479: Line 487:
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_decode_scmer ==
== json_decode_scmer ==
Line 495: Line 503:
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== base64_encode ==
== base64_encode ==
Line 511: Line 519:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== base64_decode ==
== base64_decode ==
Line 527: Line 535:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== sql_unescape ==
== sql_unescape ==
Line 543: Line 551:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== bin2hex ==
== bin2hex ==
Line 559: Line 567:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


<span id="bin2hex-1"></span>
<span id="bin2hex-1"></span>
Line 576: Line 584:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== hex2bin ==
== hex2bin ==
Line 592: Line 600:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== uuid ==
== uuid ==
Line 608: Line 616:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


<span id="randombytes"></span>
<span id="randombytes"></span>
Line 625: Line 633:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== regexp_replace ==
== regexp_replace ==
Line 643: Line 651:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== fnv_hash ==
== fnv_hash ==
Line 659: Line 667:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== stable_structural_hash ==
== stable_structural_hash ==
Line 676: Line 684:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== sha1 ==
== sha1 ==
Line 692: Line 700:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== sha256 ==
== sha256 ==
Line 708: Line 716:
=== Returns ===
=== Returns ===


<code>string</code>
* '''value''' (<code>string</code>)


== regexp_test ==
== regexp_test ==
Line 725: Line 733:
=== Returns ===
=== Returns ===


<code>bool</code>
* '''value''' (<code>bool</code>)


== json_parse_bson ==
== json_parse_bson ==
Line 736: Line 744:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-43"></span>
<span id="returns-43"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_array ==
== json_array ==
Line 752: Line 760:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-44"></span>
<span id="returns-44"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_object ==
== json_object ==
Line 768: Line 776:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-45"></span>
<span id="returns-45"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


<span id="json_quote-1"></span>
<span id="json_quote-1"></span>
Line 785: Line 793:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-46"></span>
<span id="returns-46"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_unquote ==
== json_unquote ==
Line 801: Line 809:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-47"></span>
<span id="returns-47"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_valid ==
== json_valid ==
Line 817: Line 825:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-48"></span>
<span id="returns-48"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_type ==
== json_type ==
Line 833: Line 841:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-49"></span>
<span id="returns-49"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_depth ==
== json_depth ==
Line 849: Line 857:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-50"></span>
<span id="returns-50"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_length ==
== json_length ==
Line 865: Line 873:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-51"></span>
<span id="returns-51"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_extract ==
== json_extract ==
Line 881: Line 889:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-52"></span>
<span id="returns-52"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_keys ==
== json_keys ==
Line 897: Line 905:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-53"></span>
<span id="returns-53"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_contains_path ==
== json_contains_path ==
Line 913: Line 921:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-54"></span>
<span id="returns-54"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_contains ==
== json_contains ==
Line 929: Line 937:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-55"></span>
<span id="returns-55"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_overlaps ==
== json_overlaps ==
Line 945: Line 953:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-56"></span>
<span id="returns-56"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_member_of ==
== json_member_of ==
Line 961: Line 969:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-57"></span>
<span id="returns-57"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_pretty ==
== json_pretty ==
Line 977: Line 985:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-58"></span>
<span id="returns-58"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_storage_size ==
== json_storage_size ==
Line 993: Line 1,001:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-59"></span>
<span id="returns-59"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_storage_free ==
== json_storage_free ==
Line 1,009: Line 1,017:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-60"></span>
<span id="returns-60"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_schema_valid ==
== json_schema_valid ==
Line 1,025: Line 1,033:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-61"></span>
<span id="returns-61"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_schema_validation_report ==
== json_schema_validation_report ==
Line 1,041: Line 1,049:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-62"></span>
<span id="returns-62"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_set ==
== json_set ==
Line 1,057: Line 1,065:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-63"></span>
<span id="returns-63"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_insert ==
== json_insert ==
Line 1,073: Line 1,081:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-64"></span>
<span id="returns-64"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_replace ==
== json_replace ==
Line 1,089: Line 1,097:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-65"></span>
<span id="returns-65"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_remove ==
== json_remove ==
Line 1,105: Line 1,113:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-66"></span>
<span id="returns-66"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_array_append ==
== json_array_append ==
Line 1,121: Line 1,129:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-67"></span>
<span id="returns-67"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_array_insert ==
== json_array_insert ==
Line 1,137: Line 1,145:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-68"></span>
<span id="returns-68"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_merge_patch ==
== json_merge_patch ==
Line 1,153: Line 1,161:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-69"></span>
<span id="returns-69"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_merge_preserve ==
== json_merge_preserve ==
Line 1,169: Line 1,177:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-70"></span>
<span id="returns-70"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_search ==
== json_search ==
Line 1,185: Line 1,193:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-71"></span>
<span id="returns-71"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_value ==
== json_value ==
Line 1,201: Line 1,209:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-72"></span>
<span id="returns-72"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_to_json ==
== pg_to_json ==
Line 1,217: Line 1,225:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-73"></span>
<span id="returns-73"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_row_to_json ==
== pg_row_to_json ==
Line 1,233: Line 1,241:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-74"></span>
<span id="returns-74"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_build_array ==
== pg_json_build_array ==
Line 1,249: Line 1,257:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-75"></span>
<span id="returns-75"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_array_absent ==
== pg_json_array_absent ==
Line 1,265: Line 1,273:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-76"></span>
<span id="returns-76"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_build_object ==
== pg_json_build_object ==
Line 1,281: Line 1,289:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-77"></span>
<span id="returns-77"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_object ==
== pg_json_object ==
Line 1,297: Line 1,305:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-78"></span>
<span id="returns-78"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_serialize ==
== pg_json_serialize ==
Line 1,313: Line 1,321:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-79"></span>
<span id="returns-79"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_array_length ==
== pg_json_array_length ==
Line 1,329: Line 1,337:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-80"></span>
<span id="returns-80"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_extract_path ==
== pg_json_extract_path ==
Line 1,345: Line 1,353:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-81"></span>
<span id="returns-81"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_extract_path_text ==
== pg_json_extract_path_text ==
Line 1,361: Line 1,369:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-82"></span>
<span id="returns-82"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_set ==
== pg_jsonb_set ==
Line 1,377: Line 1,385:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-83"></span>
<span id="returns-83"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_set_lax ==
== pg_jsonb_set_lax ==
Line 1,393: Line 1,401:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-84"></span>
<span id="returns-84"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_insert ==
== pg_jsonb_insert ==
Line 1,409: Line 1,417:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-85"></span>
<span id="returns-85"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_strip_nulls ==
== pg_json_strip_nulls ==
Line 1,425: Line 1,433:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-86"></span>
<span id="returns-86"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_typeof ==
== pg_json_typeof ==
Line 1,441: Line 1,449:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-87"></span>
<span id="returns-87"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_populate_record_valid ==
== pg_jsonb_populate_record_valid ==
Line 1,457: Line 1,465:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-88"></span>
<span id="returns-88"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_concat ==
== pg_jsonb_concat ==
Line 1,473: Line 1,481:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-89"></span>
<span id="returns-89"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_delete ==
== pg_jsonb_delete ==
Line 1,489: Line 1,497:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-90"></span>
<span id="returns-90"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_delete_path ==
== pg_jsonb_delete_path ==
Line 1,505: Line 1,513:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-91"></span>
<span id="returns-91"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_subtract ==
== pg_subtract ==
Line 1,521: Line 1,529:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-92"></span>
<span id="returns-92"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_exists ==
== pg_jsonb_exists ==
Line 1,537: Line 1,545:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-93"></span>
<span id="returns-93"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_path_exists ==
== pg_jsonb_path_exists ==
Line 1,553: Line 1,561:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-94"></span>
<span id="returns-94"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_path_match ==
== pg_jsonb_path_match ==
Line 1,569: Line 1,577:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-95"></span>
<span id="returns-95"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_path_query_array ==
== pg_jsonb_path_query_array ==
Line 1,585: Line 1,593:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-96"></span>
<span id="returns-96"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_jsonb_path_query_first ==
== pg_jsonb_path_query_first ==
Line 1,601: Line 1,609:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-97"></span>
<span id="returns-97"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_value ==
== pg_json_value ==
Line 1,617: Line 1,625:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-98"></span>
<span id="returns-98"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_get ==
== json_get ==
Line 1,633: Line 1,641:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-99"></span>
<span id="returns-99"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_arrayagg_entry ==
== json_arrayagg_entry ==
Line 1,649: Line 1,657:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-100"></span>
<span id="returns-100"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_arrayagg_reduce ==
== json_arrayagg_reduce ==
Line 1,665: Line 1,673:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-101"></span>
<span id="returns-101"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_arrayagg_finalize ==
== json_arrayagg_finalize ==
Line 1,681: Line 1,689:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-102"></span>
<span id="returns-102"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_objectagg_entry ==
== json_objectagg_entry ==
Line 1,697: Line 1,705:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-103"></span>
<span id="returns-103"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== json_objectagg_reduce ==
== json_objectagg_reduce ==
Line 1,713: Line 1,721:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-104"></span>
<span id="returns-104"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)


== pg_json_table_rows ==
== pg_json_table_rows ==
Line 1,729: Line 1,737:
=== Parameters ===
=== Parameters ===


* '''arguments''' (<code>any</code>): ''(variadic)''
* '''arguments''' (<code>any</code>) ''(variadic)''


<span id="returns-105"></span>
<span id="returns-105"></span>
=== Returns ===
=== Returns ===


<code>any</code>
* '''value''' (<code>any</code>)

Latest revision as of 11:59, 28 August 2026


Strings

Generated from MemCP commit c42e19eba on 27 August 2026. See Full SCM API documentation.

The Strings module provides text and binary-string processing for Scheme and SQL compatibility. It includes:

  • validation, length, concatenation, slicing, padding, trimming, and case conversion;
  • splitting, searching, replacement, wildcard/regular-expression matching, and simplification;
  • locale-aware collation and natural ordering;
  • URL, HTML, Base64, hexadecimal, JSON, BSON, and SQL-string conversion;
  • hashes, checksums, random data, and SQL-dialect compatibility functions.

Indexing and length semantics can differ between bytes and Unicode characters; consult each function's parameter description rather than assuming one unit for every operation.

string?

tells if the value is a string

Allowed number of parameters: 1–1

Parameters

  • value (any): value

Returns

  • value (bool)

concat

concatenates stringable values and returns a string

Allowed number of parameters: 1–10000

Parameters

  • value (any): first value to concat
  • more... (any): additional values to concat (variadic)

Returns

  • value (string)

sql_concat

SQL CONCAT semantics: returns NULL if any argument is NULL

Allowed number of parameters: 1–10000

Parameters

  • value (any): first value to concat
  • more... (any): additional values to concat (variadic)

Returns

  • value (any)

substr

returns a substring (0-based index)

Allowed number of parameters: 2–3

Parameters

  • value (string): string to cut
  • start (number): first character index (0-based)
  • len (number): optional length (optional)

Returns

  • value (string)

sql_substr

SQL SUBSTR/SUBSTRING with 1-based index and bounds checking

Allowed number of parameters: 2–3

Parameters

  • value (string): string to cut
  • start (number): first character position (1-based)
  • len (number): optional length (optional)

Returns

  • value (string)

simplify

Converts numeric text to a number. Text beginning with { or [ becomes a native JSON value when it is valid JSON; other input remains a string.

Allowed number of parameters: 1–1

Parameters

  • value (any): value to interpret as a number or JSON value

Returns

  • value (any)

strlen

returns the length of a string

Allowed number of parameters: 1–1

Parameters

  • value (string): input string

Returns

  • value (int)

strlike

matches the string against a wildcard pattern using SQL NULL semantics

Allowed number of parameters: 2–3

Parameters

  • value (string): input string
  • pattern (string): pattern with % and _ in them
  • collation (string): collation in which to compare them (optional)

Returns

  • value (bool)

strlike_cs

matches the string against a wildcard pattern case-sensitively using SQL NULL semantics

Allowed number of parameters: 2–3

Parameters

  • value (string): input string
  • pattern (string): pattern with % and _ in them
  • collation (string): ignored (present for parser compatibility) (optional)

Returns

  • value (bool)

toLower

turns a string into lower case

Allowed number of parameters: 1–1

Parameters

  • value (string): input string

Returns

  • value (string)

toUpper

turns a string into upper case

Allowed number of parameters: 1–1

Parameters

  • value (string): input string

Returns

  • value (string)

replace

replaces all occurances in a string with another string

Allowed number of parameters: 3–3

Parameters

  • s (string): input string
  • find (string): search string
  • replace (string): replace string

Returns

  • value (string)

strtrim

trims whitespace from both ends of a string

Allowed number of parameters: 1–1

Parameters

  • value (string): input string

Returns

  • value (string)

strltrim

trims whitespace from the left of a string

Allowed number of parameters: 1–1

Parameters

  • value (string): input string

Returns

  • value (string)

strrtrim

trims whitespace from the right of a string

Allowed number of parameters: 1–1

Parameters

  • value (string): input string

Returns

  • value (string)

sql_trim

SQL TRIM(): NULL-safe trim of whitespace from both ends

Allowed number of parameters: 1–1

Parameters

  • value (string): input string

Returns

  • value (string)

sql_ltrim

SQL LTRIM(): NULL-safe trim of whitespace from left

Allowed number of parameters: 1–1

Parameters

  • value (string): input string

Returns

  • value (string)

sql_rtrim

SQL RTRIM(): NULL-safe trim of whitespace from right

Allowed number of parameters: 1–1

Parameters

  • value (string): input string

Returns

  • value (string)

split

splits a string using a separator or space

Allowed number of parameters: 1–2

Parameters

  • value (string): input string
  • separator (string): (optional) parameter, defaults to " " (optional)

Returns

  • value (list)

string_repeat

repeats a string n times

Allowed number of parameters: 2–2

Parameters

  • value (string): string to repeat
  • count (number): number of repetitions

Returns

  • value (string)

collate

returns a canonical order relation for a collation and direction. MemCP allows natural sorting of numeric literals.

Allowed number of parameters: 1–2

Parameters

  • collation (string): collation string of the form LANG or LANG_cs or LANG_ci where LANG is a BCP 47 code, for compatibility to MySQL, a CHARSET_ prefix is allowed and ignored as well as the aliases bin, danish, general, german1, german2, spanish and swedish are allowed for language codes
  • reverse (bool): whether to reverse the order like in ORDER BY DESC (optional)

Returns

  • relation (func): compares two values using the selected collation and direction
    • Parameters
      • a (any): left operand
      • b (any): right operand
    • Returns
      • ordered (bool): whether a sorts before b

htmlentities

escapes the string for use in HTML

Allowed number of parameters: 1–1

Parameters

  • value (string): input string

Returns

  • value (string)

urlencode

encodes a string according to URI coding schema

Allowed number of parameters: 1–1

Parameters

  • value (string): string to encode

Returns

  • value (string)

urldecode

decodes a string according to URI coding schema

Allowed number of parameters: 1–1

Parameters

  • value (string): string to decode

Returns

  • value (string)

json_encode

encodes a value in JSON, treats lists as lists

Allowed number of parameters: 1–1

Parameters

  • value (any): value to encode

Returns

  • value (string)

json_quote

quotes a string as JSON

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_encode_assoc

encodes a value in JSON, treats lists as associative arrays

Allowed number of parameters: 1–1

Parameters

  • value (any): value to encode

Returns

  • value (string)

json_decode

parses JSON into a map

Allowed number of parameters: 1–1

Parameters

  • value (string): string to decode

Returns

  • value (any)

json_decode_scmer

parses JSON produced by json_encode and preserves Scheme symbols and lists

Allowed number of parameters: 1–1

Parameters

  • value (string): Scmer JSON to decode

Returns

  • value (any)

base64_encode

encodes a string as Base64 (standard encoding)

Allowed number of parameters: 1–1

Parameters

  • value (string): binary string to encode

Returns

  • value (string)

base64_decode

decodes a Base64 string (standard encoding)

Allowed number of parameters: 1–1

Parameters

  • value (string): base64-encoded string

Returns

  • value (string)

sql_unescape

unescapes the inner part of a sql string

Allowed number of parameters: 1–1

Parameters

  • value (string): string to decode

Returns

  • value (string)

bin2hex

turns binary data into hex with lowercase letters

Allowed number of parameters: 1–1

Parameters

  • value (string): string to encode

Returns

  • value (string)

bin2hex

turns binary data into hex with lowercase letters

Allowed number of parameters: 1–1

Parameters

  • value (string): string to encode

Returns

  • value (string)

hex2bin

decodes a hex string into binary data

Allowed number of parameters: 1–1

Parameters

  • value (string): hex string (even length)

Returns

  • value (string)

uuid

generates a new random UUID v4 string

Allowed number of parameters: 0–0

Parameters

This function has no parameters.

Returns

  • value (string)

randomBytes

returns a string with numBytes cryptographically secure random bytes

Allowed number of parameters: 1–1

Parameters

  • numBytes (number): number of random bytes

Returns

  • value (string)

regexp_replace

replaces matches of a regex pattern in a string

Allowed number of parameters: 3–3

Parameters

  • str (string): input string
  • pattern (string): regex pattern
  • replacement (string): replacement string

Returns

  • value (string)

fnv_hash

computes a fast non-cryptographic 64-bit FNV-1a hash of a string, returns a 16-character hex string

Allowed number of parameters: 1–1

Parameters

  • str (string): input string to hash

Returns

  • value (string)

stable_structural_hash

streams the string or serialized representation of a Scheme value into stable FNV-1a without constructing the complete representation

Allowed number of parameters: 1–2

Parameters

  • value (any): value to hash
  • serialize (bool): use the Scheme serializer instead of string rendering (optional)

Returns

  • value (string)

sha1

computes the SHA-1 digest of a string, returns a 40-character lowercase hex string

Allowed number of parameters: 1–1

Parameters

  • str (string): input string to hash

Returns

  • value (string)

sha256

computes the SHA-256 digest of a string, returns a 64-character lowercase hex string

Allowed number of parameters: 1–1

Parameters

  • str (string): input string to hash

Returns

  • value (string)

regexp_test

tests if a string matches a regex pattern, returns true/false

Allowed number of parameters: 2–2

Parameters

  • str (string): input string
  • pattern (string): regex pattern

Returns

  • value (bool)

json_parse_bson

validates JSON and returns a BSON-backed value

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_array

creates a MySQL-compatible JSON array

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_object

creates a MySQL-compatible JSON object

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_quote

quotes a string as JSON

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_unquote

unquotes a JSON string

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_valid

tests whether a value contains valid JSON

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_type

returns the MySQL JSON type name

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_depth

returns maximum JSON document depth

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_length

returns JSON object or array length

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_extract

extracts one or more JSON paths

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_keys

returns object member names

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_contains_path

tests whether one or all JSON paths exist

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_contains

tests JSON containment

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_overlaps

tests whether JSON values overlap

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_member_of

tests whether a JSON scalar is a member of an array

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_pretty

pretty-prints JSON

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_storage_size

returns BSON payload size

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_storage_free

returns unused BSON storage space

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_schema_valid

validates a document against a MySQL Draft 4 JSON schema

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_schema_validation_report

reports MySQL Draft 4 JSON schema validation

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_set

sets or inserts JSON path values

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_insert

inserts missing JSON path values

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_replace

replaces existing JSON path values

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_remove

removes JSON path values

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_array_append

appends values to JSON arrays

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_array_insert

inserts values into JSON arrays

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_merge_patch

merges documents using RFC 7396 semantics

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_merge_preserve

merges documents while preserving values

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_search

searches JSON string values

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_value

extracts a scalar JSON value

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_to_json

implements PostgreSQL to_json and to_jsonb

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_row_to_json

implements PostgreSQL row_to_json

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_build_array

implements PostgreSQL JSON array builders

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_array_absent

implements SQL/JSON ARRAY ABSENT ON NULL

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_build_object

implements PostgreSQL JSON object builders

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_object

implements PostgreSQL json_object and jsonb_object array forms

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_serialize

implements PostgreSQL json_serialize

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_array_length

implements PostgreSQL json_array_length

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_extract_path

implements PostgreSQL json_extract_path

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_extract_path_text

implements PostgreSQL json_extract_path_text

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_set

implements PostgreSQL jsonb_set

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_set_lax

implements PostgreSQL jsonb_set_lax

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_insert

implements PostgreSQL jsonb_insert

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_strip_nulls

implements PostgreSQL json_strip_nulls

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_typeof

implements PostgreSQL json_typeof

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_populate_record_valid

validates PostgreSQL jsonb_populate_record input shape

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_concat

implements PostgreSQL jsonb concatenation

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_delete

implements PostgreSQL jsonb deletion

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_delete_path

implements PostgreSQL jsonb path deletion

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_subtract

dispatches PostgreSQL numeric and jsonb subtraction

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_exists

implements PostgreSQL jsonb top-level existence

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_path_exists

implements PostgreSQL jsonb_path_exists

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_path_match

implements PostgreSQL jsonb_path_match

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_path_query_array

implements PostgreSQL jsonb_path_query_array

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_jsonb_path_query_first

implements PostgreSQL jsonb_path_query_first

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_value

implements PostgreSQL SQL/JSON JSON_VALUE

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_get

implements PostgreSQL JSON object and array extraction

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_arrayagg_entry

wraps one JSON_ARRAYAGG input value

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_arrayagg_reduce

JSON_ARRAYAGG reducer

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_arrayagg_finalize

builds one BSON array from a collected JSON_ARRAYAGG value list

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_objectagg_entry

constructs a JSON_OBJECTAGG key/value entry

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

json_objectagg_reduce

JSON_OBJECTAGG reducer

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)

pg_json_table_rows

materializes a PostgreSQL JSON table function as rows

Allowed number of parameters: 0–10000

Parameters

  • arguments (any) (variadic)

Returns

  • value (any)