equal
deleted
inserted
replaced
142 self.dbport = port and int(port) or None |
142 self.dbport = port and int(port) or None |
143 self.dbuser = source_config.get('db-user') |
143 self.dbuser = source_config.get('db-user') |
144 self.dbpasswd = source_config.get('db-password') |
144 self.dbpasswd = source_config.get('db-password') |
145 self.encoding = source_config.get('db-encoding', 'UTF-8') |
145 self.encoding = source_config.get('db-encoding', 'UTF-8') |
146 self.dbapi_module = db.get_dbapi_compliant_module(self.dbdriver) |
146 self.dbapi_module = db.get_dbapi_compliant_module(self.dbdriver) |
|
147 self.dbdriver_extra_args = source_config.get('db-extra-arguments') |
147 self.binary = self.dbapi_module.Binary |
148 self.binary = self.dbapi_module.Binary |
148 self.dbhelper = self.dbapi_module.adv_func_helper |
149 self.dbhelper = self.dbapi_module.adv_func_helper |
149 self.sqlgen = SQLGenerator() |
150 self.sqlgen = SQLGenerator() |
150 |
151 |
151 def get_connection(self, user=None, password=None): |
152 def get_connection(self, user=None, password=None): |
157 self.info('connecting to %s@%s', self.dbname, |
158 self.info('connecting to %s@%s', self.dbname, |
158 self.dbhost or 'localhost') |
159 self.dbhost or 'localhost') |
159 cnx = self.dbapi_module.connect(self.dbhost, self.dbname, |
160 cnx = self.dbapi_module.connect(self.dbhost, self.dbname, |
160 user or self.dbuser, |
161 user or self.dbuser, |
161 password or self.dbpasswd, |
162 password or self.dbpasswd, |
162 port=self.dbport) |
163 port=self.dbport, |
|
164 extra_args=self.dbdriver_extra_args) |
163 init_cnx(self.dbdriver, cnx) |
165 init_cnx(self.dbdriver, cnx) |
164 #self.dbapi_module.type_code_test(cnx.cursor()) |
166 #self.dbapi_module.type_code_test(cnx.cursor()) |
165 return cnx |
167 return cnx |
166 |
168 |
167 def backup_to_file(self, backupfile): |
169 def backup_to_file(self, backupfile): |