From 3e716c4b06ba33c781822021eaa55fa5cbdf95e0 Mon Sep 17 00:00:00 2001 From: Lev Zakharov Date: Sat, 19 Aug 2023 21:59:03 +0300 Subject: [PATCH] add example to the doc --- stdlib/sql.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stdlib/sql.go b/stdlib/sql.go index 1bb19d35..8578b3a6 100644 --- a/stdlib/sql.go +++ b/stdlib/sql.go @@ -14,6 +14,18 @@ // 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 // pgx.ConnConfig must first be registered with the driver. This registration returns a connection string which is used // with sql.Open.