dsql

package
v0.1.40 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmptyPatch = derrors.StrError("empty patch")
	Impossible = derrors.StrError("impossible")
	NotFound   = derrors.StrError("not found")
)

Variables

This section is empty.

Functions

func AddTables

func AddTables(ctx context.Context, conn *pgxpool.Pool, model *metamodel.Model, buf *bytes.Buffer) ([]*metamodel.StructType, error)

func BuildConnURI

func BuildConnURI(pgCfg *dconfig.Postgres) (string, error)

func Connect

func Connect(ctx context.Context, pgCfg *dconfig.Postgres, pgxLogger pgx.Logger) (*pgx.Conn, error)

func ConnectPool

func ConnectPool(ctx context.Context, pgCfg *dconfig.Postgres, pgxLogger pgx.Logger) (*pgxpool.Pool, error)

func CreateDB

func CreateDB(ctx context.Context, pgCfg *dconfig.Postgres, pgxLogger pgx.Logger) (err error)

func DropDB

func DropDB(ctx context.Context, pgCfg *dconfig.Postgres, pgxLogger pgx.Logger) (err error)

func ExecSingle

func ExecSingle(ctx context.Context, querier pgxtype.Querier, sql string, args ...any) error

func PatchField

func PatchField(buf *bytes.Buffer, args []any, arg any, name string) []any

func QuerySingle

func QuerySingle(ctx context.Context, querier pgxtype.Querier, sql string, args []any, dest []any) error

Types

type PgxLoggerWrapper

type PgxLoggerWrapper struct {
	// contains filtered or unexported fields
}

func NewPgxLoggerWrapper

func NewPgxLoggerWrapper(logger dlog.Logger) PgxLoggerWrapper

func (PgxLoggerWrapper) Log

func (plw PgxLoggerWrapper) Log(_ context.Context, level pgx.LogLevel, msg string, data map[string]any)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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