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, PgConfigError, PgConnectionError, PgError, PgListenError, PgListenStoppedError, PgMessageTooLargeError, PgNoRowsError, PgNotifyOverflowError, PgNullError, PgPoolError, PgProtocolError, PgQueryError, PgSecurityError, PgStateError, PgTimeoutError, PgTypeError, PgUnavailableError, PoolErrorKind, ProtocolError, RetryAdvice, SqlStateAdminShutdown, SqlStateCannotConnectNow, SqlStateCheckViolation, SqlStateConfigurationLimitExceeded, SqlStateCrashShutdown, SqlStateDeadlockDetected, SqlStateDuplicateObject, SqlStateExclusionViolation, SqlStateForeignKeyViolation, SqlStateIdleInTransactionSessionTimeout, SqlStateIdleSessionTimeout, SqlStateInFailedSqlTransaction, SqlStateInsufficientPrivilege, SqlStateInvalidCatalogName, SqlStateInvalidPassword, SqlStateLockNotAvailable, SqlStateNotNullViolation, SqlStateObjectInUse, SqlStateProtocolViolation, SqlStateQueryCanceled, SqlStateSerializationFailure, SqlStateSyntaxError, SqlStateTransactionTimeout, SqlStateUndefinedTable, SqlStateUniqueViolation, columnName, constraintName, dataTypeName, errorField, getErrorField, internalPosition, internalQuery, isCheckViolation, isDeadlockDetected, isDuplicateObject, isExclusionViolation, isForeignKeyViolation, isIntegrityConstraintViolation, isLastingRefusal, isNotNullViolation, isQueryCanceled, isSerializationFailure, isSessionFatal, isTransientError, isUniqueViolation, newPoolError, position, retryAdvice, schemaName, serverErrors, tableName, where, PgConnState, state, SslMode, SslNegotiation, ChannelBindingMode, AuthMethod, TargetSessionAttrs, LoadBalanceHosts, HostEntry, CredentialsRequest, ConnCredentials, CredentialsProvider, makeCredentialsProvider, 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, to, 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