[sql] consolidate the encoders to a single function

This commit is contained in:
Tim Stack 2022-07-30 13:18:55 -07:00
parent c9c573d2ad
commit 3b9bc57ab0
13 changed files with 479 additions and 388 deletions

View File

@ -659,46 +659,6 @@ avg(*X*)
----
.. _base64_encode:
base64_encode(*value*)
^^^^^^^^^^^^^^^^^^^^^^
Base-64 encode the given value
**Parameters**
* **value\*** --- The value to encode
**Examples**
To encode 'Hello, World!':
.. code-block:: custsqlite
;SELECT base64_encode('Hello, World!')
ée
**See Also**
:ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
.. _base64_encode:
base64_encode(*value*)
^^^^^^^^^^^^^^^^^^^^^^
Base-64 decode the given value
**Parameters**
* **value\*** --- The value to decode
**See Also**
:ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
.. _basename:
basename(*path*)
@ -812,7 +772,7 @@ char(*X*)
HI
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -845,7 +805,7 @@ charindex(*needle*, *haystack*, *\[start\]*)
0
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -993,6 +953,31 @@ datetime(*timestring*, *modifier*)
----
.. _decode:
decode(*value*, *algorithm*)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Decode the value using the given algorithm
**Parameters**
* **value\*** --- The value to decode
* **algorithm\*** --- One of the following encoding algorithms: base64, hex, uri
**Examples**
To decode the URI-encoded string '%63%75%72%6c':
.. code-block:: custsqlite
;SELECT decode('%63%75%72%6c', 'uri')
curl
**See Also**
:ref:`char`, :ref:`charindex`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
.. _degrees:
degrees(*radians*)
@ -1098,6 +1083,45 @@ echoln(*value*)
----
.. _encode:
encode(*value*, *algorithm*)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Encode the value using the given algorithm
**Parameters**
* **value\*** --- The value to encode
* **algorithm\*** --- One of the following encoding algorithms: base64, hex, uri
**Examples**
To base64-encode 'Hello, World!':
.. code-block:: custsqlite
;SELECT encode('Hello, World!', 'base64')
SGVsbG8sIFdvcmxkIQ==
To hex-encode 'Hello, World!':
.. code-block:: custsqlite
;SELECT encode('Hello, World!', 'hex')
48656c6c6f2c20576f726c6421
To URI-encode 'Hello, World!':
.. code-block:: custsqlite
;SELECT encode('Hello, World!', 'uri')
Hello%2C%20World%21
**See Also**
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
.. _endswith:
endswith(*str*, *suffix*)
@ -1125,7 +1149,7 @@ endswith(*str*, *suffix*)
0
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -1180,7 +1204,7 @@ extract(*str*)
{"col_0":1.0,"col_1":2.0}
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -1381,7 +1405,7 @@ group_concat(*X*, *\[sep\]*)
hw,gw
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -1405,7 +1429,7 @@ group_spooky_hash(*str*)
4e7a190aead058cb123c94290f29c34a
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -1421,7 +1445,7 @@ gunzip(*b*)
* **b** --- The blob to decompress
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -1437,7 +1461,7 @@ gzip(*value*)
* **value** --- The value to compress
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -1490,7 +1514,7 @@ humanize_duration(*secs*)
1s500
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`date`, :ref:`datetime`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`julianday`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`strftime`, :ref:`substr`, :ref:`time`, :ref:`timediff`, :ref:`timeslice`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`date`, :ref:`datetime`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`julianday`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`strftime`, :ref:`substr`, :ref:`time`, :ref:`timediff`, :ref:`timeslice`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -1514,7 +1538,7 @@ humanize_file_size(*value*)
10.0MB
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -1562,7 +1586,7 @@ instr(*haystack*, *needle*)
2
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -1915,7 +1939,7 @@ leftstr(*str*, *N*)
abc
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -1939,7 +1963,7 @@ length(*str*)
3
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2129,7 +2153,7 @@ logfmt2json(*str*)
{"foo":1,"bar":2,"name":"Rolo Tomassi"}
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2153,7 +2177,7 @@ lower(*str*)
abc
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2185,7 +2209,7 @@ ltrim(*str*, *\[chars\]*)
c
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2342,7 +2366,7 @@ padc(*str*, *len*)
abcdef ghi
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2374,7 +2398,7 @@ padl(*str*, *len*)
abcdef
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2406,7 +2430,7 @@ padr(*str*, *len*)
abcdefghi
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2504,7 +2528,7 @@ printf(*format*, *X*)
value: 00011
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2528,7 +2552,7 @@ proper(*str*)
Hello, World!
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2711,7 +2735,7 @@ regexp_capture(*string*, *pattern*)
1 2 3 8 9 2
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2738,7 +2762,7 @@ regexp_capture_into_json(*string*, *pattern*)
1 {"col_0":"b","col_1":2}
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2777,7 +2801,7 @@ regexp_match(*re*, *str*)
{"num":123,"str":"four"}
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_replace`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_replace`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2810,7 +2834,7 @@ regexp_replace(*str*, *re*, *repl*)
<123> <abc>
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_match`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_match`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2843,7 +2867,7 @@ replace(*str*, *old*, *replacement*)
zbc
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2868,7 +2892,7 @@ replicate(*str*, *N*)
abcabcabc
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2892,7 +2916,7 @@ reverse(*str*)
cba
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -2924,7 +2948,7 @@ rightstr(*str*, *N*)
abc
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -3020,7 +3044,7 @@ rtrim(*str*, *\[chars\]*)
a
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -3090,7 +3114,7 @@ sparkline(*value*, *\[upper\]*)
▁▂▃▄▅▆▇█
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -3135,7 +3159,7 @@ spooky_hash(*str*)
f96b3d9c1a19f4394c97a1b79b1880df
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -3249,7 +3273,7 @@ startswith(*str*, *prefix*)
0
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -3274,7 +3298,7 @@ strfilter(*source*, *include*)
bcbc
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -3361,7 +3385,7 @@ substr(*str*, *start*, *\[size\]*)
b
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`trim`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -3568,7 +3592,7 @@ trim(*str*, *\[chars\]*)
abc
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`unicode`, :ref:`upper`, :ref:`xpath`
----
@ -3621,7 +3645,7 @@ unicode(*X*)
97
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`upper`, :ref:`xpath`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`upper`, :ref:`xpath`
----
@ -3659,55 +3683,7 @@ upper(*str*)
ABC
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`xpath`
----
.. _uri_decode:
uri_decode(*str*)
^^^^^^^^^^^^^^^^^
Decode the given URI-encoded string
**Parameters**
* **str\*** --- The string to decode
**Examples**
To decode '%63%75%72%6c':
.. code-block:: custsqlite
;SELECT uri_decode('%63%75%72%6c')
curl
**See Also**
:ref:`uri_encode`
----
.. _uri_encode:
uri_encode(*str*)
^^^^^^^^^^^^^^^^^
URI-encode the given string
**Parameters**
* **str\*** --- The string to URI-encode
**Examples**
To encode 'Hello, World!':
.. code-block:: custsqlite
;SELECT uri_encode('Hello, World!')
Hello%2C%20World%21
**See Also**
:ref:`uri_decode`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`xpath`
----
@ -3750,7 +3726,7 @@ xpath(*xpath*, *xmldoc*)
Hello ★ /abc/def/text() {} Hello ★
**See Also**
:ref:`base64_encode`, :ref:`base64_encode`, :ref:`char`, :ref:`charindex`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`
:ref:`char`, :ref:`charindex`, :ref:`decode`, :ref:`encode`, :ref:`endswith`, :ref:`extract`, :ref:`group_concat`, :ref:`group_spooky_hash_agg`, :ref:`gunzip`, :ref:`gzip`, :ref:`humanize_duration`, :ref:`humanize_file_size`, :ref:`instr`, :ref:`leftstr`, :ref:`length`, :ref:`logfmt2json`, :ref:`lower`, :ref:`ltrim`, :ref:`padc`, :ref:`padl`, :ref:`padr`, :ref:`printf`, :ref:`proper`, :ref:`regexp_capture_into_json`, :ref:`regexp_capture`, :ref:`regexp_match`, :ref:`regexp_replace`, :ref:`replace`, :ref:`replicate`, :ref:`reverse`, :ref:`rightstr`, :ref:`rtrim`, :ref:`sparkline`, :ref:`spooky_hash`, :ref:`startswith`, :ref:`strfilter`, :ref:`substr`, :ref:`trim`, :ref:`unicode`, :ref:`upper`
----

View File

@ -41,10 +41,6 @@
#include "sqlite3.h"
#include "vtab_module.hh"
#if defined(HAVE_LIBCURL)
# include <curl/curl.h>
#endif
static std::string
sql_gethostbyname(const char* name_in)
{
@ -135,42 +131,6 @@ sql_gethostbyaddr(const char* addr_str)
return buffer;
}
#if defined(HAVE_LIBCURL)
static CURL*
get_curl_easy()
{
static struct curl_wrapper {
curl_wrapper() { this->cw_value = curl_easy_init(); }
auto_mem<CURL> cw_value{curl_easy_cleanup};
} retval;
return retval.cw_value.in();
}
static auto_mem<char>
sql_uri_encode(string_fragment str)
{
auto_mem<char> retval(curl_free);
retval = curl_easy_escape(get_curl_easy(), str.data(), str.length());
return retval;
}
static auto_mem<char>
sql_uri_decode(string_fragment str)
{
auto_mem<char> retval(curl_free);
retval = curl_easy_unescape(
get_curl_easy(), str.data(), str.length(), nullptr);
return retval;
}
#endif
int
network_extension_functions(struct FuncDef** basic_funcs,
struct FuncDefAgg** agg_funcs)
@ -200,28 +160,6 @@ network_extension_functions(struct FuncDef** basic_funcs,
"SELECT gethostbyaddr('127.0.0.1')",
})),
#if defined(HAVE_LIBCURL)
sqlite_func_adapter<decltype(&sql_uri_encode), sql_uri_encode>::builder(
help_text("uri_encode", "URI-encode the given string")
.sql_function()
.with_parameter({"str", "The string to URI-encode"})
.with_tags({"uri"})
.with_example({
"To encode 'Hello, World!'",
"SELECT uri_encode('Hello, World!')",
})),
sqlite_func_adapter<decltype(&sql_uri_decode), sql_uri_decode>::builder(
help_text("uri_decode", "Decode the given URI-encoded string")
.sql_function()
.with_parameter({"str", "The string to decode"})
.with_tags({"uri"})
.with_example({
"To decode '%63%75%72%6c'",
"SELECT uri_decode('%63%75%72%6c')",
})),
#endif
{nullptr},
};

View File

@ -31,6 +31,7 @@
#include "optional.hpp"
#include "pcrepp/pcrepp.hh"
#include "safe/safe.h"
#include "scn/scn.h"
#include "spookyhash/SpookyV2.h"
#include "sqlite-extension-func.hh"
#include "vtab_module.hh"
@ -39,6 +40,10 @@
#include "yajlpp/json_op.hh"
#include "yajlpp/yajlpp.hh"
#if defined(HAVE_LIBCURL)
# include <curl/curl.h>
#endif
using namespace mapbox;
struct cache_entry {
@ -446,46 +451,167 @@ sql_gzip(sqlite3_value* val)
return nonstd::nullopt;
}
static nonstd::optional<text_auto_buffer>
sql_base64_encode(sqlite3_value* value)
enum class encode_algo {
base64,
hex,
uri,
};
template<>
struct from_sqlite<encode_algo> {
inline encode_algo operator()(int argc, sqlite3_value** val, int argi)
{
const char* algo_name = (const char*) sqlite3_value_text(val[argi]);
if (strcasecmp(algo_name, "base64") == 0) {
return encode_algo::base64;
}
if (strcasecmp(algo_name, "hex") == 0) {
return encode_algo::hex;
}
if (strcasecmp(algo_name, "uri") == 0) {
return encode_algo::uri;
}
throw from_sqlite_conversion_error("value of 'base64', 'hex', or 'uri'",
argi);
}
};
#if defined(HAVE_LIBCURL)
static CURL*
get_curl_easy()
{
static struct curl_wrapper {
curl_wrapper() { this->cw_value = curl_easy_init(); }
auto_mem<CURL> cw_value{curl_easy_cleanup};
} retval;
return retval.cw_value.in();
}
#endif
static mapbox::util::variant<text_auto_buffer, auto_mem<char>, null_value_t>
sql_encode(sqlite3_value* value, encode_algo algo)
{
switch (sqlite3_value_type(value)) {
case SQLITE_NULL: {
return nonstd::nullopt;
return null_value_t{};
}
case SQLITE_BLOB: {
const auto* blob
= static_cast<const char*>(sqlite3_value_blob(value));
auto blob_len = sqlite3_value_bytes(value);
auto buf = auto_buffer::alloc((blob_len * 5) / 3);
size_t outlen = buf.capacity();
base64_encode(blob, blob_len, buf.in(), &outlen, 0);
buf.resize(outlen);
return text_auto_buffer{std::move(buf)};
switch (algo) {
case encode_algo::base64: {
auto buf = auto_buffer::alloc((blob_len * 5) / 3);
auto outlen = buf.capacity();
base64_encode(blob, blob_len, buf.in(), &outlen, 0);
buf.resize(outlen);
return text_auto_buffer{std::move(buf)};
}
case encode_algo::hex: {
auto buf = auto_buffer::alloc(blob_len * 2 + 1);
for (size_t lpc = 0; lpc < blob_len; lpc++) {
fmt::format_to(std::back_inserter(buf),
FMT_STRING("{:x}"),
blob[lpc]);
}
return text_auto_buffer{std::move(buf)};
}
#if defined(HAVE_LIBCURL)
case encode_algo::uri: {
auto_mem<char> retval(curl_free);
retval = curl_easy_escape(get_curl_easy(), blob, blob_len);
return retval;
}
#endif
}
}
default: {
const auto* text = (const char*) sqlite3_value_text(value);
auto text_len = sqlite3_value_bytes(value);
auto buf = auto_buffer::alloc((text_len * 5) / 3);
size_t outlen = buf.capacity();
base64_encode(text, text_len, buf.in(), &outlen, 0);
buf.resize(outlen);
return text_auto_buffer{std::move(buf)};
switch (algo) {
case encode_algo::base64: {
auto buf = auto_buffer::alloc((text_len * 5) / 3);
size_t outlen = buf.capacity();
base64_encode(text, text_len, buf.in(), &outlen, 0);
buf.resize(outlen);
return text_auto_buffer{std::move(buf)};
}
case encode_algo::hex: {
auto buf = auto_buffer::alloc(text_len * 2 + 1);
for (size_t lpc = 0; lpc < text_len; lpc++) {
fmt::format_to(std::back_inserter(buf),
FMT_STRING("{:x}"),
text[lpc]);
}
return text_auto_buffer{std::move(buf)};
}
#if defined(HAVE_LIBCURL)
case encode_algo::uri: {
auto_mem<char> retval(curl_free);
retval = curl_easy_escape(get_curl_easy(), text, text_len);
return retval;
}
#endif
}
}
}
}
static blob_auto_buffer
sql_base64_decode(string_fragment str)
static mapbox::util::variant<blob_auto_buffer, auto_mem<char>>
sql_decode(string_fragment str, encode_algo algo)
{
auto buf = auto_buffer::alloc(str.length());
auto outlen = buf.capacity();
base64_decode(str.data(), str.length(), buf.in(), &outlen, 0);
buf.resize(outlen);
switch (algo) {
case encode_algo::base64: {
auto buf = auto_buffer::alloc(str.length());
auto outlen = buf.capacity();
base64_decode(str.data(), str.length(), buf.in(), &outlen, 0);
buf.resize(outlen);
return blob_auto_buffer{std::move(buf)};
return blob_auto_buffer{std::move(buf)};
}
case encode_algo::hex: {
auto buf = auto_buffer::alloc(str.length() / 2);
auto sv = str.to_string_view();
while (!sv.empty()) {
int32_t value;
auto scan_res = scn::scan(sv, "{:2x}", value);
if (!scan_res) {
throw sqlite_func_error(
"invalid hex input at: {}",
std::distance(str.begin(), sv.begin()));
}
buf.push_back((char) (value & 0xff));
sv = scan_res.range_as_string_view();
}
return blob_auto_buffer{std::move(buf)};
}
#if defined(HAVE_LIBCURL)
case encode_algo::uri: {
auto_mem<char> retval(curl_free);
retval = curl_easy_unescape(
get_curl_easy(), str.data(), str.length(), nullptr);
return retval;
}
#endif
}
}
std::string
@ -712,23 +838,39 @@ string_extension_functions(struct FuncDef** basic_funcs,
help_text("value", "The value to compress").one_or_more())
.with_tags({"string"})),
sqlite_func_adapter<decltype(&sql_base64_encode), sql_base64_encode>::
builder(
help_text("base64_encode", "Base-64 encode the given value")
.sql_function()
.with_parameter(help_text("value", "The value to encode"))
.with_tags({"string"})
.with_example({
"To encode 'Hello, World!'",
"SELECT base64_encode('Hello, World!')",
})),
sqlite_func_adapter<decltype(&sql_encode), sql_encode>::builder(
help_text("encode", "Encode the value using the given algorithm")
.sql_function()
.with_parameter(help_text("value", "The value to encode"))
.with_parameter(help_text("algorithm",
"One of the following encoding "
"algorithms: base64, hex, uri"))
.with_tags({"string"})
.with_example({
"To base64-encode 'Hello, World!'",
"SELECT encode('Hello, World!', 'base64')",
})
.with_example({
"To hex-encode 'Hello, World!'",
"SELECT encode('Hello, World!', 'hex')",
})
.with_example({
"To URI-encode 'Hello, World!'",
"SELECT encode('Hello, World!', 'uri')",
})),
sqlite_func_adapter<decltype(&sql_base64_decode), sql_base64_decode>::
builder(
help_text("base64_encode", "Base-64 decode the given value")
.sql_function()
.with_parameter(help_text("value", "The value to decode"))
.with_tags({"string"})),
sqlite_func_adapter<decltype(&sql_decode), sql_decode>::builder(
help_text("decode", "Decode the value using the given algorithm")
.sql_function()
.with_parameter(help_text("value", "The value to decode"))
.with_parameter(help_text("algorithm",
"One of the following encoding "
"algorithms: base64, hex, uri"))
.with_tags({"string"})
.with_example({
"To decode the URI-encoded string '%63%75%72%6c'",
"SELECT decode('%63%75%72%6c', 'uri')",
})),
{nullptr},
};

View File

@ -45,6 +45,7 @@
#include "help_text_formatter.hh"
#include "mapbox/variant.hpp"
#include "optional.hpp"
#include "shlex.resolver.hh"
#include "sqlite-extension-func.hh"
extern const char* LNAV_SQLITE_ERROR_PREFIX;
@ -224,6 +225,12 @@ struct from_sqlite<vtab_types::nullable<T>> {
void to_sqlite(sqlite3_context* ctx, const lnav::console::user_message& um);
inline void
to_sqlite(sqlite3_context* ctx, null_value_t)
{
sqlite3_result_null(ctx);
}
inline void
to_sqlite(sqlite3_context* ctx, const char* str)
{
@ -409,7 +416,7 @@ struct sqlite_func_adapter<Return (*)(Args...), f> {
to_sqlite(context, std::move(retval));
} catch (from_sqlite_conversion_error& e) {
char buffer[64];
char buffer[256];
snprintf(buffer,
sizeof(buffer),

View File

@ -786,10 +786,14 @@ EXPECTED_FILES = \
$(srcdir)/%reldir%/test_sql_str_func.sh_7f751009d0db15fc97f9113c5c84db05ff1de9c3.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_80c1fb9affbfac609ebf1cc5556aafb1ecd223c1.err \
$(srcdir)/%reldir%/test_sql_str_func.sh_80c1fb9affbfac609ebf1cc5556aafb1ecd223c1.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_836e3f721a0f945ad27e7aa241121ba739aab618.err \
$(srcdir)/%reldir%/test_sql_str_func.sh_836e3f721a0f945ad27e7aa241121ba739aab618.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_838e9bc7873b2b238157ba0358e0dfd6a01d837d.err \
$(srcdir)/%reldir%/test_sql_str_func.sh_838e9bc7873b2b238157ba0358e0dfd6a01d837d.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_84e77dedec887c5e2433dbc5b130000cd88963bd.err \
$(srcdir)/%reldir%/test_sql_str_func.sh_84e77dedec887c5e2433dbc5b130000cd88963bd.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_887afe94962d958aca2e03f7873d58ca93e190b5.err \
$(srcdir)/%reldir%/test_sql_str_func.sh_887afe94962d958aca2e03f7873d58ca93e190b5.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_8c9ef83431ea75050fd16824075bf72056cf5f53.err \
$(srcdir)/%reldir%/test_sql_str_func.sh_8c9ef83431ea75050fd16824075bf72056cf5f53.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_8cef54f0617960320b5d3615068eb27333dcf6a3.err \
@ -812,6 +816,8 @@ EXPECTED_FILES = \
$(srcdir)/%reldir%/test_sql_str_func.sh_bfe8b09e23389af0ef14359b66d68228d0285185.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_c9e2f41431bef879364dc37a472ab01f64d89f89.err \
$(srcdir)/%reldir%/test_sql_str_func.sh_c9e2f41431bef879364dc37a472ab01f64d89f89.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_cc53348c585ee71a7456157ad6b125689813bafe.err \
$(srcdir)/%reldir%/test_sql_str_func.sh_cc53348c585ee71a7456157ad6b125689813bafe.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_ce9db1dbc2e5fee87247135d17787ff3af014d77.err \
$(srcdir)/%reldir%/test_sql_str_func.sh_ce9db1dbc2e5fee87247135d17787ff3af014d77.out \
$(srcdir)/%reldir%/test_sql_str_func.sh_d3367527118052081a541a660b091f6f495b1c0d.err \

View File

@ -1949,21 +1949,6 @@ lnav@googlegroups.com[1] support@lnav.org[2]
base64_encode(value)
══════════════════════════════════════════════════════════════════════
Base-64 decode the given value
Parameter
value The value to decode
See Also
base64_encode(), char(), charindex(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
regexp_match(), regexp_replace(), replace(), replicate(), reverse(),
rightstr(), rtrim(), sparkline(), spooky_hash(), startswith(),
strfilter(), substr(), trim(), unicode(), upper(), xpath()
basename(path)
══════════════════════════════════════════════════════════════════════
Extract the base portion of a pathname.
@ -2025,14 +2010,14 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
X The unicode code point values
See Also
base64_encode(), base64_encode(), charindex(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
regexp_match(), regexp_replace(), replace(), replicate(), reverse(),
rightstr(), rtrim(), sparkline(), spooky_hash(), startswith(),
strfilter(), substr(), trim(), unicode(), upper(), xpath()
charindex(), decode(), encode(), endswith(), extract(), group_concat(),
group_spooky_hash(), gunzip(), gzip(), humanize_duration(),
humanize_file_size(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
regexp_replace(), replace(), replicate(), reverse(), rightstr(),
rtrim(), sparkline(), spooky_hash(), startswith(), strfilter(),
substr(), trim(), unicode(), upper(), xpath()
Example
#1 To get a string with the code points 0x48 and 0x49:
;SELECT char(0x48, 0x49) 
@ -2050,14 +2035,14 @@ lnav@googlegroups.com[1] support@lnav.org[2]
start The one-based index within the haystack to
start the search
See Also
base64_encode(), base64_encode(), char(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
regexp_match(), regexp_replace(), replace(), replicate(), reverse(),
rightstr(), rtrim(), sparkline(), spooky_hash(), startswith(),
strfilter(), substr(), trim(), unicode(), upper(), xpath()
char(), decode(), encode(), endswith(), extract(), group_concat(),
group_spooky_hash(), gunzip(), gzip(), humanize_duration(),
humanize_file_size(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
regexp_replace(), replace(), replicate(), reverse(), rightstr(),
rtrim(), sparkline(), spooky_hash(), startswith(), strfilter(),
substr(), trim(), unicode(), upper(), xpath()
Examples
#1 To search for the string 'abc' within 'abcabc' and starting at position 2:
;SELECT charindex('abc', 'abcabc', 2) 
@ -2155,6 +2140,28 @@ lnav@googlegroups.com[1] support@lnav.org[2]
decode(value, algorithm)
══════════════════════════════════════════════════════════════════════
Decode the value using the given algorithm
Parameters
value The value to decode
algorithm One of the following encoding algorithms:
base64, hex, uri
See Also
char(), charindex(), encode(), endswith(), extract(), group_concat(),
group_spooky_hash(), gunzip(), gzip(), humanize_duration(),
humanize_file_size(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
regexp_replace(), replace(), replicate(), reverse(), rightstr(),
rtrim(), sparkline(), spooky_hash(), startswith(), strfilter(),
substr(), trim(), unicode(), upper(), xpath()
Example
#1 To decode the URI-encoded string '%63%75%72%6c':
;SELECT decode('%63%75%72%6c', 'uri') 
degrees(radians)
══════════════════════════════════════════════════════════════════════
Converts radians to degrees
@ -2218,6 +2225,36 @@ lnav@googlegroups.com[1] support@lnav.org[2]
:write-raw-to, :write-screen-to, :write-table-to, :write-to,
:write-view-to
encode(value, algorithm)
══════════════════════════════════════════════════════════════════════
Encode the value using the given algorithm
Parameters
value The value to encode
algorithm One of the following encoding algorithms:
base64, hex, uri
See Also
char(), charindex(), decode(), endswith(), extract(), group_concat(),
group_spooky_hash(), gunzip(), gzip(), humanize_duration(),
humanize_file_size(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
regexp_replace(), replace(), replicate(), reverse(), rightstr(),
rtrim(), sparkline(), spooky_hash(), startswith(), strfilter(),
substr(), trim(), unicode(), upper(), xpath()
Examples
#1 To base64-encode 'Hello, World!':
;SELECT encode('Hello, World!', 'base64') 
#2 To hex-encode 'Hello, World!':
;SELECT encode('Hello, World!', 'hex') 
#3 To URI-encode 'Hello, World!':
;SELECT encode('Hello, World!', 'uri') 
endswith(str, suffix)
══════════════════════════════════════════════════════════════════════
Test if a string ends with the given suffix
@ -2225,14 +2262,14 @@ lnav@googlegroups.com[1] support@lnav.org[2]
str The string to test
suffix The suffix to check in the string
See Also
base64_encode(), base64_encode(), char(), charindex(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
regexp_match(), regexp_replace(), replace(), replicate(), reverse(),
rightstr(), rtrim(), sparkline(), spooky_hash(), startswith(),
strfilter(), substr(), trim(), unicode(), upper(), xpath()
char(), charindex(), decode(), encode(), extract(), group_concat(),
group_spooky_hash(), gunzip(), gzip(), humanize_duration(),
humanize_file_size(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
regexp_replace(), replace(), replicate(), reverse(), rightstr(),
rtrim(), sparkline(), spooky_hash(), startswith(), strfilter(),
substr(), trim(), unicode(), upper(), xpath()
Examples
#1 To test if the string 'notbad.jpg' ends with '.jpg':
;SELECT endswith('notbad.jpg', '.jpg') 
@ -2265,14 +2302,14 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
str The string to parse
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
regexp_match(), regexp_replace(), replace(), replicate(), reverse(),
rightstr(), rtrim(), sparkline(), spooky_hash(), startswith(),
strfilter(), substr(), trim(), unicode(), upper(), xpath()
char(), charindex(), decode(), encode(), endswith(), group_concat(),
group_spooky_hash(), gunzip(), gzip(), humanize_duration(),
humanize_file_size(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
regexp_replace(), replace(), replicate(), reverse(), rightstr(),
rtrim(), sparkline(), spooky_hash(), startswith(), strfilter(),
substr(), trim(), unicode(), upper(), xpath()
Examples
#1 To extract key/value pairs from a string:
;SELECT extract('foo=1 bar=2 name="Rolo Tomassi"') 
@ -2380,8 +2417,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
X The value to concatenate.
sep The separator to place between the values.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_spooky_hash(), gunzip(), gzip(), humanize_duration(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_spooky_hash(), gunzip(), gzip(), humanize_duration(),
humanize_file_size(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -2410,8 +2447,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
str The string to hash
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), gunzip(), gzip(), humanize_duration(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), gunzip(), gzip(), humanize_duration(),
humanize_file_size(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -2430,14 +2467,14 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
b The blob to decompress
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
regexp_match(), regexp_replace(), replace(), replicate(), reverse(),
rightstr(), rtrim(), sparkline(), spooky_hash(), startswith(),
strfilter(), substr(), trim(), unicode(), upper(), xpath()
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gzip(), humanize_duration(),
humanize_file_size(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
regexp_replace(), replace(), replicate(), reverse(), rightstr(),
rtrim(), sparkline(), spooky_hash(), startswith(), strfilter(),
substr(), trim(), unicode(), upper(), xpath()
gzip(value, ...)
══════════════════════════════════════════════════════════════════════
@ -2445,14 +2482,14 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
value The value to compress
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
regexp_match(), regexp_replace(), replace(), replicate(), reverse(),
rightstr(), rtrim(), sparkline(), spooky_hash(), startswith(),
strfilter(), substr(), trim(), unicode(), upper(), xpath()
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), humanize_duration(),
humanize_file_size(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
regexp_replace(), replace(), replicate(), reverse(), rightstr(),
rtrim(), sparkline(), spooky_hash(), startswith(), strfilter(),
substr(), trim(), unicode(), upper(), xpath()
hex(X)
══════════════════════════════════════════════════════════════════════
@ -2473,15 +2510,15 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
secs The duration in seconds
See Also
base64_encode(), base64_encode(), char(), charindex(), date(),
datetime(), endswith(), extract(), group_concat(), group_spooky_hash(),
gunzip(), gzip(), humanize_file_size(), instr(), julianday(),
leftstr(), length(), logfmt2json(), lower(), ltrim(), padc(), padl(),
padr(), printf(), proper(), regexp_capture(),
regexp_capture_into_json(), regexp_match(), regexp_replace(),
replace(), replicate(), reverse(), rightstr(), rtrim(), sparkline(),
spooky_hash(), startswith(), strfilter(), strftime(), substr(), time(),
timediff(), timeslice(), trim(), unicode(), upper(), xpath()
char(), charindex(), date(), datetime(), decode(), encode(),
endswith(), extract(), group_concat(), group_spooky_hash(), gunzip(),
gzip(), humanize_file_size(), instr(), julianday(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
regexp_match(), regexp_replace(), replace(), replicate(), reverse(),
rightstr(), rtrim(), sparkline(), spooky_hash(), startswith(),
strfilter(), strftime(), substr(), time(), timediff(), timeslice(),
trim(), unicode(), upper(), xpath()
Examples
#1 To format a duration:
;SELECT humanize_duration(15 * 60) 
@ -2498,8 +2535,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
value The file size to format
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), instr(), leftstr(), length(), logfmt2json(),
lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -2535,8 +2572,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
haystack The string to search within
needle The string to look for in the haystack
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), leftstr(), length(),
logfmt2json(), lower(), ltrim(), padc(), padl(), padr(), printf(),
proper(), regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -2756,8 +2793,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
N The number of characters from the left side of the
string to return.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), length(),
logfmt2json(), lower(), ltrim(), padc(), padl(), padr(), printf(),
proper(), regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -2781,8 +2818,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
str The string to determine the length of
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
logfmt2json(), lower(), ltrim(), padc(), padl(), padr(), printf(),
proper(), regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -2901,8 +2938,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
str The logfmt message to parse
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), lower(), ltrim(), padc(), padl(), padr(), printf(), proper(),
regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -2922,8 +2959,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
str The string to convert.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), ltrim(), padc(), padl(), padr(), printf(),
proper(), regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -2944,8 +2981,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
str The string to trim characters from the left side
chars The characters to trim. Defaults to spaces.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), padc(), padl(), padr(), printf(),
proper(), regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -3052,8 +3089,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
str The string to pad
len The minimum desired length of the output string
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padl(), padr(), printf(),
proper(), regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -3078,8 +3115,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
str The string to pad
len The minimum desired length of the output string
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padr(), printf(),
proper(), regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -3104,8 +3141,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
str The string to pad
len The minimum desired length of the output string
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), printf(),
proper(), regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -3170,8 +3207,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
X The argument to substitute at a given position in
the format.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
proper(), regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -3198,8 +3235,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
str The string to capitalize.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), regexp_capture(), regexp_capture_into_json(), regexp_match(),
@ -3321,8 +3358,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
string.
content The captured value from the string.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture_into_json(), regexp_match(),
@ -3350,8 +3387,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
string.
content The captured values from the string.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_match(), regexp_replace(),
@ -3372,8 +3409,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
re The regular expression to use
str The string to test against the regular expression
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3406,8 +3443,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
groups with a backslash followed by the number of the group,
starting with 1.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3434,8 +3471,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
replacement The string to replace any occurrences of
the old string with.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3459,8 +3496,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
str The string to replicate.
N The number of times to replicate the string.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3479,8 +3516,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
str The string to reverse.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3501,8 +3538,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
N The number of characters from the right side of the
string to return.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3568,8 +3605,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
str The string to trim characters from the right side
chars The characters to trim. Defaults to spaces.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3622,8 +3659,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
non-aggregate version defaults to 100. The aggregate
version uses the largest value in the inputs.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3646,8 +3683,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
str The string to hash
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3727,8 +3764,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
str The string to test
prefix The prefix to check in the string
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3753,8 +3790,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
source The string to filter
include The characters to include in the result
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3810,8 +3847,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
the value is negative, then the characters before the start
are returned.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -3959,8 +3996,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
right sides.
chars The characters to trim. Defaults to spaces.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -4001,8 +4038,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
X The string to examine.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -4029,8 +4066,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
Parameter
str The string to convert.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),
@ -4043,32 +4080,6 @@ lnav@googlegroups.com[1] support@lnav.org[2]
uri_decode(str)
══════════════════════════════════════════════════════════════════════
Decode the given URI-encoded string
Parameter
str The string to decode
See Also
uri_encode()
Example
#1 To decode '%63%75%72%6c':
;SELECT uri_decode('%63%75%72%6c') 
uri_encode(str)
══════════════════════════════════════════════════════════════════════
URI-encode the given string
Parameter
str The string to URI-encode
See Also
uri_decode()
Example
#1 To encode 'Hello, World!':
;SELECT uri_encode('Hello, World!') 
xpath(xpath, xmldoc)
══════════════════════════════════════════════════════════════════════
A table-valued function that executes an xpath expression over an
@ -4084,8 +4095,8 @@ lnav@googlegroups.com[1] support@lnav.org[2]
node_attr The node's attributes stored in JSON object.
node_text The node's text value.
See Also
base64_encode(), base64_encode(), char(), charindex(), endswith(),
extract(), group_concat(), group_spooky_hash(), gunzip(), gzip(),
char(), charindex(), decode(), encode(), endswith(), extract(),
group_concat(), group_spooky_hash(), gunzip(), gzip(),
humanize_duration(), humanize_file_size(), instr(), leftstr(),
length(), logfmt2json(), lower(), ltrim(), padc(), padl(), padr(),
printf(), proper(), regexp_capture(), regexp_capture_into_json(),

View File

@ -0,0 +1,2 @@
Row 0:
Column encode('foo', null): (null)

View File

@ -0,0 +1 @@
error: sqlite3_exec failed -- Expecting an value of 'base64', 'hex', or 'uri' for argument number 1

View File

@ -0,0 +1,2 @@
Row 0:
Column encode(null, 'base64'): (null)

View File

@ -99,3 +99,9 @@ run_cap_test ./drive_sql "SELECT * FROM regexp_capture('1 2 3 45', '(\d+)')"
run_cap_test ./drive_sql "SELECT * FROM regexp_capture('foo foo', '^foo')"
run_cap_test ./drive_sql "SELECT * FROM regexp_capture_into_json('foo=1 bar=2; foo=3 bar=4', 'foo=(\d+) bar=(\d+)')"
run_cap_test ./drive_sql "SELECT encode('foo', 'bar')"
run_cap_test ./drive_sql "SELECT encode('foo', null)"
run_cap_test ./drive_sql "SELECT encode(null, 'base64')"