Available on crate feature
sqlite
only.Expand description
SQLite specific functions
Functions§
- json
- Verifies that its argument is a valid JSON string or JSONB blob and returns a minified version of that JSON string with all unnecessary whitespace removed.
- json_
array_ length - The json_array_length(X) function returns the number of elements in the JSON array X, or 0 if X is some kind of JSON value other than an array. Errors are thrown if either X is not well-formed JSON or if P is not a well-formed path.
- json_
array_ length_ with_ path - The json_array_length(X) function returns the number of elements in the JSON array X, or 0 if X is some kind of JSON value other than an array. The json_array_length(X,P) locates the array at path P within X and returns the length of that array, or 0 if path P locates an element in X that is not a JSON array, and NULL if path P does not locate any element of X. Errors are thrown if either X is not well-formed JSON or if P is not a well-formed path.
- json_
error_ position - The json_error_position(X) function returns 0 if the input X is a well-formed JSON or JSON5 string. If the input X contains one or more syntax errors, then this function returns the character position of the first syntax error. The left-most character is position 1.
- json_
group_ array - The
json_group_array(X)
function is an aggregate SQL function that returns a JSON array comprised of all X values in the aggregation. - json_
pretty - Converts the given json value to pretty-printed, indented text
- json_
pretty_ with_ indentation - Converts the given json value to pretty-printed, indented text
- json_
quote - The json_quote(X) function converts the SQL value X (a number or a string) into its corresponding JSON representation. If X is a JSON value returned by another JSON function, then this function is a no-op.
- json_
type - The json_type(X) function returns the “type” of the outermost element of X. The “type” returned by json_type() is one of the following SQL text values: ‘null’, ‘true’, ‘false’, ‘integer’, ‘real’, ‘text’, ‘array’, or ‘object’.
- json_
type_ with_ path - The json_type(X,P) function returns the “type” of the element in X that is selected by path P. If the path P in json_type(X,P) selects an element that does not exist in X, then this function returns NULL.
- json_
valid - Returns
true
if the argument is well-formed JSON, or returnsfalse
if is not well-formed. - jsonb
- The jsonb(X) function returns the binary JSONB representation of the JSON provided as argument X.
- jsonb_
group_ array - The
jsonb_group_array(X)
function is an aggregate SQL function that returns a JSONB array comprised of all X values in the aggregation.
Type Aliases§
- json
- The return type of
json()
- json_
array_ length - The return type of
json_array_length()
- json_
array_ length_ with_ path - The return type of
json_array_length_with_path()
- json_
error_ position - The return type of
json_error_position()
- json_
group_ array - The return type of
json_group_array()
- json_
pretty - The return type of
json_pretty()
- json_
pretty_ with_ indentation - The return type of
json_pretty_with_indentation()
- json_
quote - The return type of
json_quote()
- json_
type - The return type of
json_type()
- json_
type_ with_ path - The return type of
json_type_with_path()
- json_
valid - The return type of
json_valid()
- jsonb
- The return type of
jsonb()
- jsonb_
group_ array - The return type of
jsonb_group_array()