(self, statement)
| 1363 | self._timeout = timeout |
| 1364 | |
| 1365 | def _execute(self, statement): |
| 1366 | connection = self.instance._get_connection() if self.instance else self.model._get_connection() |
| 1367 | if self._batch: |
| 1368 | if self._batch._connection: |
| 1369 | if not self._batch._connection_explicit and connection and \ |
| 1370 | connection != self._batch._connection: |
| 1371 | raise CQLEngineException('BatchQuery queries must be executed on the same connection') |
| 1372 | else: |
| 1373 | # set the BatchQuery connection from the model |
| 1374 | self._batch._connection = connection |
| 1375 | return self._batch.add_query(statement) |
| 1376 | else: |
| 1377 | results = _execute_statement(self.model, statement, self._consistency, self._timeout, connection=connection) |
| 1378 | if self._if_not_exists or self._if_exists or self._conditional: |
| 1379 | check_applied(results) |
| 1380 | return results |
| 1381 | |
| 1382 | def batch(self, batch_obj): |
| 1383 | if batch_obj is not None and not isinstance(batch_obj, BatchQuery): |
no test coverage detected