Available on crate feature
postgres_backend
only.Expand description
PostgreSQL specific expression DSL methods.
This module will be glob imported by
diesel::dsl
when compiled with the feature = "postgres"
flag.
Traits§
- A DSL added to integers and
f64
to construct PostgreSQL intervals. - The
only
method - The
tablesample
method
Functions§
- Creates an abbreviated display format as text.
- all
Deprecated with-deprecated
and non-without-deprecated
Creates a PostgreSQLALL
expression. - any
Deprecated with-deprecated
and non-without-deprecated
Creates a PostgreSQLANY
expression. - Creates an
ARRAY[...]
expression. - Append an element to the end of an array
- Concatenates two arrays
- Returns a text representation of the array’s dimensions
- Returns an array initialized with supplied value and dimensions, optionally with lower bounds other than 1. This function omits the optional lower bound argument. See [array_fill_with_lower_bound] for that.
- Returns an array initialized with supplied value and dimensions, with lower bounds other than 1
- Returns the length of the requested array
- Returns the lower bound of the requested array
- Returns the number of dimensions of the array
- Returns the subscript of the first occurrence of the second argument in the array, or NULL if it’s not present. If the third argument is given, the search begins at that subscript. This function omits the third argument. See [array_position_with_subscript].
- Returns the subscript of the first occurrence of the second argument in the array, or NULL if it’s not present, beginning at the subscript given as the third argument.
- Returns an array of the subscripts of all occurrences of the second argument in the array given as first argument.
- Prepends an element to the beginning of an array
- Removes all elements equal to the given value from the array
- Replace all occurrences of an element in an array with a given element
- Returns an array of n items randomly selected from array. n may not exceed the length of the array.
- Randomly shuffles the first dimension of the array.
- Converts any Array to json.
- Converts each array element to its text representation and concatenates those elements separated by the delimiter string.
NULL
entries are omitted in this variant. See [array_to_string_with_null_string] for a variant with that argument. - Converts each array element to its text representation and concatenates those elements separated by the delimiter string. If
null_string
is provided and is notNULL
, thenNULL
array entries are represented by that string; otherwise, they are omitted. - Returns the upper bound of the requested array
- Computes the broadcast address for the address’s network.
- Returns the total number of elements in the array, or 0 if the array is empty.
- Returns range of dates
- Returns the address’s family: 4 for IPv4, 6 for IPv6.
- Returns the IP address as text, ignoring the netmask.
- Computes the host mask for the address’s network.
- Computes the smallest network that includes both of the given networks.
- Tests whether the addresses belong to the same IP family.
- Returns range of integer
- Returns range of big ints
- Returns true if the range is empty
- Returns the number of elements in the top-level JSON array
- Builds a JSON object out of a text array. The array must have an even number of members, in which case they are taken as alternating key/value pairs
- This form of json_object takes keys and values pairwise from two separate arrays. In all other respects it is identical to the one-argument form.
- This function
json_populate_record
takes a Record base and Json as an input and converts it to top-level JSON object to a row having the composite type of the base argument. - Deletes all object fields that have null values from the given JSON value, recursively.
- Returns the type of the top-level json value as a text-string
- Returns the number of elements in the top-level JSON array
- Builds a JSON object out of a text array. The array must have an even number of members, in which case they are taken as alternating key/value pairs. This function also has a form that that takes keys and values as separate text array arguments. See [jsonb_object_with_keys_and_values]
- This form of jsonb_object takes keys and values pairwise from two separate arrays. In all other respects it is identical to the one-argument form.
- This function
jsonb_populate_record
takes a Record base and Jsonb as an input and converts it to top-level JSON object to a row having the composite type of the base argument. - Converts the given json value to pretty-printed, indented text
- Deletes all object fields that have null values from the given JSON value, recursively.
- Returns the type of the top-level jsonb value as a text-string
- Returns the lower bound of the range
- Returns true if the range’s lower bound is inclusive
- Returns true if the range’s lower bound is unbounded
- Returns the netmask length in bits.
- Returns the smallest range which includes all ranges in the multirange
- Computes the network mask for the address’s network.
- Returns the network part of the address, zeroing out whatever is to the right of the netmask. (This is equivalent to casting the value to cidr.)
- Returns range of numeric values
- Returns the smallest range which includes both of the given ranges
- This function
row_to_json
takes a Record type as an input and converts it to JSON. - Sets the netmask length for an inet or cidr value. For inet, the address part does not changes. For cidr, address bits to the right of the new netmask are set to zero.
- Converts any SQL value to json
- Converts any SQL value to jsonb
- Trims an array by removing the last n elements. If the array is multidimensional, only the first dimension is trimmed.
- Returns range of timestamps without timezone
- Returns range of timestamps with timezone
- Returns the upper bound of the range
- Returns true if the range’s upper bound is inclusive
- Returns true if the range’s upper bound is unbounded
Type Aliases§
- The return type of
abbrev()
- The return type of
array_append()
- The return type of
array_cat()
- The return type of
array_dims()
- The return type of
array_fill()
- The return type of
array_fill_with_lower_bound()
- The return type of
array_length()
- The return type of
array_lower()
- The return type of
array_ndims()
- The return type of
array_position()
- The return type of
array_position_with_subscript()
- The return type of
array_positions()
- The return type of
array_prepend()
- The return type of
array_remove()
- The return type of
array_replace()
- The return type of
array_sample()
- The return type of
array_shuffle()
- The return type of
array_to_json()
- The return type of
array_to_string()
- The return type of
array_to_string_with_null_string()
- The return type of
array_upper()
- The return type of
broadcast()
- The return type of
cardinality()
- The return type of
daterange()
- The return type of
family()
- The return type of
host()
- The return type of
hostmask()
- The return type of
inet_merge()
- The return type of
inet_same_family()
- The return type of
int4range()
- The return type of
int8range()
- The return type of
isempty()
- The return type of
json_array_length()
- The return type of
json_object()
- The return type of
json_object_with_keys_and_values()
- The return type of
json_populate_record()
- The return type of
json_strip_nulls()
- The return type of
json_typeof()
- The return type of
jsonb_array_length()
- The return type of
jsonb_object()
- The return type of
jsonb_object_with_keys_and_values()
- The return type of
jsonb_populate_record()
- The return type of
jsonb_pretty()
- The return type of
jsonb_strip_nulls()
- The return type of
jsonb_typeof()
- The return type of
lower()
- The return type of
lower_inc()
- The return type of
lower_inf()
- The return type of
masklen()
- The return type of
multirange_merge()
- The return type of
netmask()
- The return type of
network()
- The return type of
numrange()
- The return type of
range_merge()
- The return type of
row_to_json()
- The return type of
set_masklen()
- The return type of
to_json()
- The return type of
to_jsonb()
- The return type of
trim_array()
- The return type of
tsrange()
- The return type of
tstzrange()
- The return type of
upper()
- The return type of
upper_inc()
- The return type of
upper_inf()