A DB backend module should implement a method named ‘get_backend’ which takes no arguments. The method can return any object that implements DB API methods.
Bases: object
Initialize the chosen DB API backend.
After initialization API methods is available as normal attributes of DBAPI subclass. Database API methods are supposed to be called as DBAPI instance methods.
Parameters: |
|
---|---|
Default backend_mapping: | |
None |
|
Default lazy: | False |
Initialize DBAPI instance given a config instance.
Parameters: |
|
---|
Indicate api method as safe for re-connection to database.
Database connection retries will be enabled for the decorated api method. Database connection failure can have many causes, which can be temporary. In such cases retry may increase the likelihood of connection.
Usage:
@safe_for_db_retry
def api_method(self):
self.engine.connect()
Parameters: | f (function.) – database api method. |
---|
Bases: object
Decorator class. Retry db.api methods, if DBConnectionError() raised.
Retry decorated db.api methods. If we enabled use_db_reconnect in config, this decorator will be applied to all db.api functions, marked with @safe_for_db_retry decorator. Decorator catches DBConnectionError() and retries function in a loop until it succeeds, or until maximum retries count will be reached.
Keyword arguments:
Parameters: |
|
---|