Skip to content

Simple Querying Classes#

pgrest.query.Column #

Represents a column to use while querying.

Tip

Refer the PostgREST docs for more info about operators.

eq(self, value) #

Operator: "equals to"

Note

This is an alternative to doing Column(x) == value

neq(self, value) #

Operator: "not equal to"

Note

This is an alternative to doing Column(x) != value

gt(self, value) #

Operator: "greater than"

Note

This is an alternative to doing Column(x) > value

gte(self, value) #

Operator: "greater than or equal to"

Note

This is an alternative to doing Column(x) >= value

lt(self, value) #

Operator: "less than"

Note

This is an alternative to doing Column(x) < value

lte(self, value) #

Operator: "less than or equal to"

Note

This is an alternative to doing Column(x) <= value

is_(self, value) #

Compares for exact equality (for null/true/false).

like(self, pattern) #

SQL "LIKE" operator.

ilike(self, pattern) #

Case insensitive "LIKE" operator.

in_(self, values) #

Check if the column value is one of a list of values.

fts(self, query) #

Full-text search using to_tsquery

plfts(self, query) #

Operator: Full-Text search using plainto_tsquery

phfts(self, query) #

Operator: Full-Text search using phraseto_tsquery

wfts(self, query) #

Operator: Full-Text search using websearch_to_tsquery

cs(self, values) #

Operator: contains

cd(self, values) #

Operator: contained in

ov(self, values) #

Operator: overlap (have points in common)

sl(self, range) #

Operator: strictly left of

Note

This is an alternative to doing Column(x) << (f1, f2)

sr(self, range) #

Operator: strictly right of

Note

This is an alternative to doing Column(x) >> (f1, f2)

nxl(self, range) #

Operator: does not extend to the left of

nxr(self, range) #

Operator: does not extend to the right of

adj(self, range) #

Operator: is adjacent to

pgrest.query.Condition #

Represents a query condition.

Warning

This class is not meant to be constructed directly, nor is it part of the public API of this library. Instances of this class are returned by methods on the Column class, and is documented here for the sake of clarity only.

__and__(self, other) special #

Join multiple conditions using AND

__or__(self, other) special #

Join multiple conditions using OR

flatten_params(self) #

parse self.params into a valid query string

stringify(obj) staticmethod #

recursively convert each dictionary into a string

Back to top