resort.component.postgresql

class resort.component.postgresql.Connection(host, port, dbname, username, password)

Bases: object

PostgreSQL database connection.

Parameters:
  • host (str) – Database host.
  • port (int) – Database port.
  • dbname (str) – Database name.
  • username (str) – Database user name.
  • password (str) – Database password.
execute(script)

Execute script.

Parameters:script (str) – Script to be executed.
database_changes(script_path)

Create a database changes component.

Parameters:script_path (Contextual) – Path of script file.
Return type:DatabaseChanges
Returns:Database changes component.
class resort.component.postgresql.DatabaseChanges(conn, script_path)

Bases: object

Database changes. Implements Component.

Parameters:
available(context)

Always returns None.

Parameters:context (resort.engine.execution.Context) – Current execution context.
insert(context)

Applies database changes.

Parameters:context (resort.engine.execution.Context) – Current execution context.
delete(context)

Does nothing.

Parameters:context (resort.engine.execution.Context) – Current execution context.