示例#1
0
    def __init__(self, name, config={}):

        try:
            self._config = dict_merge(Connection._CONFIG['db'][name], config)
        except KeyError:
            raise ConnectionException('Connection name, {0}, not defined in configuration'.format(name))

        self._config['database'] = name

        self.url = url.URL(**self._config)
        self.engine = create_engine(self.url, convert_unicode=True, pool_recycle=14400)  # 4-hour recycle
示例#2
0
    def __init__(self, name, config={}):

        try:
            self._config = dict_merge(Connection._CONFIG['db'][name], config)
        except KeyError:
            raise ConnectionException(
                'Connection name, {0}, not defined in configuration'.format(
                    name))

        self._config['database'] = name

        self.url = url.URL(**self._config)
        self.engine = create_engine(self.url,
                                    convert_unicode=True,
                                    pool_recycle=14400)  # 4-hour recycle
 def merge(self, override=None):
     self.update(dict_merge(self, override))
 def merge(self, override=None):
     self.update(dict_merge(self, override))