activity.types

Classes

BoundedIntegerRange

Represent a PostgreSQL range.

Module Contents

class activity.types.BoundedIntegerRange(lower: int, upper: int, *, bounds: Literal['()', '[)', '(]', '[]'] = '[)', empty: bool = False)[source]

Bases: sqlalchemy.dialects.postgresql.Range[int]

Represent a PostgreSQL range.

E.g.:

r = Range(10, 50, bounds="()")

The calling style is similar to that of psycopg and psycopg2, in part to allow easier migration from previous SQLAlchemy versions that used these objects directly.

Parameters:
  • lower – Lower bound value, or None

  • upper – Upper bound value, or None

  • bounds – keyword-only, optional string value that is one of "()", "[)", "(]", "[]". Defaults to "[)".

  • empty – keyword-only, optional bool indicating this is an “empty” range

Added in version 2.0.

property upper: int[source]

the upper bound

property lower: int[source]

the lower bound