import { Type, ArrayType, ArrayArg, CharacterArg, TextType, IntegerArg, IntegerType, TSVectorArg } from '../types'; import { Expression, ToType } from '../expressions'; export declare function ARR(...args: T[]): Expression>>; /** * @description Appends an element to the end of an array (same as the * anyarray || anyelement operator). * * @example array_append(ARRAY[1,2], 3) → {1,2,3} */ export declare function ARRAY_APPEND(array: ArrayArg, element: T['argument']): Expression>; /** * @description Concatenates two arrays (same as the anyarray || anyarray operator). * * @example array_cat(ARRAY[1,2,3], ARRAY[4,5]) → {1,2,3,4,5} */ export declare function ARRAY_CAT(a: ArrayArg, b: ArrayArg): Expression>; /** * @description Returns a text representation of the array's dimensions. * * @example array_dims(ARRAY[[1,2,3], [4,5,6]]) → [1:2][1:3] */ export declare function ARRAY_DIMS(arr: ArrayArg): Expression; /** * @description Returns an array filled with copies of the given value, having dimensions * of the lengths specified by the second argument. The optional third argument * supplies lower-bound values for each dimension (which default to all 1). * * @example array_fill(11, ARRAY[2,3]) → {{11,11,11},{11,11,11}} * array_fill(7, ARRAY[3], ARRAY[2]) → [2:4]={7,7,7} */ export declare function ARRAY_FILL(value: T['argument'], dims: ArrayArg, dims2?: ArrayArg): Expression>; /** * @description Returns the length of the requested array dimension. * * @example array_length(array[1,2,3], 1) → 3 */ export declare function ARRAY_LENGTH(arr: ArrayArg, dim: IntegerArg): Expression; /** * @description Returns the lower bound of the requested array dimension. * * @example array_lower('[0:2]={1,2,3}'::integer[], 1) → 0 */ export declare function ARRAY_LOWER(arr: ArrayArg, dim: IntegerArg): Expression; /** * @description Returns the number of dimensions of the array. * * @example array_ndims(ARRAY[[1,2,3], [4,5,6]]) → 2 */ export declare function ARRAY_NDIMS(arr: ArrayArg): Expression; /** * @description 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. The array must be * one-dimensional. Comparisons are done using IS NOT DISTINCT FROM semantics, so it * is possible to search for NULL. * * @example array_position(ARRAY['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'], 'mon') → 2 */ export declare function ARRAY_POSITION(arr: ArrayArg, el: T['argument'], dim?: IntegerArg): Expression; /** * @description Returns an array of the subscripts of all occurrences of the second * argument in the array given as first argument. The array must be * one-dimensional. Comparisons are done using IS NOT DISTINCT FROM semantics, so it * is possible to search for NULL. NULL is returned only if the * array is NULL; if the value is not found in the array, * an empty array is returned. * * @example array_positions(ARRAY['A','A','B','A'], 'A') → {1,2,4} */ export declare function ARRAY_POSITIONS(arr: ArrayArg, el: T['argument']): Expression>; /** * @description Prepends an element to the beginning of an array (same as the * anyelement || anyarray operator). * * @example array_prepend(1, ARRAY[2,3]) → {1,2,3} */ export declare function ARRAY_PREPEND(el: T['argument'], arr: ArrayArg): Expression>; /** * @description Removes all elements equal to the given value from the array. The * array must be one-dimensional. Comparisons are done using IS NOT DISTINCT FROM * semantics, so it is possible to remove NULLs. * * @example array_remove(ARRAY[1,2,3,2], 2) → {1,3} */ export declare function ARRAY_REMOVE(arr: ArrayArg, el: T['argument']): Expression>; /** * @description Replaces each array element equal to the second argument with the third * argument. * * @example array_replace(ARRAY[1,2,5,4], 5, 3) → {1,2,3,4} */ export declare function ARRAY_REPLACE(arr: ArrayArg, from: T['argument'], to: T['argument']): Expression>; /** * @description Converts each array element to its text representation, and concatenates those separated * by the delimiter string. If null_string is given and is not NULL, * then NULL array entries are represented by that string; otherwise, they are * omitted. * * @example array_to_string(ARRAY[1, 2, 3, NULL, 5], ',', '*') → 1,2,3,*,5 */ export declare function ARRAY_TO_STRING(array: ArrayArg, delimiter: CharacterArg, nulls?: CharacterArg): Expression; /** * @description Returns the upper bound of the requested array dimension. * * @example array_upper(ARRAY[1,8,3,7], 1) → 4 */ export declare function ARRAY_UPPER(arr: ArrayArg, dim: IntegerArg): Expression; /** * @description Returns the total number of elements in the array, or 0 if * the array is empty. * * @example cardinality(ARRAY[[1,2],[3,4]]) → 4 */ export declare function CARDINALITY(arr: ArrayArg): Expression; /** * @description Splits the string at occurrences of delimiter and forms the remaining data * into a text array. If delimiter is NULL, each character in the * string will become a separate element in the array. If delimiter is * an empty string, then the string is treated as a single field. * If null_string is supplied and is not NULL, fields matching that string * are converted to NULL entries. * * @example string_to_array('xx~~yy~~zz', '~~', 'yy') → {xx,NULL,zz} */ export declare function STRING_TO_ARRAY(string: CharacterArg, delimiter: CharacterArg, nulls: CharacterArg): Expression>; /** * @description Expands an array into a set of rows. The array's elements are * read out in storage order. * * @example unnest(ARRAY[1,2]) → * 1 * 2 * unnest(ARRAY[['foo','bar'],['baz','quux']]) → * foo * bar * baz * quux */ export declare function UNNEST(arr: ArrayArg | TSVectorArg): T['expression'];