Add kpgx.NewFromPgxPool() for facilitating more complicated configs

pull/20/head v1.4.5
Vinícius Garcia 2022-04-11 19:41:56 -03:00
parent 1224a1b297
commit b44c7e8500
4 changed files with 9 additions and 4 deletions

View File

@ -16,6 +16,6 @@ require (
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.0 // indirect
github.com/ory/dockertest v3.3.5+incompatible
github.com/vingarcia/ksql v1.4.2
github.com/vingarcia/ksql v1.4.4
gotest.tools v2.2.0+incompatible // indirect
)

View File

@ -233,8 +233,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1
github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/vingarcia/ksql v1.4.2 h1:kHIrYHdCh9d1ygsDkW19laDhh2FUjVHRcB03Lj+l7r8=
github.com/vingarcia/ksql v1.4.2/go.mod h1:X9ygN+NPzMyGl6l7xsq9Uob7z6QWBw/7xuCzjfZKEsU=
github.com/vingarcia/ksql v1.4.4 h1:bXu0Cowa1TkGVJ+sfg3lVbYCA8zwR6xG6WnLq9ghfUI=
github.com/vingarcia/ksql v1.4.4/go.mod h1:X9ygN+NPzMyGl6l7xsq9Uob7z6QWBw/7xuCzjfZKEsU=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=

View File

@ -11,6 +11,11 @@ import (
_ "github.com/lib/pq"
)
// NewFromPgxPool builds a ksql.DB from a *pgxpool.Pool instance.
func NewFromPgxPool(pool *pgxpool.Pool) (db ksql.DB, err error) {
return ksql.NewWithAdapter(NewPGXAdapter(pool), "postgres")
}
// New instantiates a new ksql.Client using pgx as the backend driver
func New(
ctx context.Context,

View File

@ -6,7 +6,7 @@ require (
github.com/jackc/pgx/v4 v4.13.0
github.com/jmoiron/sqlx v1.3.4
github.com/lib/pq v1.10.4
github.com/vingarcia/ksql v1.1.0
github.com/vingarcia/ksql v1.4.4
github.com/vingarcia/ksql/adapters/kpgx v0.0.0-00010101000000-000000000000
gorm.io/driver/postgres v1.2.2
gorm.io/gorm v1.22.3