fix: neon db errors for prepared statements
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"log/slog"
|
||||
"os"
|
||||
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
@@ -25,7 +26,14 @@ func Init() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
dbpool, err := pgxpool.New(context.Background(), connString)
|
||||
config, err := pgxpool.ParseConfig(connString)
|
||||
if err != nil {
|
||||
slog.Error("unable to parse connection string", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
config.ConnConfig.DefaultQueryExecMode = pgx.QueryExecModeCacheDescribe
|
||||
|
||||
dbpool, err := pgxpool.NewWithConfig(context.Background(), config)
|
||||
if err != nil {
|
||||
slog.Error("unable to create connection pool", "error", err)
|
||||
os.Exit(1)
|
||||
|
||||
Reference in New Issue
Block a user