postgres

package
v0.16.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

postgres_plugin.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPluginContext

func ApplyPluginContext(ctx context.Context, tx pgx.Tx, pluginCtx map[string]any) error

ApplyPluginContext sets session variables using set_config for all keys in ctx. For each key, it sets two variables: one with prefix "request." (complex types are marshaled to JSON) and one with prefix "erctx." using the default string representation. Keys are processed in sorted order.

func NewPgCachePlugin

func NewPgCachePlugin() *pgCachePlugin

func NewPgPlugin

func NewPgPlugin() *pgPlugin

Types

type DBPool

type DBPool interface {
	Begin(ctx context.Context) (pgx.Tx, error)
	Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)
	Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
}

DBPool abstracts pgxpool.Pool and pgxmock.PgxPoolIface for production and testing Only the methods used in pgPlugin are included

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL