sdkagent

psycopg2 API reference

50 public APIs from psycopg2 (psycopg/psycopg2) — 34 classes, 1 functions, 15 methods. Signatures extracted by static analysis of the actual source.

Repository: psycopg/psycopg2

KindCount
Classes34
Functions1
Methods15

API list

methodlib._json.Json.dumps(obj)
Serialize *obj* in JSON format.
classlib._range.DateRange
Represents :sql:`daterange` values.
classlib._range.DateTimeRange
Represents :sql:`tsrange` values.
classlib._range.DateTimeTZRange
Represents :sql:`tstzrange` values.
classlib._range.NumberRangeAdapter
Adapt a range if the subtype doesn't need quotes.
classlib._range.Range
Python representation for a PostgreSQL |range|_ type.
methodlib._range.Range.isempty()
`!True` if the range is empty.
methodlib._range.Range.lower()
The lower bound of the range.
methodlib._range.Range.upper()
The upper bound of the range.
classlib._range.RangeAdapter
`ISQLQuote` adapter for `Range` subclasses.
funclib.connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs)
Create a new database connection.
classlib.extensions.NoneAdapter
Adapt None to NULL.
classlib.extensions.SQL_IN
Adapt any iterable to an SQL quotable object.
classlib.extras.DictConnection
A connection that uses `DictCursor` automatically.
classlib.extras.DictCursor
A cursor that keeps a list of column name -> index mappings__.
classlib.extras.DictCursorBase
Base class for all dict-like cursors.
classlib.extras.DictRow
A row object that allow by-column-name access to data.
classlib.extras.HstoreAdapter
Adapt a Python dict to the hstore syntax.
classlib.extras.Inet
Wrap a string to allow for correct SQL-quoting of inet values.
classlib.extras.LoggingConnection
A connection that logs all queries to a file or logger__ object.
methodlib.extras.LoggingConnection.filter(msg, curs)
Filter the query before logging it.
classlib.extras.LoggingCursor
A cursor that logs queries using its connection logging facilities.
classlib.extras.MinTimeLoggingConnection
A connection that logs queries based on execution time.
classlib.extras.MinTimeLoggingCursor
The cursor sub-class companion to `MinTimeLoggingConnection`.
classlib.extras.NamedTupleConnection
A connection that uses `NamedTupleCursor` automatically.
classlib.extras.NamedTupleCursor
A cursor that generates results as `~collections.namedtuple`.
classlib.extras.RealDictConnection
A connection that uses `RealDictCursor` automatically.
classlib.extras.RealDictCursor
A cursor that uses a real dict as the base type for rows.
classlib.extras.RealDictRow
A `!dict` subclass representing a data record.
classlib.extras.ReplicationCursor
A cursor used for communication on replication connections.
methodlib.extras.ReplicationCursor.drop_replication_slot(slot_name)
Drop streaming replication slot.
classlib.extras.UUID_adapter
Adapt Python's uuid.UUID__ type to PostgreSQL's uuid__.
classlib.pool.AbstractConnectionPool
Generic key-based pooling code.
classlib.pool.ThreadedConnectionPool
A connection pool that works with the threading module.
methodlib.pool.ThreadedConnectionPool.putconn(conn=None, key=None, close=False)
Put away an unused connection.
classlib.sql.Composable
Abstract base class for objects that can be used to compose an SQL string.
methodlib.sql.Composable.as_string(context)
Return the string value of the object.
classlib.sql.Composed
A `Composable` object made of a sequence of `!Composable`.
methodlib.sql.Composed.seq()
The list of the content of the `!Composed`.
methodlib.sql.Identifier.string()
The string wrapped by the `Identifier`.
classlib.sql.Literal
A `Composable` representing an SQL value to include in a query.
methodlib.sql.Literal.wrapped()
The object wrapped by the `!Literal`.
classlib.sql.Placeholder
A `Composable` representing a placeholder for query parameters.
methodlib.sql.Placeholder.name()
The name of the `!Placeholder`.
classlib.sql.SQL
A `Composable` representing a snippet of SQL statement.
methodlib.sql.SQL.format(*args, **kwargs)
Merge `Composable` objects into a template.
methodlib.sql.SQL.join(seq)
Join a sequence of `Composable`.
methodlib.sql.SQL.string()
The string wrapped by the `!SQL` object.
classlib.tz.FixedOffsetTimezone
Fixed offset in minutes east from UTC.
classlib.tz.LocalTimezone
Platform idea of local timezone.

About this data

These signatures were extracted from the public source of psycopg/psycopg2 using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries