@@ -17,8 +17,8 @@ import (
1717 "github.com/jackc/pgx/v5/pgtype"
1818)
1919
20- // ConnConfig contains all the options used to establish a connection. It must be created by ParseConfig and
21- // then it can be modified. A manually initialized ConnConfig will cause ConnectConfig to panic.
20+ // ConnConfig contains all the options used to establish a connection. It must be created by [ ParseConfig] and
21+ // then it can be modified. A manually initialized ConnConfig will cause [ ConnectConfig] to panic.
2222type ConnConfig struct {
2323 pgconn.Config
2424
@@ -37,8 +37,8 @@ type ConnConfig struct {
3737
3838 // DefaultQueryExecMode controls the default mode for executing queries. By default pgx uses the extended protocol
3939 // and automatically prepares and caches prepared statements. However, this may be incompatible with proxies such as
40- // PGBouncer. In this case it may be preferable to use QueryExecModeExec or QueryExecModeSimpleProtocol. The same
41- // functionality can be controlled on a per query basis by passing a QueryExecMode as the first query argument.
40+ // PGBouncer. In this case it may be preferable to use [ QueryExecModeExec] or [ QueryExecModeSimpleProtocol] . The same
41+ // functionality can be controlled on a per query basis by passing a [ QueryExecMode] as the first query argument.
4242 DefaultQueryExecMode QueryExecMode
4343
4444 createdByParseConfig bool // Used to enforce created by ParseConfig rule.
@@ -131,7 +131,7 @@ var (
131131)
132132
133133// Connect establishes a connection with a PostgreSQL server with a connection string. See
134- // pgconn.Connect for details.
134+ // [ pgconn.Connect] for details.
135135func Connect (ctx context.Context , connString string ) (* Conn , error ) {
136136 connConfig , err := ParseConfig (connString )
137137 if err != nil {
@@ -141,7 +141,7 @@ func Connect(ctx context.Context, connString string) (*Conn, error) {
141141}
142142
143143// ConnectWithOptions behaves exactly like Connect with the addition of options. At the present options is only used to
144- // provide a GetSSLPassword function.
144+ // provide a [pgconn.GetSSLPasswordFunc] function.
145145func ConnectWithOptions (ctx context.Context , connString string , options ParseConfigOptions ) (* Conn , error ) {
146146 connConfig , err := ParseConfigWithOptions (connString , options )
147147 if err != nil {
@@ -151,7 +151,7 @@ func ConnectWithOptions(ctx context.Context, connString string, options ParseCon
151151}
152152
153153// ConnectConfig establishes a connection with a PostgreSQL server with a configuration struct.
154- // connConfig must have been created by ParseConfig.
154+ // connConfig must have been created by [ ParseConfig] .
155155func ConnectConfig (ctx context.Context , connConfig * ConnConfig ) (* Conn , error ) {
156156 // In general this improves safety. In particular avoid the config.Config.OnNotification mutation from affecting other
157157 // connections with the same config. See https://github.com/jackc/pgx/issues/618.
@@ -160,8 +160,8 @@ func ConnectConfig(ctx context.Context, connConfig *ConnConfig) (*Conn, error) {
160160 return connect (ctx , connConfig )
161161}
162162
163- // ParseConfigWithOptions behaves exactly as ParseConfig does with the addition of options. At the present options is
164- // only used to provide a GetSSLPassword function.
163+ // ParseConfigWithOptions behaves exactly as [ ParseConfig] does with the addition of options. At the present options is
164+ // only used to provide a [pgconn.GetSSLPasswordFunc] function.
165165func ParseConfigWithOptions (connString string , options ParseConfigOptions ) (* ConnConfig , error ) {
166166 config , err := pgconn .ParseConfigWithOptions (connString , options .ParseConfigOptions )
167167 if err != nil {
@@ -308,8 +308,8 @@ func (c *Conn) Close(ctx context.Context) error {
308308}
309309
310310// 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 Query, QueryRow, and
312- // Exec to execute the statement. It can also be used with Batch.Queue.
311+ // placeholders are referenced positionally as $1, $2, etc. name can be used instead of sql with [Conn. Query],
312+ // [Conn.QueryRow], and [Conn. Exec] to execute the statement. It can also be used with [ Batch.Queue] .
313313//
314314// The underlying PostgreSQL identifier for the prepared statement will be name if name != sql or a digest of sql if
315315// name == sql.
@@ -933,7 +933,7 @@ func (c *Conn) QueryRow(ctx context.Context, sql string, args ...any) Row {
933933}
934934
935935// SendBatch sends all queued queries to the server at once. All queries are run in an implicit transaction unless
936- // explicit transaction control statements are executed. The returned BatchResults must be closed before the connection
936+ // explicit transaction control statements are executed. The returned [ BatchResults] must be closed before the connection
937937// is used again.
938938//
939939// Depending on the QueryExecMode, all queries may be prepared before any are executed. This means that creating a table
@@ -1277,7 +1277,7 @@ func (c *Conn) sanitizeForSimpleQuery(sql string, args ...any) (string, error) {
12771277 return sanitize .SanitizeSQL (sql , valueArgs ... )
12781278}
12791279
1280- // LoadType inspects the database for typeName and produces a pgtype.Type suitable for registration. typeName must be
1280+ // LoadType inspects the database for typeName and produces a [ pgtype.Type] suitable for registration. typeName must be
12811281// the name of a type where the underlying type(s) is already understood by pgx. It is for derived types. In particular,
12821282// typeName must be one of the following:
12831283// - An array type name of a type that is already registered. e.g. "_foo" when "foo" is registered.
0 commit comments