PgConn is a low-level PostgreSQL connection handle. It is not safe for concurrent usage.
| 75 | |
| 76 | // PgConn is a low-level PostgreSQL connection handle. It is not safe for concurrent usage. |
| 77 | type PgConn struct { |
| 78 | conn net.Conn |
| 79 | tlsConfig *tls.Config // tls.Config that conn was negotiated with; nil if conn is not TLS |
| 80 | pid uint32 // backend pid |
| 81 | secretKey []byte // key to use to send a cancel query message to the server |
| 82 | parameterStatuses map[string]string // parameters that have been reported by the server |
| 83 | txStatus byte |
| 84 | frontend *pgproto3.Frontend |
| 85 | bgReader *bgreader.BGReader |
| 86 | slowWriteTimer *time.Timer |
| 87 | bgReaderStarted chan struct{} |
| 88 | |
| 89 | customData map[string]any |
| 90 | |
| 91 | config *Config |
| 92 | |
| 93 | status byte // One of connStatus* constants |
| 94 | |
| 95 | bufferingReceive bool |
| 96 | bufferingReceiveMux sync.Mutex |
| 97 | bufferingReceiveMsg pgproto3.BackendMessage |
| 98 | bufferingReceiveErr error |
| 99 | |
| 100 | peekedMsg pgproto3.BackendMessage |
| 101 | |
| 102 | // Reusable / preallocated resources |
| 103 | resultReader ResultReader |
| 104 | multiResultReader MultiResultReader |
| 105 | pipeline Pipeline |
| 106 | contextWatcher *ctxwatch.ContextWatcher |
| 107 | fieldDescriptions [16]FieldDescription |
| 108 | |
| 109 | cleanupDone chan struct{} |
| 110 | } |
| 111 | |
| 112 | // Connect establishes a connection to a PostgreSQL server using the environment and connString (in URL or keyword/value |
| 113 | // format) to provide configuration. See documentation for [ParseConfig] for details. ctx can be used to cancel a |
nothing calls this directly
no outgoing calls
no test coverage detected