Documentation ¶
Overview ¶
Package pglib is for encapsulating github.com/go-pg/pg any operations
As a quick start:
cfg := pglib.GOPGConfig{ URL: "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable", DebugMode: true, PoolSize: 5, } client, err := pglib.NewDefaultGOPGClient(cfg) if err != nil { panic(err) } fmt.Println(client.Ping(context.Background()))
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GOPGClient ¶
type GOPGClient struct {
*pg.DB
}
func NewCustomizeGOPGClient ¶
func NewCustomizeGOPGClient(opts *pg.Options, debugMode bool) (*GOPGClient, error)
func NewDefaultGOPGClient ¶
func NewDefaultGOPGClient(config GOPGConfig) (*GOPGClient, error)
type GOPGConfig ¶
type GOPGDebugQueryHook ¶
type GOPGDebugQueryHook struct { }
func (*GOPGDebugQueryHook) AfterQuery ¶
func (h *GOPGDebugQueryHook) AfterQuery(ctx context.Context, event *pg.QueryEvent) error
func (*GOPGDebugQueryHook) BeforeQuery ¶
Click to show internal directories.
Click to hide internal directories.