Skip to content

orcalib.orca_expr#

This module contains classes used for generating SQL expressions in Orca for filtering and sorting data.

Note

This module is not intended to be used directly. Instead, it is used in the TableHandle class to generate SQL expressions.

Operable #

__eq__ #

__eq__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__ne__ #

__ne__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__lt__ #

__lt__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__le__ #

__le__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__gt__ #

__gt__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__ge__ #

__ge__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__add__ #

__add__(value)

Parameters:

  • value (OperableType) –

    Value to add

__radd__ #

__radd__(value)

Parameters:

  • value (OperableType) –

    Value to add

__sub__ #

__sub__(value)

Parameters:

  • value (OperableType) –

    Value to subtract

__rsub__ #

__rsub__(value)

Parameters:

  • value (OperableType) –

    Value to subtract

__mul__ #

__mul__(value)

Parameters:

  • value (OperableType) –

    Value to multiply

__rmul__ #

__rmul__(value)

Parameters:

  • value (OperableType) –

    Value to multiply

__truediv__ #

__truediv__(value)

Parameters:

  • value (OperableType) –

    Value to divide

__rtruediv__ #

__rtruediv__(value)

Parameters:

  • value (OperableType) –

    Value to divide

__and__ #

__and__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__or__ #

__or__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

OrcaExpr #

OrcaExpr(op, args)

Bases: Operable

Orca expression class. This class is used to represent expressions in Orca.

Parameters:

  • op (str) –

    The operation to perform

  • args (tuple[OperableType, ...]) –

    The arguments to the operation

__eq__ #

__eq__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__ne__ #

__ne__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__lt__ #

__lt__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__le__ #

__le__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__gt__ #

__gt__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__ge__ #

__ge__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__add__ #

__add__(value)

Parameters:

  • value (OperableType) –

    Value to add

__radd__ #

__radd__(value)

Parameters:

  • value (OperableType) –

    Value to add

__sub__ #

__sub__(value)

Parameters:

  • value (OperableType) –

    Value to subtract

__rsub__ #

__rsub__(value)

Parameters:

  • value (OperableType) –

    Value to subtract

__mul__ #

__mul__(value)

Parameters:

  • value (OperableType) –

    Value to multiply

__rmul__ #

__rmul__(value)

Parameters:

  • value (OperableType) –

    Value to multiply

__truediv__ #

__truediv__(value)

Parameters:

  • value (OperableType) –

    Value to divide

__rtruediv__ #

__rtruediv__(value)

Parameters:

  • value (OperableType) –

    Value to divide

__and__ #

__and__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__or__ #

__or__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

as_serializable #

as_serializable()

Serialize the expression to a format that can be sent to the server

ColumnHandle #

ColumnHandle(db_name, table_name, column_name)

Bases: Operable

Handle for a column in a table.

Parameters:

  • db_name (str) –

    Name of the database

  • table_name (str) –

    Name of the table

  • column_name (str) –

    Name of the column

ASC property #

ASC

Return a tuple of the column name and the ascending order. This can be used with TableHandle.order_by to sort this column in ascending order

DESC property #

DESC

Return a tuple of the column name and the descending order. This can be used with TableHandle.order_by to sort this column in descending order

__eq__ #

__eq__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__ne__ #

__ne__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__lt__ #

__lt__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__le__ #

__le__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__gt__ #

__gt__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__ge__ #

__ge__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__add__ #

__add__(value)

Parameters:

  • value (OperableType) –

    Value to add

__radd__ #

__radd__(value)

Parameters:

  • value (OperableType) –

    Value to add

__sub__ #

__sub__(value)

Parameters:

  • value (OperableType) –

    Value to subtract

__rsub__ #

__rsub__(value)

Parameters:

  • value (OperableType) –

    Value to subtract

__mul__ #

__mul__(value)

Parameters:

  • value (OperableType) –

    Value to multiply

__rmul__ #

__rmul__(value)

Parameters:

  • value (OperableType) –

    Value to multiply

__truediv__ #

__truediv__(value)

Parameters:

  • value (OperableType) –

    Value to divide

__rtruediv__ #

__rtruediv__(value)

Parameters:

  • value (OperableType) –

    Value to divide

__and__ #

__and__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

__or__ #

__or__(value)

Parameters:

  • value (OperableType) –

    Value to compare with

as_serializable #

as_serializable()

Serialize the column handle to a format that can be sent to the server