MCPcopy
hub / github.com/jackc/pgx / Close

Method Close

conn.go:301–308  ·  view source on GitHub ↗

Close closes a connection. It is safe to call Close on an already closed connection.

(ctx context.Context)

Source from the content-addressed store, hash-verified

299// Close closes a connection. It is safe to call Close on an already closed
300// connection.
301func (c *Conn) Close(ctx context.Context) error {
302 if c.IsClosed() {
303 return nil
304 }
305
306 err := c.pgConn.Close(ctx)
307 return err
308}
309
310// Prepare creates a prepared statement with name and sql. sql can contain placeholders for bound parameters. These
311// placeholders are referenced positionally as $1, $2, etc. name can be used instead of sql with [Conn.Query],

Callers 1

Calls 2

IsClosedMethod · 0.95
CloseMethod · 0.65

Tested by 1