server.web.utils

Utility modules for the Jobmon server.

Submodules

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.

Package Contents

server.web.utils.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.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