the legacy :pq:`PQcancel` implementation.
.. automethod:: has_stream_chunked
+ .. automethod:: has_send_close_prepared
.. automethod:: has_pgbouncer_prepared
.. seealso:: :ref:`pgbouncer`
"Cursor.stream() with 'size' parameter greater than 1", 170000, check=check
)
+ def has_send_close_prepared(self, check: bool = False) -> bool:
+ """Check if the `pq.PGconn.send_closed_prepared()` method is implemented.
+
+ The feature requires libpq 17.0 and greater.
+ """
+ return self._has_feature("PGconn.send_close_prepared()", 170000, check=check)
+
def has_pgbouncer_prepared(self, check: bool = False) -> bool:
"""Check if prepared statements in PgBouncer are supported.
from .pq.misc import connection_summary
from ._pipeline import BasePipeline
from ._preparing import PrepareManager
+from ._capabilities import capabilities
from ._connection_info import ConnectionInfo
if TYPE_CHECKING:
IDLE = pq.TransactionStatus.IDLE
INTRANS = pq.TransactionStatus.INTRANS
-_HAS_SEND_CLOSE = pq.__build_version__ >= 170000
+_HAS_SEND_CLOSE = capabilities.has_send_close_prepared()
logger = logging.getLogger("psycopg")
("has_set_trace_flags", "PGconn.set_trace_flags()", 14),
("has_cancel_safe", "Connection.cancel_safe()", 17),
("has_stream_chunked", "Cursor.stream() with 'size' parameter greater than 1", 17),
+ ("has_send_close_prepared", "PGconn.send_close_prepared()", 17),
("has_pgbouncer_prepared", "PgBouncer prepared statements compatibility", 17),
]