Skip to content

postgrelize / WhereOperators

Type Alias: WhereOperators<V> ​

WhereOperators<V> = object

Defined in: src/model/where-options.ts:25

Operators applicable to an attribute of type V.

Type Parameters ​

V ​

V = unknown

Properties ​

[adjacent]? ​

optional [adjacent]?: unknown

Defined in: src/model/where-options.ts:79

-|- — ranges are adjacent.


[all]? ​

optional [all]?: readonly Comparable<V>[] | Literal

Defined in: src/model/where-options.ts:99

ALL (ARRAY[...]), combined with a comparison operator.


[and]? ​

optional [and]?: AllowArray<Comparable<V> | WhereOperators<V>>

Defined in: src/model/where-options.ts:93

Logical AND of nested conditions.


[any]? ​

optional [any]?: readonly Comparable<V>[] | Literal

Defined in: src/model/where-options.ts:97

ANY (ARRAY[...]), combined with a comparison operator.


[between]? ​

optional [between]?: readonly Comparable<V>[]

Defined in: src/model/where-options.ts:47

BETWEEN a AND b, value is [a, b].


[col]? ​

optional [col]?: string

Defined in: src/model/where-options.ts:91

Compares with another column, value is a column reference such as 'user.id'.


[contained]? ​

optional [contained]?: unknown

Defined in: src/model/where-options.ts:77

<@ — array, range or jsonb is contained by the value.


[containedOrEqual]? ​

optional [containedOrEqual]?: unknown

Defined in: src/model/where-options.ts:117

<<= — inet/cidr subnet is contained within or equals the value. PostgreSQL extension.


[contains]? ​

optional [contains]?: unknown

Defined in: src/model/where-options.ts:75

@> — array, range or jsonb contains the value.


[containsOrEqual]? ​

optional [containsOrEqual]?: unknown

Defined in: src/model/where-options.ts:119

>>= — inet/cidr subnet contains or equals the value. PostgreSQL extension.


[endsWith]? ​

optional [endsWith]?: string | SqlValue

Defined in: src/model/where-options.ts:61

LIKE '%value'.


[eq]? ​

optional [eq]?: Comparable<V> | null

Defined in: src/model/where-options.ts:27

= value; IS NULL when the value is null.


[gt]? ​

optional [gt]?: Comparable<V> | AnyAll<V>

Defined in: src/model/where-options.ts:35

> value.


[gte]? ​

optional [gte]?: Comparable<V> | AnyAll<V>

Defined in: src/model/where-options.ts:37

>= value.


[hasAllKeys]? ​

optional [hasAllKeys]?: readonly string[]

Defined in: src/model/where-options.ts:109

jsonb ?& — all of the keys exist. PostgreSQL extension.


[hasAnyKeys]? ​

optional [hasAnyKeys]?: readonly string[]

Defined in: src/model/where-options.ts:107

jsonb ?| — any of the keys exist. PostgreSQL extension.


[hasKey]? ​

optional [hasKey]?: string

Defined in: src/model/where-options.ts:105

jsonb ? — top-level key exists. PostgreSQL extension.


[iLike]? ​

optional [iLike]?: string | SqlValue | AnyAll<string>

Defined in: src/model/where-options.ts:55

ILIKE pattern.


[inOp]? ​

optional [inOp]?: readonly Comparable<V>[] | Literal | Subquery

Defined in: src/model/where-options.ts:43

IN (...); long lists compile to = ANY($n).


[iRegexp]? ​

optional [iRegexp]?: string | SqlValue

Defined in: src/model/where-options.ts:69

~* pattern (case-insensitive regular expression).


[is]? ​

optional [is]?: boolean | null | Literal

Defined in: src/model/where-options.ts:31

IS value: null, true, false or a literal(...) written as is, like v6.


[isDistinctFrom]? ​

optional [isDistinctFrom]?: Comparable<V> | null

Defined in: src/model/where-options.ts:101

IS DISTINCT FROM value (null-safe <>). PostgreSQL extension.


[isNotDistinctFrom]? ​

optional [isNotDistinctFrom]?: Comparable<V> | null

Defined in: src/model/where-options.ts:103

IS NOT DISTINCT FROM value (null-safe =). PostgreSQL extension.


[jsonPathExists]? ​

optional [jsonPathExists]?: string | SqlValue

Defined in: src/model/where-options.ts:115

jsonb @? — the jsonpath returns any item; the value is a jsonpath string. PostgreSQL extension.


[like]? ​

optional [like]?: string | SqlValue | AnyAll<string>

Defined in: src/model/where-options.ts:51

LIKE pattern.


[lt]? ​

optional [lt]?: Comparable<V> | AnyAll<V>

Defined in: src/model/where-options.ts:39

< value.


[lte]? ​

optional [lte]?: Comparable<V> | AnyAll<V>

Defined in: src/model/where-options.ts:41

<= value.


[match]? ​

optional [match]?: SqlValue

Defined in: src/model/where-options.ts:89

@@ — tsvector matches tsquery.


[ne]? ​

optional [ne]?: Comparable<V> | null

Defined in: src/model/where-options.ts:29

<> value; IS NOT NULL when the value is null.


[noExtendLeft]? ​

optional [noExtendLeft]?: unknown

Defined in: src/model/where-options.ts:85

&> — range does not extend to the left of the value.


[noExtendRight]? ​

optional [noExtendRight]?: unknown

Defined in: src/model/where-options.ts:87

&< — range does not extend to the right of the value.


[not]? ​

optional [not]?: Comparable<V> | boolean | null | WhereOperators<V>

Defined in: src/model/where-options.ts:33

IS NOT value for null/booleans, otherwise negates a nested condition.


[notBetween]? ​

optional [notBetween]?: readonly Comparable<V>[]

Defined in: src/model/where-options.ts:49

NOT BETWEEN a AND b, value is [a, b].


[notILike]? ​

optional [notILike]?: string | SqlValue | AnyAll<string>

Defined in: src/model/where-options.ts:57

NOT ILIKE pattern.


[notIn]? ​

optional [notIn]?: readonly Comparable<V>[] | Literal | Subquery

Defined in: src/model/where-options.ts:45

NOT IN (...); long lists compile to <> ALL($n).


[notIRegexp]? ​

optional [notIRegexp]?: string | SqlValue

Defined in: src/model/where-options.ts:71

!~* pattern.


[notLike]? ​

optional [notLike]?: string | SqlValue | AnyAll<string>

Defined in: src/model/where-options.ts:53

NOT LIKE pattern.


[notRegexp]? ​

optional [notRegexp]?: string | SqlValue

Defined in: src/model/where-options.ts:67

!~ pattern.


[notSimilarTo]? ​

optional [notSimilarTo]?: string | SqlValue

Defined in: src/model/where-options.ts:113

NOT SIMILAR TO pattern. PostgreSQL extension.


[or]? ​

optional [or]?: AllowArray<Comparable<V> | WhereOperators<V>>

Defined in: src/model/where-options.ts:95

Logical OR of nested conditions.


[overlap]? ​

optional [overlap]?: unknown

Defined in: src/model/where-options.ts:73

&& — arrays or ranges overlap.


[regexp]? ​

optional [regexp]?: string | SqlValue

Defined in: src/model/where-options.ts:65

~ pattern (POSIX regular expression).


[similarTo]? ​

optional [similarTo]?: string | SqlValue

Defined in: src/model/where-options.ts:111

SIMILAR TO pattern (SQL regular expression). PostgreSQL extension.


[startsWith]? ​

optional [startsWith]?: string | SqlValue

Defined in: src/model/where-options.ts:59

LIKE 'value%'.


[strictLeft]? ​

optional [strictLeft]?: unknown

Defined in: src/model/where-options.ts:81

<< — range is strictly left of the value.


[strictRight]? ​

optional [strictRight]?: unknown

Defined in: src/model/where-options.ts:83

>> — range is strictly right of the value.


[substring]? ​

optional [substring]?: string | SqlValue

Defined in: src/model/where-options.ts:63

LIKE '%value%'.


[trigramHasSimilarStrictWord]? ​

optional [trigramHasSimilarStrictWord]?: string | SqlValue

Defined in: src/model/where-options.ts:129

%>> — pg_trgm: the column has a strictly similar word of the value. PostgreSQL extension.


[trigramHasSimilarWord]? ​

optional [trigramHasSimilarWord]?: string | SqlValue

Defined in: src/model/where-options.ts:127

%> — pg_trgm: the column has a part similar to the value. PostgreSQL extension.


[trigramSimilar]? ​

optional [trigramSimilar]?: string | SqlValue

Defined in: src/model/where-options.ts:121

% — pg_trgm trigram similarity above pg_trgm.similarity_threshold. PostgreSQL extension.


[trigramStrictWordSimilar]? ​

optional [trigramStrictWordSimilar]?: string | SqlValue

Defined in: src/model/where-options.ts:125

<<% — pg_trgm: the column is strictly similar to a word of the value. PostgreSQL extension.


[trigramWordSimilar]? ​

optional [trigramWordSimilar]?: string | SqlValue

Defined in: src/model/where-options.ts:123

<% — pg_trgm: the column is similar to a part of the value. PostgreSQL extension.

Released under the MIT License.