mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
add example to the doc
This commit is contained in:
parent
51ade172e5
commit
3e716c4b06
@ -14,6 +14,18 @@
|
|||||||
// return err
|
// return err
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
// Or from a *pgxpool.Pool.
|
||||||
|
//
|
||||||
|
// pool, err := pgxpool.New(context.Background(), os.Getenv("DATABASE_URL"))
|
||||||
|
// if err != nil {
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// db, err := stdlib.OpenDBFromPool(pool)
|
||||||
|
// if err != nil {
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
//
|
||||||
// Or a pgx.ConnConfig can be used to set configuration not accessible via connection string. In this case the
|
// Or a pgx.ConnConfig can be used to set configuration not accessible via connection string. In this case the
|
||||||
// pgx.ConnConfig must first be registered with the driver. This registration returns a connection string which is used
|
// pgx.ConnConfig must first be registered with the driver. This registration returns a connection string which is used
|
||||||
// with sql.Open.
|
// with sql.Open.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user