MCPcopy
hub / github.com/psycopg/psycopg / _send_query_prepared

Method _send_query_prepared

psycopg/psycopg/_cursor_base.py:583–604  ·  view source on GitHub ↗
(
        self, name: bytes, pgq: PostgresQuery, *, binary: bool | None = None
    )

Source from the content-addressed store, hash-verified

581 self._pgconn.send_prepare(name, query.query, param_types=query.types)
582
583 def _send_query_prepared(
584 self, name: bytes, pgq: PostgresQuery, *, binary: bool | None = None
585 ) -> None:
586 if binary is None:
587 fmt = self.format
588 else:
589 fmt = BINARY if binary else TEXT
590
591 if self._conn._pipeline:
592 self._conn._pipeline.command_queue.append(
593 partial(
594 self._pgconn.send_query_prepared,
595 name,
596 pgq.params,
597 param_formats=pgq.formats,
598 result_format=fmt,
599 )
600 )
601 else:
602 self._pgconn.send_query_prepared(
603 name, pgq.params, param_formats=pgq.formats, result_format=fmt
604 )
605
606 def _check_result_for_fetch(self) -> PGresult:
607 if self.closed:

Callers 1

_maybe_prepare_genMethod · 0.95

Calls 1

send_query_preparedMethod · 0.45

Tested by

no test coverage detected