(self, stmt)
| 1646 | self._stmts_to_close.clear() |
| 1647 | |
| 1648 | def _maybe_gc_stmt(self, stmt): |
| 1649 | if ( |
| 1650 | stmt.refs == 0 |
| 1651 | and stmt.name |
| 1652 | and not self._stmt_cache.has( |
| 1653 | (stmt.query, stmt.record_class, stmt.ignore_custom_codec) |
| 1654 | ) |
| 1655 | ): |
| 1656 | # If low-level `stmt` isn't referenced from any high-level |
| 1657 | # `PreparedStatement` object and is not in the `_stmt_cache`: |
| 1658 | # |
| 1659 | # * mark it as closed, which will make it non-usable |
| 1660 | # for any `PreparedStatement` or for methods like |
| 1661 | # `Connection.fetch()`. |
| 1662 | # |
| 1663 | # * schedule it to be formally closed on the server. |
| 1664 | stmt.mark_closed() |
| 1665 | self._stmts_to_close.add(stmt) |
| 1666 | |
| 1667 | async def _cleanup_stmts(self): |
| 1668 | # Called whenever we create a new prepared statement in |
no test coverage detected