(
self, prefix, values, postfix, args, max_stmt_length, encoding
)
| 209 | return self.rowcount |
| 210 | |
| 211 | def _do_execute_many( |
| 212 | self, prefix, values, postfix, args, max_stmt_length, encoding |
| 213 | ): |
| 214 | encoding = self._get_db().encoding |
| 215 | if isinstance(prefix, str): |
| 216 | prefix = prefix.encode(encoding) |
| 217 | if isinstance(postfix, str): |
| 218 | postfix = postfix.encode(encoding) |
| 219 | sql = bytearray(prefix) |
| 220 | args = iter(args) |
| 221 | sql += self._mogrify(values, next(args)).encode(encoding) |
| 222 | rows = 0 |
| 223 | for arg in args: |
| 224 | v = self._mogrify(values, arg).encode(encoding) |
| 225 | if len(sql) + len(v) + len(postfix) + 1 > max_stmt_length: |
| 226 | rows += self.execute(sql + postfix) |
| 227 | sql = bytearray(prefix) |
| 228 | else: |
| 229 | sql += b"," |
| 230 | sql += v |
| 231 | rows += self.execute(sql + postfix) |
| 232 | self.rowcount = rows |
| 233 | return rows |
| 234 | |
| 235 | def callproc(self, procname, args=()): |
| 236 | """Execute stored procedure procname with args. |
no test coverage detected