Merge "Generalize DB conf group copying"
This commit is contained in:
commit
ebacdd46ac
@ -44,22 +44,10 @@ main_context_manager = enginefacade.transaction_context()
|
|||||||
|
|
||||||
|
|
||||||
def _get_db_conf(conf_group, connection=None):
|
def _get_db_conf(conf_group, connection=None):
|
||||||
|
kw = dict(conf_group.items())
|
||||||
return {'connection': connection or conf_group.connection,
|
if connection is not None:
|
||||||
'slave_connection': conf_group.slave_connection,
|
kw['connection'] = connection
|
||||||
'sqlite_fk': False,
|
return kw
|
||||||
'__autocommit': True,
|
|
||||||
'expire_on_commit': False,
|
|
||||||
'mysql_sql_mode': conf_group.mysql_sql_mode,
|
|
||||||
'idle_timeout': conf_group.idle_timeout,
|
|
||||||
'connection_debug': conf_group.connection_debug,
|
|
||||||
'max_pool_size': conf_group.max_pool_size,
|
|
||||||
'max_overflow': conf_group.max_overflow,
|
|
||||||
'pool_timeout': conf_group.pool_timeout,
|
|
||||||
'sqlite_synchronous': conf_group.sqlite_synchronous,
|
|
||||||
'connection_trace': conf_group.connection_trace,
|
|
||||||
'max_retries': conf_group.max_retries,
|
|
||||||
'retry_interval': conf_group.retry_interval}
|
|
||||||
|
|
||||||
|
|
||||||
def _context_manager_from_context(context):
|
def _context_manager_from_context(context):
|
||||||
|
Loading…
Reference in New Issue
Block a user