brk-code

psycopg の API リファレンス

psycopg (psycopg/psycopg) の公開 API 278 件 —— クラス 92、関数 48、メソッド 138。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。

リポジトリ: psycopg/psycopg

種別件数
クラス92
関数48
メソッド138

API 一覧

classpsycopg.psycopg._acompat.Queue
A Queue subclass with an interruptible get() method.
funcpsycopg.psycopg._acompat.agather(*timeout:float | None=None, *tasks:asyncio.Task[Any]) -> None
Equivalent to asyncio.gather or Thread.join()
funcpsycopg.psycopg._acompat.aspawn(f:Callable[..., Coroutine[Any, Any, None]], args:tuple[Any, ...]=(), name:str | None=None) -> asyncio.Task[None]
Equivalent to asyncio.create_task.
funcpsycopg.psycopg._acompat.gather(*timeout:float | None=None, *tasks:threading.Thread) -> None
Equivalent to asyncio.gather or Thread.join()
funcpsycopg.psycopg._acompat.spawn(f:Callable[..., Any], args:tuple[Any, ...]=(), name:str | None=None) -> threading.Thread
Equivalent to creating and running a daemon thread.
methodpsycopg.psycopg._capabilities.Capabilities.has_cancel_safe(check:bool=False) -> bool
Check if the `Connection.cancel_safe()` method is implemented.
methodpsycopg.psycopg._column.Column.name() -> str
The name of the column.
methodpsycopg.psycopg._column.Column.null_ok() -> bool | None
Always `!None`
methodpsycopg.psycopg._column.Column.precision() -> int | None
The number of digits for fixed precision types.
methodpsycopg.psycopg._column.Column.type_code() -> int
The numeric OID of the column.
methodpsycopg.psycopg._column.Column.type_display() -> str
A pretty representation of the column type.
classpsycopg.psycopg._connection_base.BaseConnection
Base class for different types of connections.
methodpsycopg.psycopg._connection_base.BaseConnection.autocommit() -> bool
The autocommit state of the connection.
methodpsycopg.psycopg._connection_base.BaseConnection.broken() -> bool
`!True` if the connection was interrupted.
methodpsycopg.psycopg._connection_base.BaseConnection.cancel() -> None
Cancel the current operation on the connection.
methodpsycopg.psycopg._connection_base.BaseConnection.closed() -> bool
`!True` if the connection is closed.
methodpsycopg.psycopg._connection_base.BaseConnection.fileno() -> int
Return the file descriptor of the connection.
classpsycopg.psycopg._connection_base.Notify
An asynchronous notification received from the database.
classpsycopg.psycopg._connection_info.ConnectionInfo
Allow access to information about the connection.
methodpsycopg.psycopg._connection_info.ConnectionInfo.dbname() -> str
The database name of the connection.
methodpsycopg.psycopg._connection_info.ConnectionInfo.get_parameters() -> dict[str, str]
Return the connection parameters values.
methodpsycopg.psycopg._connection_info.ConnectionInfo.host() -> str
The server host name of the active connection.
methodpsycopg.psycopg._connection_info.ConnectionInfo.hostaddr() -> str
The server IP address of the connection.
methodpsycopg.psycopg._connection_info.ConnectionInfo.parameter_status(param_name:str) -> str | None
Return a parameter setting of the connection.
methodpsycopg.psycopg._connection_info.ConnectionInfo.password() -> str
The password of the connection.
methodpsycopg.psycopg._connection_info.ConnectionInfo.pipeline_status() -> pq.PipelineStatus
The current pipeline status of the client.
methodpsycopg.psycopg._connection_info.ConnectionInfo.port() -> int
The port of the active connection.
methodpsycopg.psycopg._connection_info.ConnectionInfo.server_version() -> int
An integer representing the server version.
methodpsycopg.psycopg._connection_info.ConnectionInfo.status() -> pq.ConnStatus
The status of the connection.
methodpsycopg.psycopg._connection_info.ConnectionInfo.user() -> str
The user name of the connection.
classpsycopg.psycopg._conninfo_utils.ParamDef
Information about defaults and env vars for connection params
funcpsycopg.psycopg._conninfo_utils.get_param(params:ConnMapping, name:str) -> str | None
Return a value from a connection string.
funcpsycopg.psycopg._conninfo_utils.get_param_def(keyword:str, _cache:dict[str, ParamDef]={}) -> ParamDef | None
Return the ParamDef of a connection string parameter.
funcpsycopg.psycopg._conninfo_utils.gssapi_requested(params:ConnDict) -> bool
Return `true` if `gssencmode` was specified explicitly.
funcpsycopg.psycopg._conninfo_utils.is_ip_address(s:str) -> bool
Return True if the string represent a valid ip address.
classpsycopg.psycopg._copy.Copy
Manage an asynchronous :sql:`COPY` operation.
methodpsycopg.psycopg._copy.Copy.finish(exc:BaseException | None) -> None
Terminate the copy operation and free the resources allocated.
methodpsycopg.psycopg._copy.Copy.read() -> Buffer
Read an unparsed row after a :sql:`COPY TO` operation.
methodpsycopg.psycopg._copy.Copy.write(buffer:Buffer | str) -> None
Write a block of data to a table after a :sql:`COPY FROM` operation.
methodpsycopg.psycopg._copy.Copy.write_row(row:Sequence[Any]) -> None
Write a record to a table after a :sql:`COPY FROM` operation.
classpsycopg.psycopg._copy.LibpqWriter
An `Writer` to write copy data to a Postgres database.
classpsycopg.psycopg._copy.QueuedLibpqWriter
`Writer` using a buffer to queue data to write.
classpsycopg.psycopg._copy.Writer
A class to write copy data somewhere (for async connections).
methodpsycopg.psycopg._copy.Writer.finish(exc:BaseException | None=None) -> None
Called when write operations are finished.
methodpsycopg.psycopg._copy.Writer.write(data:Buffer) -> None
Write some data to destination.
classpsycopg.psycopg._copy_async.AsyncCopy
Manage an asynchronous :sql:`COPY` operation.
methodpsycopg.psycopg._copy_async.AsyncCopy.finish(exc:BaseException | None) -> None
Terminate the copy operation and free the resources allocated.
methodpsycopg.psycopg._copy_async.AsyncCopy.read() -> Buffer
Read an unparsed row after a :sql:`COPY TO` operation.
methodpsycopg.psycopg._copy_async.AsyncCopy.write_row(row:Sequence[Any]) -> None
Write a record to a table after a :sql:`COPY FROM` operation.
classpsycopg.psycopg._copy_async.AsyncQueuedLibpqWriter
`AsyncWriter` using a buffer to queue data to write.
classpsycopg.psycopg._copy_async.AsyncWriter
A class to write copy data somewhere (for async connections).
methodpsycopg.psycopg._copy_async.AsyncWriter.finish(exc:BaseException | None=None) -> None
Called when write operations are finished.
methodpsycopg.psycopg._copy_async.AsyncWriter.write(data:Buffer) -> None
Write some data to destination.
classpsycopg.psycopg._copy_base.BaseCopy
Base implementation for the copy user interface.
methodpsycopg.psycopg._copy_base.BaseCopy.set_types(types:Sequence[int | str]) -> None
Set the types expected in a COPY operation.
classpsycopg.psycopg._copy_base.Formatter
A class which understand a copy format (text, binary).
methodpsycopg.psycopg._cursor_base.BaseCursor.closed() -> bool
`True` if the cursor is closed.
methodpsycopg.psycopg._cursor_base.BaseCursor.connection() -> ConnectionType
The connection this cursor is using.
methodpsycopg.psycopg._cursor_base.BaseCursor.statusmessage() -> str | None
The status tag of the current result set.
funcpsycopg.psycopg._dns.resolve_srv(params:dict[str, Any]) -> dict[str, Any]
Apply SRV DNS lookup as defined in :RFC:`2782`.
funcpsycopg.psycopg._dns.resolve_srv_async(params:dict[str, Any]) -> dict[str, Any]
Async equivalent of `resolve_srv()`.
funcpsycopg.psycopg._encodings.conn_encoding(conn:BaseConnection[Any] | None) -> str
Return the Python encoding name of a psycopg connection.
funcpsycopg.psycopg._encodings.conninfo_encoding(conninfo:str) -> str
Return the Python encoding name passed in a conninfo string.
funcpsycopg.psycopg._encodings.pg2pyenc(name:bytes) -> str
Convert a PostgreSQL encoding name to Python encoding name.
funcpsycopg.psycopg._encodings.py2pgenc(name:str) -> bytes
Convert a Python encoding name to PostgreSQL encoding name.
classpsycopg.psycopg._enums.IsolationLevel
Enum representing the isolation level for a transaction.
classpsycopg.psycopg._enums.PyFormat
Enum representing the format wanted for a query argument.
classpsycopg.psycopg._pipeline.Pipeline
Handler for (sync) connection in pipeline mode.
classpsycopg.psycopg._pipeline_async.AsyncPipeline
Handler for (async) connection in pipeline mode.
classpsycopg.psycopg._py_transformer.Transformer
An object that can adapt efficiently between Python and PostgreSQL.
methodpsycopg.psycopg._py_transformer.Transformer.from_context(context:AdaptContext | None) -> Transformer
Return a Transformer from an AdaptContext.
methodpsycopg.psycopg._py_transformer.Transformer.get_dumper(obj:Any, format:PyFormat) -> abc.Dumper
Return a Dumper instance to dump `!obj`.
classpsycopg.psycopg._tpc.Xid
A two-phase commit transaction identifier.
methodpsycopg.psycopg._tpc.Xid.from_string(s:str) -> Xid
Try to parse an XA triple from the string.
funcpsycopg.psycopg._tstrings.as_bytes(t:Template, context:abc.AdaptContext | None=None) -> bytes
Convert a template string to a bytes string.
funcpsycopg.psycopg._tstrings.as_string(t:Template, context:abc.AdaptContext | None=None) -> str
Convert a template string to a string.
classpsycopg.psycopg._typeinfo.TypeInfo
Hold information about a PostgreSQL base type.
methodpsycopg.psycopg._typeinfo.TypeInfo.register(context:AdaptContext | None=None) -> None
Register the type information, globally or in the specified `!context`.
classpsycopg.psycopg._typeinfo.TypesRegistry
Container for the information about types in a database.
methodpsycopg.psycopg._typeinfo.TypesRegistry.get_oid(name:str) -> int
Return the oid of a PostgreSQL type by name.
classpsycopg.psycopg._typemod.BitTypeModifier
Handle bit/varbit type modifier.
classpsycopg.psycopg._typemod.CharTypeModifier
Handle char/varchar type modifier.
classpsycopg.psycopg._typemod.NumericTypeModifier
Handle numeric type modifier.
classpsycopg.psycopg._typemod.TimeTypeModifier
Handle time-related types modifier.
classpsycopg.psycopg._typemod.TypeModifier
Type modifier that doesn't know any modifier.
funcpsycopg.psycopg._tz.get_tzinfo(pgconn:PGconn | None) -> tzinfo
Return the Python timezone info of the connection's timezone.
classpsycopg.psycopg._wrappers.Oid
Force dumping a Python `!int` as a PostgreSQL :sql:`oid`.
classpsycopg.psycopg.abc.AdaptContext
A context describing how types are adapted.
methodpsycopg.psycopg.abc.AdaptContext.adapters() -> AdaptersMap
The adapters configuration that this object uses.
methodpsycopg.psycopg.abc.AdaptContext.connection() -> BaseConnection[Any] | None
The connection used by this object, if available.
methodpsycopg.psycopg.abc.Dumper.dump(obj:Any) -> Buffer | None
Convert the object `!obj` to PostgreSQL representation.
methodpsycopg.psycopg.abc.Dumper.get_key(obj:Any, format:PyFormat) -> DumperKey
Return an alternative key to upgrade the dumper to represent `!obj`.
methodpsycopg.psycopg.abc.Dumper.quote(obj:Any) -> Buffer
Convert the object `!obj` to escaped representation.
methodpsycopg.psycopg.abc.Dumper.upgrade(obj:Any, format:PyFormat) -> Dumper
Return a new dumper to manage `!obj`.
classpsycopg.psycopg.abc.Loader
Convert PostgreSQL values with type OID `!oid` to Python objects.
methodpsycopg.psycopg.abc.Loader.load(data:Buffer) -> Any
Convert the data returned by the database into a Python object.
methodpsycopg.psycopg.adapt.Loader.load(data:Buffer) -> Any
Convert a PostgreSQL value to a Python object.
classpsycopg.psycopg.adapt.RecursiveDumper
Dumper with a transformer to help dumping recursive types.
classpsycopg.psycopg.adapt.RecursiveLoader
Loader with a transformer to help loading recursive types.
classpsycopg.psycopg.connection.Connection
Wrapper for a connection to the database.
methodpsycopg.psycopg.connection.Connection.cancel_safe(*timeout:float=30.0) -> None
Cancel the current operation on the connection.
methodpsycopg.psycopg.connection.Connection.close() -> None
Close the database connection.
methodpsycopg.psycopg.connection.Connection.commit() -> None
Commit any pending transaction to the database.
methodpsycopg.psycopg.connection.Connection.rollback() -> None
Roll back to the start of any pending transaction.
methodpsycopg.psycopg.connection.Connection.set_autocommit(value:bool) -> None
Method version of the `~Connection.autocommit` setter.
methodpsycopg.psycopg.connection.Connection.set_deferrable(value:bool | None) -> None
Method version of the `~Connection.deferrable` setter.
methodpsycopg.psycopg.connection.Connection.set_isolation_level(value:IsolationLevel | None) -> None
Method version of the `~Connection.isolation_level` setter.
methodpsycopg.psycopg.connection.Connection.set_read_only(value:bool | None) -> None
Method version of the `~Connection.read_only` setter.
methodpsycopg.psycopg.connection.Connection.tpc_begin(xid:Xid | str) -> None
Begin a TPC transaction with the given transaction ID `!xid`.
methodpsycopg.psycopg.connection.Connection.tpc_commit(xid:Xid | str | None=None) -> None
Commit a prepared two-phase transaction.
methodpsycopg.psycopg.connection.Connection.tpc_rollback(xid:Xid | str | None=None) -> None
Roll back a prepared two-phase transaction.
methodpsycopg.psycopg.connection.Connection.wait(gen:PQGen[RV], interval:float=_WAIT_INTERVAL) -> RV
Consume a generator operating on the connection.
classpsycopg.psycopg.connection_async.AsyncConnection
Wrapper for a connection to the database.
methodpsycopg.psycopg.connection_async.AsyncConnection.cancel_safe(*timeout:float=30.0) -> None
Cancel the current operation on the connection.
methodpsycopg.psycopg.connection_async.AsyncConnection.close() -> None
Close the database connection.
methodpsycopg.psycopg.connection_async.AsyncConnection.commit() -> None
Commit any pending transaction to the database.
methodpsycopg.psycopg.connection_async.AsyncConnection.rollback() -> None
Roll back to the start of any pending transaction.
methodpsycopg.psycopg.connection_async.AsyncConnection.set_autocommit(value:bool) -> None
Method version of the `~Connection.autocommit` setter.
methodpsycopg.psycopg.connection_async.AsyncConnection.set_deferrable(value:bool | None) -> None
Method version of the `~Connection.deferrable` setter.
methodpsycopg.psycopg.connection_async.AsyncConnection.set_read_only(value:bool | None) -> None
Method version of the `~Connection.read_only` setter.
methodpsycopg.psycopg.connection_async.AsyncConnection.tpc_begin(xid:Xid | str) -> None
Begin a TPC transaction with the given transaction ID `!xid`.
methodpsycopg.psycopg.connection_async.AsyncConnection.tpc_commit(xid:Xid | str | None=None) -> None
Commit a prepared two-phase transaction.
methodpsycopg.psycopg.connection_async.AsyncConnection.tpc_rollback(xid:Xid | str | None=None) -> None
Roll back a prepared two-phase transaction.
methodpsycopg.psycopg.connection_async.AsyncConnection.wait(gen:PQGen[RV], interval:float=_WAIT_INTERVAL) -> RV
Consume a generator operating on the connection.
funcpsycopg.psycopg.conninfo.conninfo_to_dict(conninfo:str='', **kwargs:ConnParam) -> ConnDict
Convert the `!conninfo` string into a dictionary of parameters.
funcpsycopg.psycopg.conninfo.make_conninfo(conninfo:str='', **kwargs:ConnParam) -> str
Merge a string and keyword params into a single conninfo string.
funcpsycopg.psycopg.conninfo.timeout_from_conninfo(params:ConnDict) -> int
Return the timeout in seconds from the connection parameters.
classpsycopg.psycopg.copy.FileWriter
A `Writer` to write copy data to a file-like object.
classpsycopg.psycopg.crdb.connection.CrdbConnection
Wrapper for a connection to a CockroachDB database.
methodpsycopg.psycopg.cursor.Cursor.close() -> None
Close the current cursor and free associated resources.
methodpsycopg.psycopg.cursor.Cursor.executemany(query:Query, params_seq:Iterable[Params], *returning:bool=False) -> None
Execute the same command with a sequence of input data.
methodpsycopg.psycopg.cursor.Cursor.fetchmany(size:int=0) -> list[Row]
Return the next `!size` records from the current result set.
methodpsycopg.psycopg.cursor.Cursor.fetchone() -> Row | None
Return the next record from the current result set.
methodpsycopg.psycopg.cursor.Cursor.set_result(index:int) -> Self
Move to a specific result set.
methodpsycopg.psycopg.cursor.Cursor.stream(query:Query, params:Params | None=None, *binary:bool | None=None, *size:int=1) -> Iterator[Row]
Iterate row-by-row on a result from the database.
methodpsycopg.psycopg.cursor_async.AsyncCursor.close() -> None
Close the current cursor and free associated resources.
methodpsycopg.psycopg.cursor_async.AsyncCursor.fetchmany(size:int=0) -> list[Row]
Return the next `!size` records from the current result set.
methodpsycopg.psycopg.cursor_async.AsyncCursor.fetchone() -> Row | None
Return the next record from the current result set.
methodpsycopg.psycopg.cursor_async.AsyncCursor.set_result(index:int) -> Self
Move to a specific result set.
classpsycopg.psycopg.errors.DataError
An error caused by problems with the processed data.
classpsycopg.psycopg.errors.DatabaseError
Exception raised for errors that are related to the database.
classpsycopg.psycopg.errors.Diagnostic
Details from a database error report.
classpsycopg.psycopg.errors.Error
Base exception for all the errors psycopg will raise.
classpsycopg.psycopg.errors.FinishedPGconn
Finished libpq connection.
classpsycopg.psycopg.errors.OperationalError
An error related to the database's operation.
classpsycopg.psycopg.errors.Warning
Exception raised for important warnings.
funcpsycopg.psycopg.errors.lookup(sqlstate:str) -> type[Error]
Lookup an error code or `constant name`__ and return its exception class.
classpsycopg.psycopg.pq._debug.PGconnDebug
Wrapper for a PQconn logging all its access.
funcpsycopg.psycopg.pq._debug.debugging(f:Func) -> Func
Wrap a function in order to log its arguments and return value on call.
classpsycopg.psycopg.pq._enums.ConnStatus
Current status of the connection.
classpsycopg.psycopg.pq._enums.DiagnosticField
Fields in an error report.
classpsycopg.psycopg.pq._enums.ExecStatus
The status of a command.
classpsycopg.psycopg.pq._enums.Ping
Response from a ping attempt.
classpsycopg.psycopg.pq._enums.PipelineStatus
Pipeline mode status of the libpq connection.
classpsycopg.psycopg.pq._enums.PollingStatus
The status of the socket during a connection.
classpsycopg.psycopg.pq._enums.Trace
Enum to control tracing of the client/server communication.
classpsycopg.psycopg.pq._enums.TransactionStatus
The transaction status of a connection.
funcpsycopg.psycopg.pq.misc.connection_summary(pgconn:abc.PGconn) -> str
Return summary information on a connection.
funcpsycopg.psycopg.pq.misc.get_compiled_port() -> str
Return the default port compiled with the libpq.
funcpsycopg.psycopg.pq.misc.strip_severity(msg:str) -> str
Strip severity and whitespaces from error message.
classpsycopg.psycopg.pq.pq_ctypes.Conninfo
Utility object to manipulate connection strings.
classpsycopg.psycopg.pq.pq_ctypes.Escaping
Utility object to escape strings for SQL interpolation.
classpsycopg.psycopg.pq.pq_ctypes.PGcancel
Token to cancel the current operation on a connection.
methodpsycopg.psycopg.pq.pq_ctypes.PGcancel.free(__PQfreeCancel:Any=impl.PQfreeCancel) -> None
Free the data structure created by :pq:`PQgetCancel()`.
classpsycopg.psycopg.pq.pq_ctypes.PGcancelConn
Token to handle non-blocking cancellation requests.
methodpsycopg.psycopg.pq.pq_ctypes.PGcancelConn.finish(__PQcancelFinish:Any=impl.PQcancelFinish) -> None
Free the data structure created by `PQcancelCreate()`.
classpsycopg.psycopg.pq.pq_ctypes.PGconn
Python representation of a libpq connection.
methodpsycopg.psycopg.pq.pq_ctypes.PGconn.change_password(user:bytes, passwd:bytes) -> None
Change a PostgreSQL password.
methodpsycopg.psycopg.pq.pq_ctypes.PGconn.encrypt_password(passwd:bytes, user:bytes, algorithm:bytes | None=None) -> bytes
Return the encrypted form of a PostgreSQL password.
methodpsycopg.psycopg.pq.pq_ctypes.PGconn.enter_pipeline_mode() -> None
Enter pipeline mode.
methodpsycopg.psycopg.pq.pq_ctypes.PGconn.exit_pipeline_mode() -> None
Exit pipeline mode.
methodpsycopg.psycopg.pq.pq_ctypes.PGconn.pipeline_sync() -> None
Mark a synchronization point in a pipeline.
methodpsycopg.psycopg.pq.pq_ctypes.PGconn.set_trace_flags(flags:Trace) -> None
Configure tracing behavior of client/server communication.
methodpsycopg.psycopg.pq.pq_ctypes.PGconn.trace(fileno:int) -> None
Enable tracing of the client/server communication to a file stream.
methodpsycopg.psycopg.pq.pq_ctypes.PGconn.untrace() -> None
Disable tracing, previously enabled through `trace()`.
classpsycopg.psycopg.pq.pq_ctypes.PGresult
Python representation of a libpq result.
funcpsycopg.psycopg.pq.pq_ctypes.version() -> int
Return the version number of the libpq currently loaded.
classpsycopg.psycopg.rows.AsyncRowFactory
Like `RowFactory`, taking an async cursor as argument.
classpsycopg.psycopg.rows.BaseRowFactory
Like `RowFactory`, taking either type of cursor as argument.
funcpsycopg.psycopg.rows.dict_row(cursor:BaseCursor[Any, Any]) -> RowMaker[DictRow]
Row factory to represent rows as dictionaries.
funcpsycopg.psycopg.rows.namedtuple_row(cursor:BaseCursor[Any, Any]) -> RowMaker[NamedTuple]
Row factory to represent rows as `~collections.namedtuple`.
funcpsycopg.psycopg.rows.no_result(values:Sequence[Any]) -> NoReturn
A `RowMaker` that always fail.
funcpsycopg.psycopg.rows.tuple_row(cursor:BaseCursor[Any, Any]) -> RowMaker[TupleRow]
Row factory to represent rows as simple tuples.
classpsycopg.psycopg.sql.Composable
Abstract base class for objects that can be used to compose an SQL string.
methodpsycopg.psycopg.sql.Composable.as_bytes(context:AdaptContext | None=None) -> bytes
Return the value of the object as bytes.
methodpsycopg.psycopg.sql.Composable.as_string(context:AdaptContext | None=None) -> str
Return the value of the object as string.
classpsycopg.psycopg.sql.Composed
A `Composable` object made of a sequence of `!Composable`.
methodpsycopg.psycopg.sql.Composed.join(joiner:SQL | LiteralString) -> Composed
Return a new `!Composed` interposing the `!joiner` with the `!Composed` items.
classpsycopg.psycopg.sql.Literal
A `Composable` representing an SQL value to include in a query.
classpsycopg.psycopg.sql.SQL
A `Composable` representing a snippet of SQL statement.
methodpsycopg.psycopg.sql.SQL.format(*args:Any, **kwargs:Any) -> Composed
Merge `Composable` objects into a template.
funcpsycopg.psycopg.sql.as_bytes(obj:Any, context:AdaptContext | None=None) -> bytes
Convert an object to a bytes string according to SQL rules.
funcpsycopg.psycopg.sql.as_string(obj:Any, context:AdaptContext | None=None) -> str
Convert an object to a string according to SQL rules.
funcpsycopg.psycopg.sql.quote(obj:Any, context:AdaptContext | None=None) -> str
Adapt a Python object to a quoted SQL string.
methodpsycopg.psycopg.transaction.AsyncTransaction.connection() -> AsyncConnection[Any]
The connection the object is managing.
classpsycopg.psycopg.transaction.BaseTransaction.Status
The current status of a transaction.
classpsycopg.psycopg.transaction.OutOfOrderTransactionNesting
Out-of-order transaction nesting detected
methodpsycopg.psycopg.transaction.Transaction.connection() -> Connection[Any]
The connection the object is managing.
funcpsycopg.psycopg.types.array.register_all_arrays(context:AdaptContext) -> None
Associate the array oid of all the types in Loader.globals.
classpsycopg.psycopg.types.composite.CompositeInfo
Manage information about a composite type.
classpsycopg.psycopg.types.composite.RecordBinaryLoader
Load a `record` field from PostgreSQL.
classpsycopg.psycopg.types.composite.RecordLoader
Load a `record` field from PostgreSQL.
classpsycopg.psycopg.types.enum.EnumDumper
Dumper for a generic Enum class
classpsycopg.psycopg.types.enum.EnumInfo
Manage information about an enum type.
funcpsycopg.psycopg.types.hstore.register_hstore(info:TypeInfo, context:AdaptContext | None=None) -> None
Register the adapters to load and dump hstore.
classpsycopg.psycopg.types.multirange.Multirange
Python representation for a PostgreSQL multirange type.
classpsycopg.psycopg.types.multirange.MultirangeDumper
Dumper for multirange types.
classpsycopg.psycopg.types.multirange.MultirangeInfo
Manage information about a multirange type.
classpsycopg.psycopg.types.range.BaseRangeLoader
Generic loader for a range.
classpsycopg.psycopg.types.range.Range
Python representation for a PostgreSQL range type.
methodpsycopg.psycopg.types.range.Range.isempty() -> bool
`!True` if the range is empty.
methodpsycopg.psycopg.types.range.Range.lower() -> T | None
The lower bound of the range.
methodpsycopg.psycopg.types.range.Range.lower_inc() -> bool
`!True` if the lower bound is included in the range.
methodpsycopg.psycopg.types.range.Range.lower_inf() -> bool
`!True` if the range doesn't have a lower bound.
methodpsycopg.psycopg.types.range.Range.upper() -> T | None
The upper bound of the range.
methodpsycopg.psycopg.types.range.Range.upper_inc() -> bool
`!True` if the upper bound is included in the range.
methodpsycopg.psycopg.types.range.Range.upper_inf() -> bool
`!True` if the range doesn't have an upper bound.
classpsycopg.psycopg.types.range.RangeDumper
Dumper for range types.
classpsycopg.psycopg.types.range.RangeInfo
Manage information about a range type.
funcpsycopg.psycopg.types.range.register_range(info:RangeInfo, context:AdaptContext | None=None) -> None
Register the adapters to load and dump a range type.
funcpsycopg.psycopg.types.shapely.register_shapely(info:TypeInfo, context:AdaptContext | None=None) -> None
Register Shapely dumper and loaders.
classpsycopg.psycopg.types.string.StrDumper
Dumper for strings in text format to the text oid.
classpsycopg.psycopg.types.string.StrDumperUnknown
Dumper for strings in text format to the unknown oid.
funcpsycopg.psycopg.waiting.wait_async(gen:PQGen[RV], fileno:int, interval:float=0.0) -> RV
Coroutine waiting for a generator to complete.
funcpsycopg.psycopg.waiting.wait_conn(gen:PQGenConn[RV], interval:float=0.0) -> RV
Wait for a connection generator using the best strategy available.
funcpsycopg.psycopg.waiting.wait_conn_async(gen:PQGenConn[RV], interval:float=0.0) -> RV
Coroutine waiting for a connection generator to complete.
funcpsycopg.psycopg.waiting.wait_epoll(gen:PQGen[RV], fileno:int, interval:float=0.0) -> RV
Wait for a generator using epoll where supported.
funcpsycopg.psycopg.waiting.wait_poll(gen:PQGen[RV], fileno:int, interval:float=0.0) -> RV
Wait for a generator using poll where supported.
funcpsycopg.psycopg.waiting.wait_select(gen:PQGen[RV], fileno:int, interval:float=0.0) -> RV
Wait for a generator using select where supported.
funcpsycopg.psycopg.waiting.wait_selector(gen:PQGen[RV], fileno:int, interval:float=0.0) -> RV
Wait for a generator using the best strategy available.
classpsycopg_pool.psycopg_pool._acompat.Queue
A Queue subclass with an interruptible get() method.
funcpsycopg_pool.psycopg_pool._acompat.agather(*timeout:float | None=None, *timeout_hint:str='', *tasks:asyncio.Task[Any]) -> None
Equivalent to asyncio.gather or Thread.join()
funcpsycopg_pool.psycopg_pool._acompat.aspawn(f:Callable[..., Coroutine[Any, Any, None]], args:tuple[Any, ...]=(), name:str | None=None) -> asyncio.Task[None]
Equivalent to asyncio.create_task.
funcpsycopg_pool.psycopg_pool._acompat.gather(*timeout:float | None=None, *timeout_hint:str='', *tasks:threading.Thread) -> None
Equivalent to asyncio.gather or Thread.join()
funcpsycopg_pool.psycopg_pool._acompat.spawn(f:Callable[..., Any], args:tuple[Any, ...]=(), name:str | None=None) -> threading.Thread
Equivalent to creating and running a daemon thread.
methodpsycopg_pool.psycopg_pool.base.BasePool.closed() -> bool
`!True` if the pool is closed.
methodpsycopg_pool.psycopg_pool.base.BasePool.get_stats() -> dict[str, int]
Return current stats about the pool usage.
methodpsycopg_pool.psycopg_pool.base.BasePool.pop_stats() -> dict[str, int]
Return current stats about the pool usage.
classpsycopg_pool.psycopg_pool.errors.PoolClosed
Attempt to get a connection from a closed pool.
classpsycopg_pool.psycopg_pool.errors.PoolTimeout
The pool couldn't provide a connection in acceptable time.
methodpsycopg_pool.psycopg_pool.pool.ConnectionPool.check_connection(conn:CT) -> None
A simple check to verify that a connection is still working.
methodpsycopg_pool.psycopg_pool.pool.ConnectionPool.close(timeout:float=5.0) -> None
Close the pool and make it unavailable to new clients.
methodpsycopg_pool.psycopg_pool.pool.ConnectionPool.connection(timeout:float | None=None) -> Iterator[CT]
Context manager to obtain a connection from the pool.
methodpsycopg_pool.psycopg_pool.pool.ConnectionPool.getconn(timeout:float | None=None) -> CT
Obtain a connection from the pool.
methodpsycopg_pool.psycopg_pool.pool.ConnectionPool.putconn(conn:CT) -> None
Return a connection to the loving hands of its pool.
methodpsycopg_pool.psycopg_pool.pool.ConnectionPool.resize(min_size:int, max_size:int | None=None) -> None
Change the size of the pool during runtime.
methodpsycopg_pool.psycopg_pool.pool.ConnectionPool.run_task(task:MaintenanceTask) -> None
Run a maintenance task in a worker.
methodpsycopg_pool.psycopg_pool.pool.ConnectionPool.schedule_task(task:MaintenanceTask, delay:float) -> None
Run a maintenance task in a worker in the future.
methodpsycopg_pool.psycopg_pool.pool.ConnectionPool.worker(q:Queue[MaintenanceTask]) -> None
Runner to execute pending maintenance task.
classpsycopg_pool.psycopg_pool.pool.MaintenanceTask
A task to run asynchronously to maintain the pool state.
methodpsycopg_pool.psycopg_pool.pool.MaintenanceTask.run() -> None
Run the task.
classpsycopg_pool.psycopg_pool.pool.ReturnConnection
Clean up and return a connection to the pool.
classpsycopg_pool.psycopg_pool.pool.Schedule
Schedule a task in the pool scheduler.
classpsycopg_pool.psycopg_pool.pool.ShrinkPool
If the pool can shrink, remove one connection.
classpsycopg_pool.psycopg_pool.pool.StopWorker
Signal the maintenance worker to terminate.
methodpsycopg_pool.psycopg_pool.pool.WaitingClient.fail(error:Exception) -> bool
Signal the client that, alas, they won't have a connection today.
methodpsycopg_pool.psycopg_pool.pool.WaitingClient.set(conn:CT) -> bool
Signal the client waiting that a connection is ready.
methodpsycopg_pool.psycopg_pool.pool.WaitingClient.wait(timeout:float) -> CT
Wait for a connection to be set and return it.
methodpsycopg_pool.psycopg_pool.pool_async.AsyncConnectionPool.close(timeout:float=5.0) -> None
Close the pool and make it unavailable to new clients.
methodpsycopg_pool.psycopg_pool.pool_async.AsyncConnectionPool.getconn(timeout:float | None=None) -> ACT
Obtain a connection from the pool.
methodpsycopg_pool.psycopg_pool.pool_async.AsyncConnectionPool.putconn(conn:ACT) -> None
Return a connection to the loving hands of its pool.
methodpsycopg_pool.psycopg_pool.pool_async.AsyncConnectionPool.resize(min_size:int, max_size:int | None=None) -> None
Change the size of the pool during runtime.
methodpsycopg_pool.psycopg_pool.pool_async.AsyncConnectionPool.run_task(task:MaintenanceTask) -> None
Run a maintenance task in a worker.
methodpsycopg_pool.psycopg_pool.pool_async.AsyncConnectionPool.schedule_task(task:MaintenanceTask, delay:float) -> None
Run a maintenance task in a worker in the future.
methodpsycopg_pool.psycopg_pool.pool_async.AsyncConnectionPool.worker(q:AQueue[MaintenanceTask]) -> None
Runner to execute pending maintenance task.
methodpsycopg_pool.psycopg_pool.pool_async.MaintenanceTask.run() -> None
Run the task.
classpsycopg_pool.psycopg_pool.pool_async.ReturnConnection
Clean up and return a connection to the pool.
classpsycopg_pool.psycopg_pool.pool_async.Schedule
Schedule a task in the pool scheduler.
classpsycopg_pool.psycopg_pool.pool_async.ShrinkPool
If the pool can shrink, remove one connection.
classpsycopg_pool.psycopg_pool.pool_async.StopWorker
Signal the maintenance worker to terminate.
methodpsycopg_pool.psycopg_pool.pool_async.WaitingClient.set(conn:ACT) -> bool
Signal the client waiting that a connection is ready.
methodpsycopg_pool.psycopg_pool.pool_async.WaitingClient.wait(timeout:float) -> ACT
Wait for a connection to be set and return it.
methodpsycopg_pool.psycopg_pool.sched.Scheduler.enter(delay:float, action:Callable[[], Any] | None) -> Task
Enter a new task in the queue delayed in the future.
methodpsycopg_pool.psycopg_pool.sched.Scheduler.enterabs(time:float, action:Callable[[], Any] | None) -> Task
Enter a new task in the queue at an absolute time.
methodpsycopg_pool.psycopg_pool.sched.Scheduler.run() -> None
Execute the events scheduled.
methodpsycopg_pool.psycopg_pool.sched_async.AsyncScheduler.enter(delay:float, action:Callable[[], Any] | None) -> Task
Enter a new task in the queue delayed in the future.
methodpsycopg_pool.psycopg_pool.sched_async.AsyncScheduler.enterabs(time:float, action:Callable[[], Any] | None) -> Task
Enter a new task in the queue at an absolute time.
methodpsycopg_pool.psycopg_pool.sched_async.AsyncScheduler.run() -> None
Execute the events scheduled.

この情報について

掲載しているシグネチャは psycopg/psycopg の公開ソースコードを Python の ast モジュールで静的解析し、引数名・デフォルト値・ 型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。 詳しくは仕組みの解説をご覧ください。

収録ライブラリ一覧(全 805 件)へ戻る