server.web.utils.time_sql

Time-based SQL expression utilities.

Attributes

DIALECT

Functions

add_time_expr(→ Any)

Create a SQL expression to add time (in seconds) to the current timestamp.

subtract_time_expr(→ Any)

Create a SQL expression to subtract time (in seconds) from the current timestamp.

Module Contents

server.web.utils.time_sql.DIALECT[source]
server.web.utils.time_sql.add_time_expr(delta: float) Any[source]

Create a SQL expression to add time (in seconds) to the current timestamp.

Parameters:

delta – Number of seconds to add

Returns:

A SQLAlchemy expression appropriate for the current dialect

Raises:

ServerError – If the dialect is not supported

server.web.utils.time_sql.subtract_time_expr(delta: float) Any[source]

Create a SQL expression to subtract time (in seconds) from the current timestamp.

Parameters:

delta – Number of seconds to subtract

Returns:

A SQLAlchemy expression appropriate for the current dialect

Raises:

ServerError – If the dialect is not supported