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, dialect: str) Any

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

Parameters:
  • delta – Number of seconds to add

  • dialect – The database dialect (mysql, sqlite)

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, dialect: str) Any

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

Parameters:
  • delta – Number of seconds to subtract

  • dialect – The database dialect (mysql, sqlite)

Returns:

A SQLAlchemy expression appropriate for the current dialect

Raises:

ServerError – If the dialect is not supported