You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/preview/sql/functions/blob.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ This section describes functions and operators for examining and manipulating [`
12
12
13
13
| Name | Description |
14
14
|:--|:-------|
15
-
|[`arg1 || arg2`](#arg1--arg2)| Concatenates two strings, lists, or blobs. Any `NULL` input results in `NULL`. See also [`concat(arg1, arg2, ...)`](#concatvalue) and [`list_concat(list1, list2)`]({% link docs/preview/sql/functions/list.md %}#list_concatlist1-list2). |
15
+
|[`arg1 || arg2`](#arg1--arg2)| Concatenates two strings, lists, or blobs. Any `NULL` input results in `NULL`. See also [`concat(arg1, arg2, ...)`](#concatvalue-) and [`list_concat(list1, list2)`]({% link docs/preview/sql/functions/list.md %}#list_concatlist1-list2). |
16
16
|[`base64(blob)`](#base64blob)| Converts a `blob` to a base64 encoded string. |
17
17
|[`concat(value, ...)`](#concatvalue-)| Concatenates multiple strings, lists, or blobs. `NULL` inputs are skipped. See also [operator `||`](#arg1--arg2). |
18
18
|[`decode(blob)`](#decodeblob)| Converts `blob` to `VARCHAR`. Fails if `blob` is not valid UTF-8. |
@@ -39,7 +39,7 @@ This section describes functions and operators for examining and manipulating [`
39
39
40
40
<divclass="nostroke_table"></div>
41
41
42
-
|**Description**| Concatenates two strings, lists, or blobs. Any `NULL` input results in `NULL`. See also [`concat(arg1, arg2, ...)`](#concatvalue) and [`list_concat(list1, list2)`]({% link docs/preview/sql/functions/list.md %}#list_concatlist1-list2). |
42
+
|**Description**| Concatenates two strings, lists, or blobs. Any `NULL` input results in `NULL`. See also [`concat(arg1, arg2, ...)`](#concatvalue-) and [`list_concat(list1, list2)`]({% link docs/preview/sql/functions/list.md %}#list_concatlist1-list2). |
Copy file name to clipboardExpand all lines: docs/preview/sql/functions/text.md
+27-25Lines changed: 27 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ This section describes functions and operators for examining and manipulating [`
22
22
|[`string LIKE target`](#string-like-target)| Returns `true` if the `string` matches the like specifier (see [Pattern Matching]({% link docs/preview/sql/functions/pattern_matching.md %})). |
23
23
|[`string SIMILAR TO regex`](#string-similar-to-regex)| Returns `true` if the `string` matches the `regex` (see [Pattern Matching]({% link docs/preview/sql/functions/pattern_matching.md %})). |
24
24
|[`string ^@ search_string`](#string--search_string)| Returns `true` if `string` begins with `search_string`. |
25
-
|[`arg1 || arg2`](#arg1--arg2)| Concatenates two strings, lists, or blobs. Any `NULL` input results in `NULL`. See also [`concat(arg1, arg2, ...)`](#concatvalue) and [`list_concat(list1, list2)`]({% link docs/preview/sql/functions/list.md %}#list_concatlist1-list2). |
25
+
|[`arg1 || arg2`](#arg1--arg2)| Concatenates two strings, lists, or blobs. Any `NULL` input results in `NULL`. See also [`concat(arg1, arg2, ...)`](#concatvalue-) and [`list_concat(list1, list2)`]({% link docs/preview/sql/functions/list.md %}#list_concatlist1-list2). |
26
26
|[`array_extract(string, index)`](#array_extractstring-index)| Extracts a single character from a `string` using a (1-based) `index`. |
27
27
|[`array_slice(list, begin, end)`](#array_slicelist-begin-end)| Extracts a sublist or substring using [slice conventions]({% link docs/preview/sql/functions/list.md %}#slicing). Negative values are accepted. |
28
28
|[`ascii(string)`](#asciistring)| Returns an integer that represents the Unicode code point of the first character of the `string`. |
@@ -38,7 +38,7 @@ This section describes functions and operators for examining and manipulating [`
38
38
|[`contains(string, search_string)`](#containsstring-search_string)| Returns `true` if `search_string` is found within `string`. |
39
39
|[`ends_with(string, search_string)`](#ends_withstring-search_string)| Returns `true` if `string` ends with `search_string`. |
40
40
|[`format(format, ...)`](#formatformat-)| Formats a string using the [fmt syntax](#fmt-syntax). |
41
-
|[`formatReadableDecimalSize(integer)`](#formatreadabledecimalsizeinteger)| Converts `integer` to a human-readable representation (e.g. 16000 -> 16.0 KB). |
41
+
|[`formatReadableDecimalSize(integer)`](#formatreadabledecimalsizeinteger)| Converts `integer` to a human-readable representation using units based on powers of 10 (KB, MB, GB, etc.). |
42
42
|[`formatReadableSize(integer)`](#formatreadablesizeinteger)| Converts `integer` to a human-readable representation using units based on powers of 2 (KiB, MiB, GiB, etc.). |
43
43
|[`format_bytes(integer)`](#format_bytesinteger)| Converts `integer` to a human-readable representation using units based on powers of 2 (KiB, MiB, GiB, etc.). |
44
44
|[`from_base64(string)`](#from_base64string)| Converts a base64 encoded `string` to a character string (`BLOB`). |
@@ -59,11 +59,11 @@ This section describes functions and operators for examining and manipulating [`
59
59
|[`like_escape(string, like_specifier, escape_character)`](#like_escapestring-like_specifier-escape_character)| Returns `true` if the `string` matches the `like_specifier` (see [Pattern Matching]({% link docs/preview/sql/functions/pattern_matching.md %})) using case-sensitive matching. `escape_character` is used to search for wildcard characters in the `string`. |
60
60
|[`lower(string)`](#lowerstring)| Converts `string` to lower case. |
61
61
|[`lpad(string, count, character)`](#lpadstring-count-character)| Pads the `string` with the `character` on the left until it has `count` characters. Truncates the `string` on the right if it has more than `count` characters. |
62
-
|[`ltrim(string[, characters])`](#ltrimstring-characters)| Removes any occurrences of any of the `characters` from the left side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
62
+
|[`ltrim(string[, characters])`](#ltrimstring-characters)| Removes any occurrences of any of the `characters` from the left side of the `string`. `characters` defaults to `space`. |
63
63
|[`md5(string)`](#md5string)| Returns the MD5 hash of the `string` as a `VARCHAR`. |
64
64
|[`md5_number(string)`](#md5_numberstring)| Returns the MD5 hash of the `string` as a `HUGEINT`. |
65
-
|[`md5_number_lower(string)`](#md5_number_lowerstring)| Returns the lower 64-bit segment of the MD5 hash of the `string` as a `BIGINT`. |
66
-
|[`md5_number_upper(string)`](#md5_number_upperstring)| Returns the upper 64-bit segment of the MD5 hash of the `string` as a `BIGINT`. |
65
+
|[`md5_number_lower(string)`](#md5_number_lowerstring)| Returns the lower 64-bit segment of the MD5 hash of the `string` as a `UBIGINT`. |
66
+
|[`md5_number_upper(string)`](#md5_number_upperstring)| Returns the upper 64-bit segment of the MD5 hash of the `string` as a `UBIGINT`. |
67
67
|[`nfc_normalize(string)`](#nfc_normalizestring)| Converts `string` to Unicode NFC normalized string. Useful for comparisons and ordering if text data is mixed between NFC normalized and not. |
68
68
|[`not_ilike_escape(string, like_specifier, escape_character)`](#not_ilike_escapestring-like_specifier-escape_character)| Returns `false` if the `string` matches the `like_specifier` (see [Pattern Matching]({% link docs/preview/sql/functions/pattern_matching.md %})) using case-insensitive matching. `escape_character` is used to search for wildcard characters in the `string`. |
69
69
|[`not_like_escape(string, like_specifier, escape_character)`](#not_like_escapestring-like_specifier-escape_character)| Returns `false` if the `string` matches the `like_specifier` (see [Pattern Matching]({% link docs/preview/sql/functions/pattern_matching.md %})) using case-sensitive matching. `escape_character` is used to search for wildcard characters in the `string`. |
@@ -91,7 +91,7 @@ This section describes functions and operators for examining and manipulating [`
91
91
|[`right(string, count)`](#rightstring-count)| Extract the right-most `count` characters. |
92
92
|[`right_grapheme(string, count)`](#right_graphemestring-count)| Extracts the right-most `count` grapheme clusters. |
93
93
|[`rpad(string, count, character)`](#rpadstring-count-character)| Pads the `string` with the `character` on the right until it has `count` characters. Truncates the `string` on the right if it has more than `count` characters. |
94
-
|[`rtrim(string[, characters])`](#rtrimstring-characters)| Removes any occurrences of any of the `characters` from the right side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
94
+
|[`rtrim(string[, characters])`](#rtrimstring-characters)| Removes any occurrences of any of the `characters` from the right side of the `string`. `characters` defaults to `space`. |
95
95
|[`sha1(value)`](#sha1value)| Returns a `VARCHAR` with the SHA-1 hash of the `value`. |
96
96
|[`sha256(value)`](#sha256value)| Returns a `VARCHAR` with the SHA-256 hash of the `value`|
97
97
|[`split(string, separator)`](#splitstring-separator)| Splits the `string` along the `separator`. |
@@ -109,12 +109,12 @@ This section describes functions and operators for examining and manipulating [`
109
109
|[`substring(string, start[, length])`](#substringstring-start-length)| Extracts substring starting from character `start` up to the end of the string. If optional argument `length` is set, extracts a substring of `length` characters instead. Note that a `start` value of `1` refers to the first character of the `string`. |
110
110
|[`substring_grapheme(string, start[, length])`](#substring_graphemestring-start-length)| Extracts substring starting from grapheme clusters `start` up to the end of the string. If optional argument `length` is set, extracts a substring of `length` grapheme clusters instead. Note that a `start` value of `1` refers to the `first` character of the `string`. |
111
111
|[`suffix(string, search_string)`](#suffixstring-search_string)| Returns `true` if `string` ends with `search_string`. |
112
-
|[`to_base(number, raxid[, min_length])`](#to_basenumber-raxid-min_length)| Converts `number` to a string in the given base `radix`, optionally padding with leading zeros to `min_length`. |
112
+
|[`to_base(number, radix[, min_length])`](#to_basenumber-radix-min_length)| Converts `number` to a string in the given base `radix`, optionally padding with leading zeros to `min_length`. |
113
113
|[`to_base64(blob)`](#to_base64blob)| Converts a `blob` to a base64 encoded string. |
114
114
|[`to_binary(string)`](#to_binarystring)| Converts the `string` to binary representation. |
115
115
|[`to_hex(string)`](#to_hexstring)| Converts the `string` to hexadecimal representation. |
116
116
|[`translate(string, from, to)`](#translatestring-from-to)| Replaces each character in `string` that matches a character in the `from` set with the corresponding character in the `to` set. If `from` is longer than `to`, occurrences of the extra characters in `from` are deleted. |
117
-
|[`trim(string[, characters])`](#trimstring-characters)| Removes any occurrences of any of the `characters` from either side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
117
+
|[`trim(string[, characters])`](#trimstring-characters)| Removes any occurrences of any of the `characters` from either side of the `string`. `characters` defaults to `space`. |
118
118
|[`ucase(string)`](#ucasestring)| Converts `string` to upper case. |
119
119
|[`unbin(value)`](#unbinvalue)| Converts a `value` from binary representation to a blob. |
120
120
|[`unhex(value)`](#unhexvalue)| Converts a `value` from hexadecimal representation to a blob. |
@@ -173,7 +173,7 @@ This section describes functions and operators for examining and manipulating [`
173
173
174
174
<divclass="nostroke_table"></div>
175
175
176
-
|**Description**| Concatenates two strings, lists, or blobs. Any `NULL` input results in `NULL`. See also [`concat(arg1, arg2, ...)`](#concatvalue) and [`list_concat(list1, list2)`]({% link docs/preview/sql/functions/list.md %}#list_concatlist1-list2). |
176
+
|**Description**| Concatenates two strings, lists, or blobs. Any `NULL` input results in `NULL`. See also [`concat(arg1, arg2, ...)`](#concatvalue-) and [`list_concat(list1, list2)`]({% link docs/preview/sql/functions/list.md %}#list_concatlist1-list2). |
177
177
|**Example 1**| `'Duck' || 'DB'` |
178
178
|**Result**|`DuckDB`|
179
179
|**Example 2**| `[1, 2, 3]||[4, 5, 6]` |
@@ -216,7 +216,7 @@ This section describes functions and operators for examining and manipulating [`
216
216
217
217
|**Description**| Draws a band whose width is proportional to (`x - min`) and equal to `width` characters when `x` = `max`. `width` defaults to 80. |
218
218
|**Example**|`bar(5, 0, 20, 10)`|
219
-
|**Result**|`██▌␣␣␣␣␣␣␣`|
219
+
|**Result**|`██▌`|
220
220
221
221
#### `base64(blob)`
222
222
@@ -315,16 +315,16 @@ This section describes functions and operators for examining and manipulating [`
315
315
316
316
<divclass="nostroke_table"></div>
317
317
318
-
|**Description**| Converts `integer` to a human-readable representation (e.g. 16000 -> 16.0 KB). |
|**Description**| Converts `integer` to a human-readable representation using units based on powers of 10 (KB, MB, GB, etc.). |
319
+
|**Example**|`formatReadableDecimalSize(16_000)`|
320
320
|**Result**|`16.0 kB`|
321
321
322
322
#### `formatReadableSize(integer)`
323
323
324
324
<divclass="nostroke_table"></div>
325
325
326
326
|**Description**| Converts `integer` to a human-readable representation using units based on powers of 2 (KiB, MiB, GiB, etc.). |
327
-
|**Example**|`formatReadableSize(1000 * 16)`|
327
+
|**Example**|`formatReadableSize(16_000)`|
328
328
|**Result**|`15.6 KiB`|
329
329
|**Alias**|`format_bytes`|
330
330
@@ -333,7 +333,7 @@ This section describes functions and operators for examining and manipulating [`
333
333
<divclass="nostroke_table"></div>
334
334
335
335
|**Description**| Converts `integer` to a human-readable representation using units based on powers of 2 (KiB, MiB, GiB, etc.). |
336
-
|**Example**|`format_bytes(1000 * 16)`|
336
+
|**Example**|`format_bytes(16_000)`|
337
337
|**Result**|`15.6 KiB`|
338
338
|**Alias**|`formatReadableSize`|
339
339
@@ -497,9 +497,9 @@ This section describes functions and operators for examining and manipulating [`
497
497
498
498
<divclass="nostroke_table"></div>
499
499
500
-
|**Description**| Removes any occurrences of any of the `characters` from the left side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
501
-
|**Example 1**|`ltrim('␣␣␣␣test␣␣')`|
502
-
|**Result**|`test␣␣`|
500
+
|**Description**| Removes any occurrences of any of the `characters` from the left side of the `string`. `characters` defaults to `space`. |
501
+
|**Example 1**|`ltrim('test')`|
502
+
|**Result**|`test`|
503
503
|**Example 2**|`ltrim('>>>>test<<', '><')`|
504
504
|**Result**|`test<<`|
505
505
@@ -523,15 +523,15 @@ This section describes functions and operators for examining and manipulating [`
523
523
524
524
<divclass="nostroke_table"></div>
525
525
526
-
|**Description**| Returns the lower 64-bit segment of the MD5 hash of the `string` as a `BIGINT`. |
526
+
|**Description**| Returns the lower 64-bit segment of the MD5 hash of the `string` as a `UBIGINT`. |
527
527
|**Example**|`md5_number_lower('abc')`|
528
528
|**Result**|`8250560606382298838`|
529
529
530
530
#### `md5_number_upper(string)`
531
531
532
532
<divclass="nostroke_table"></div>
533
533
534
-
|**Description**| Returns the upper 64-bit segment of the MD5 hash of the `string` as a `BIGINT`. |
534
+
|**Description**| Returns the upper 64-bit segment of the MD5 hash of the `string` as a `UBIGINT`. |
535
535
|**Example**|`md5_number_upper('abc')`|
536
536
|**Result**|`12704604231530709392`|
537
537
@@ -758,9 +758,9 @@ This section describes functions and operators for examining and manipulating [`
758
758
759
759
<divclass="nostroke_table"></div>
760
760
761
-
|**Description**| Removes any occurrences of any of the `characters` from the right side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
762
-
|**Example 1**|`rtrim('␣␣␣␣test␣␣')`|
763
-
|**Result**|`␣␣␣␣test`|
761
+
|**Description**| Removes any occurrences of any of the `characters` from the right side of the `string`. `characters` defaults to `space`. |
762
+
|**Example 1**|`rtrim('test')`|
763
+
|**Result**|`test`|
764
764
|**Example 2**|`rtrim('>>>>test<<', '><')`|
765
765
|**Result**|`>>>>test`|
766
766
@@ -917,7 +917,9 @@ This section describes functions and operators for examining and manipulating [`
917
917
|**Result**|`true`|
918
918
|**Alias**|`ends_with`|
919
919
920
-
#### `to_base(number, raxid[, min_length])`
920
+
#### `to_base(number, radix[, min_length])`
921
+
922
+
<divclass="nostroke_table"></div>
921
923
922
924
|**Description**| Converts `number` to a string in the given base `radix`, optionally padding with leading zeros to `min_length`. |
923
925
|**Example**|`to_base(42, 16, 5)`|
@@ -962,8 +964,8 @@ This section describes functions and operators for examining and manipulating [`
962
964
963
965
<divclass="nostroke_table"></div>
964
966
965
-
|**Description**| Removes any occurrences of any of the `characters` from either side of the `string`. `characters` defaults to `space`. In the example, the `␣` symbol denotes a space character. |
966
-
|**Example 1**|`trim('␣␣␣␣test␣␣')`|
967
+
|**Description**| Removes any occurrences of any of the `characters` from either side of the `string`. `characters` defaults to `space`. |
0 commit comments