Begin a new transaction Returns a Transaction object that should be used as a context manager. The transaction will automatically roll back when the context exits unless commit() is explicitly called. Returns: Transaction instance Raise
(self)
| 134 | raise QueryError(f"Execute failed: {e}") |
| 135 | |
| 136 | def transaction(self): |
| 137 | """ |
| 138 | Begin a new transaction |
| 139 | |
| 140 | Returns a Transaction object that should be used as a context manager. |
| 141 | The transaction will automatically roll back when the context exits |
| 142 | unless commit() is explicitly called. |
| 143 | |
| 144 | Returns: |
| 145 | Transaction instance |
| 146 | |
| 147 | Raises: |
| 148 | TransactionError: If transaction cannot be started |
| 149 | """ |
| 150 | from .transaction import Transaction |
| 151 | return Transaction(self) |
| 152 | |
| 153 | def query_builder(self): |
| 154 | """ |
no test coverage detected