(
self, prefix, values, postfix, args, max_stmt_length, encoding
)
| 251 | return self.rowcount |
| 252 | |
| 253 | def _do_execute_many( |
| 254 | self, prefix, values, postfix, args, max_stmt_length, encoding |
| 255 | ): |
| 256 | if isinstance(prefix, str): |
| 257 | prefix = prefix.encode(encoding) |
| 258 | if isinstance(values, str): |
| 259 | values = values.encode(encoding) |
| 260 | if isinstance(postfix, str): |
| 261 | postfix = postfix.encode(encoding) |
| 262 | sql = bytearray(prefix) |
| 263 | args = iter(args) |
| 264 | v = self._mogrify(values, next(args)) |
| 265 | sql += v |
| 266 | rows = 0 |
| 267 | for arg in args: |
| 268 | v = self._mogrify(values, arg) |
| 269 | if len(sql) + len(v) + len(postfix) + 1 > max_stmt_length: |
| 270 | rows += self.execute(sql + postfix) |
| 271 | sql = bytearray(prefix) |
| 272 | else: |
| 273 | sql += b"," |
| 274 | sql += v |
| 275 | rows += self.execute(sql + postfix) |
| 276 | self.rowcount = rows |
| 277 | return rows |
| 278 | |
| 279 | def callproc(self, procname, args=()): |
| 280 | """Execute stored procedure procname with args |
no test coverage detected