async_postgres/pg_connection

Search:
Group by:

PostgreSQL connection lifecycle, I/O, simple-query protocol, statement cache and LISTEN/NOTIFY support.

This module is a thin re-export hub. The actual implementation lives in the pg_connection/ subdirectory:

  • pg_connection/types — PgConnection, ConnConfig, the tracing data types, the PgTracer hook record, and the tracing helper templates (withConnTracing, withTracing). Also the operations that keep PgConnection's private fields consistent and assemble the outgoing messages: send-buffer builders, receive buffering, wire-debt counters, the statement cache with its Close queues, the notification queue, and the replication write queue.
  • pg_connection/dsn — DSN parsing (URI and libpq keyword=value formats) plus initConnConfig and parseDsn.
  • pg_connection/buffer_io — send buffering and message parsing (nextMessage, recvMessage, sendMsg), TCP keepalive, closeTransport, isConnected / socketHasFin, and the getHosts host helper.
  • pg_connection/ssl — SSL negotiation (negotiateSSL) for chronos+BearSSL and asyncdispatch+OpenSSL.
  • pg_connection/simple_query — simple-query / simple-exec / ping, cancel / invalidateOnTimeout, checkSessionAttrs, quoteIdentifier, quoteLiteral, QueryResult helpers.
  • pg_connection/lifecycle — connect / connectToHost / close, orderedHosts (load-balanced host ordering) and the SCRAM/require_auth helpers.
  • pg_connection/notify — LISTEN/NOTIFY pump, waitNotification, reconnectInPlace.
  • pg_connection/type_lookup — lookupTypeOids generic helper to resolve type names to OIDs via to_regtype (extension types like hstore, citext, etc.).

What this hub re-exports is the public API. Submodules are internal: Nim needs * for sibling use, so their exports are wider than the promised surface (tests/api_surface.public.golden vs .internal.golden).

Exports

ErrorField, PgError, SqlStateNotNullViolation, SqlStateConfigurationLimitExceeded, position, SqlStateUniqueViolation, SqlStateForeignKeyViolation, PgUnavailableError, errorField, isForeignKeyViolation, RetryAdvice, SqlStateSerializationFailure, PgMessageTooLargeError, tableName, SqlStateExclusionViolation, PgTimeoutError, serverErrors, isCheckViolation, retryAdvice, isExclusionViolation, where, SqlStateCheckViolation, SqlStateAdminShutdown, PgConfigError, PgConnectionError, isQueryCanceled, SqlStateInsufficientPrivilege, PgQueryError, PgTypeError, PgListenError, dataTypeName, internalQuery, PgPoolError, SqlStateDuplicateObject, PgNoRowsError, isSessionFatal, isLastingRefusal, PgNullError, SqlStateInvalidPassword, internalPosition, schemaName, getErrorField, SqlStateInvalidCatalogName, SqlStateSyntaxError, SqlStateTransactionTimeout, isSerializationFailure, SqlStateQueryCanceled, PgStateError, SqlStateCannotConnectNow, PgNotifyOverflowError, SqlStateUndefinedTable, newPoolError, PoolErrorKind, isIntegrityConstraintViolation, SqlStateProtocolViolation, SqlStateObjectInUse, isTransientError, PgListenStoppedError, PgSecurityError, isDuplicateObject, constraintName, isUniqueViolation, isDeadlockDetected, PgProtocolError, isNotNullViolation, SqlStateDeadlockDetected, SqlStateIdleSessionTimeout, SqlStateLockNotAvailable, SqlStateCrashShutdown, ProtocolError, SqlStateIdleInTransactionSessionTimeout, columnName, SqlStateInFailedSqlTransaction, PgConnState, state, SslMode, SslNegotiation, ChannelBindingMode, AuthMethod, TargetSessionAttrs, LoadBalanceHosts, HostEntry, ConnConfig, PgTracer, Notification, NotifyCallback, Notice, NoticeCallback, ReconnectCallback, NotifyOverflowCallback, ListenErrorCallback, CachedStmt, dialAddr, displayHost, QueryResult, CopyResult, CopyOutInfo, CopyInInfo, CopyOutCallback, CopyInCallback, PgPoolOwner, PgConnection, RowCallback, ClientCertPairingErrorMsg, TraceContext, TraceCopyDirection, TraceConnectStartData, TraceConnectEndData, TraceQueryStartData, TraceQueryEndData, TracePrepareStartData, TracePrepareEndData, TracePipelineStartData, TracePipelineEndData, TraceCopyStartData, TraceCopyEndData, TracePoolAcquireStartData, TracePoolAcquireEndData, TracePoolReleaseStartData, TracePoolReleaseEndData, TracePoolDoubleReleaseData, TracePoolCloseErrorData, TraceTransportCloseErrorData, TransportCloseStage, CleanupKind, CleanupSkipReason, TraceCleanupSkippedData, TraceLeakedSessionLocksData, TraceInsecureAuthData, TraceDeprecatedAuthData, TraceAdvisoryUnlockFailedData, txStatus, pid, host, port, config, createdAt, sslEnabled, serverParams, serverParam, notifyDropped, listenError, notifyMaxQueue, notifyMaxQueue=, notifyMaxQueueBytes, notifyMaxQueueBytes=, listenReconnectMaxAttempts, listenReconnectMaxAttempts=, listenReconnectMaxBackoff, listenReconnectMaxBackoff=, stmtCacheCapacity, stmtCacheCapacity=, withConnTracing, withTracing, initConnConfig, parseDsn, validateConnConfig, isUnixSocket, unixSocketPath, getHosts, makeCopyOutCallback, makeCopyInCallback, socketHasFin, socketHasPendingData, isConnected, len, columnIndex, rows, items, quoteIdentifier, quoteLiteral, cancel, cancelNoWait, invalidateOnTimeout, simpleExec, simpleQuery, ping, checkSessionAttrs, close, orderedHosts, connect, connect, connectToHost, onNotify, onListenError, onNotice, onReconnect, onNotifyOverflow, listen, unlisten, stopListening, waitNotification, TypeOidInfo, lookupTypeOids