mirror of https://github.com/jackc/pgx.git
add example to the doc
parent
51ade172e5
commit
3e716c4b06
stdlib
|
@ -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…
Reference in New Issue