Skip to main content

Module arg_types

Module arg_types 

Source
Expand description

Static argument type specifications for all built-in functions.

Each constant defines the accepted argument types per position. An empty accepted slice means any type is accepted (wildcard). variadic: true on the last entry means the argument repeats.

Statics§

APPROX_COUNT_ARGS
APPROX_COUNT_DISTINCT_ARGS
APPROX_PERCENTILE_ARGS
APPROX_TOPK_ARGS
ARRAY_1_ARGS
array_length(arr) / cardinality(arr) / array_distinct(arr) / array_reverse(arr) — a single array argument.
ARRAY_AGG_ARGS
ARRAY_CAT_ARGS
array_concat(arr1, arr2) / array_cat(arr1, arr2).
ARRAY_ELEMENTWISE_ARGS
ARRAY_ELEM_ARGS
array_append(arr, value) / array_remove(arr, value) / array_contains(arr, value) / array_position(arr, value) — an array plus an element of any type.
ARRAY_MAINT_ARGS
ARRAY_PREPEND_ARGS
array_prepend(value, arr) — value-first argument order, matching nodedb_query::functions::array::try_eval’s "array_prepend" arm.
ARRAY_PROJECT_ARGS
ARRAY_SLICE_ARGS
AVG_ARGS
BM25_SCORE_ARGS
COALESCE_ARGS
CONCAT_ARGS
COUNT_ARGS
count(*) / count(expr)
DATETIME_1_ARGS
datetime(value) / to_datetime(value) / unix_secs(value) / epoch_secs(value) / unix_millis(value) / epoch_millis(value) / duration(value) / to_duration(value) / decimal(value) / to_decimal(value) — a single value whose accepted shape (string, integer micros, or an existing timestamp/duration) varies by function, so the position is left untyped (any) rather than over-constrained.
DATE_ARITH_ARGS
date_add(ts, duration) / datetime_add(ts, duration) / date_sub(ts, duration) / datetime_sub(ts, duration).
DATE_DIFF_ARGS
date_diff(ts1, ts2) / datediff(ts1, ts2).
DATE_PART_ARGS
extract(part, ts) / date_part(part, ts) / date_trunc(part, ts) / datetrunc(part, ts) — a text field-name selector plus the timestamp-like value to read it from.
DISPERSION_ARGS
stddev / variance and their _samp / _pop forms.
DOC_ARRAY_CONTAINS_ARGS
DOC_EXISTS_ARGS
DOC_GET_ARGS
FIRST_LAST_VALUE_ARGS
GRAPH_SCORE_ARGS
graph_score(node_id_col, seed_id, depth => N, label => 'edge_label').
GREATEST_LEAST_ARGS
greatest(expr, ...) / least(expr, ...) — one or more arguments of any (comparable) type.
GROUPING_ARGS
GROUPING(col [, col2, ...]) — accepts 1 or more column references.
ID_CHECK_ARGS
is_uuid(value) / is_ulid(value) / is_cuid2(value) / is_nanoid(value) / id_type(value) / uuid_version(value) / ulid_timestamp(value) — a single text value to classify. Shared shape across all detector functions.
JSON_1_ARGS
json_keys(json) / json_values(json) / json_length(json) / json_len(json) / json_type(json) — a single JSON-shaped value.
JSON_ARRAY_ARGS
json_array(value, ...) — zero or more values of any type.
JSON_CONTAINS_ARGS
json_contains(container, needle).
JSON_EXISTS_ARGS
JSON_EXTRACT_ARGS
json_extract(json, path) / json_get(json, path).
JSON_MERGE_ARGS
json_merge(base, overlay) / json_patch(base, overlay).
JSON_OBJECT_ARGS
json_object(key, value, ...) — a flat, variadic key/value list.
JSON_QUERY_ARGS
JSON_REMOVE_ARGS
json_remove(json, key).
JSON_SET_ARGS
json_set(json, key, value).
JSON_VALUE_ARGS
LAG_LEAD_ARGS
LENGTH_ARGS
MAKE_ARRAY_ARGS
MATH_1_ARGS
MATH_2_ARGS
mod(a, b) / power(base, exp) / pow(base, exp) — two required numeric arguments.
MAX_ARGS
MIN_ARGS
MULTI_VECTOR_SCORE_ARGS
MULTI_VECTOR_SEARCH_ARGS
NANOID_ARGS
nanoid(length?) — optional custom length, defaults to the standard 21-character id when omitted.
NAV_ARGS
NDB_CHUNK_TEXT_ARGS
NO_ARGS
NTH_VALUE_ARGS
NTILE_ARGS
NULLIF_ARGS
PG_CATALOG_2_ARGS
PG_FTS_MATCH_ARGS
PG_JSON_2_ARGS
PG_JSON_BOOL_2_ARGS
PG_TO_TSQUERY_ARGS
PG_TO_TSVECTOR_ARGS
PG_TS_HEADLINE_ARGS
PG_TS_RANK_ARGS
REPLACE_ARGS
ROUND_ARGS
RRF_SCORE_ARGS
Two-source rrf_score(rank1, rank2, k1?, k2?) — vector + text. Accepts 2–4 arguments; the planner validates arity at plan time.
RRF_SCORE_TRIPLE_ARGS
Three-source rrf_score(rank1, rank2, rank3, k1?, k2?, k3?) — vector + text + graph. Shares the same function name; arity dispatch happens in the planner.
SEARCH_SCORE_ARGS
SEQUENCE_NAME_ARGS
nextval(name) / currval(name) — one sequence name.
SETVAL_ARGS
setval(name, value) — a sequence name and the value it must take.
SPARSE_SCORE_ARGS
STRING_1_ARGS
SUBSTRING_ARGS
SUM_ARGS
TEXT_MATCH_ARGS
TIME_BUCKET_ARGS
TO_JSONB_ARGS
to_jsonb(value) — any value, or * for the whole row.
TS_CORRELATE_ARGS
TS_EMA_ARGS
TS_LAG_LEAD_ARGS
TS_MOVING_AVG_ARGS
TS_PERCENTILE_ARGS
TS_STDDEV_ARGS
TS_WINDOW_1_ARGS
TYPEOF_ARGS
typeof(expr) / type_of(expr) — accepts any value, including NULL.
VECTOR_DISTANCE_ARGS