swh.core.db.common module

swh.core.db.common.remove_kwargs(names)[source]
swh.core.db.common.apply_options(cursor, options)[source]

Applies the given postgresql client options to the given cursor.

Returns a dictionary with the old values if they changed.

swh.core.db.common.db_transaction(**client_options)[source]

decorator to execute Backend methods within DB transactions

The decorated method must accept a cur and db keyword argument

Client options are passed as set options to the postgresql server

swh.core.db.common.db_transaction_generator(**client_options)[source]

decorator to execute Backend methods within DB transactions, while returning a generator

The decorated method must accept a cur and db keyword argument

Client options are passed as set options to the postgresql server