pg

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Exec(context.Context, string, ...any) (pgconn.CommandTag, error)
	Query(context.Context, string, ...any) (pgx.Rows, error)
	QueryRow(context.Context, string, ...any) pgx.Row
	Prepare(ctx context.Context, name, sql string) (sd *pgconn.StatementDescription, err error)
}

DB is the common interface for database operations.

type DataType added in v0.1.14

type DataType struct {
	ID       uint32
	Name     string
	Nullable bool
}

type Repo

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

func New

func New(db DB) *Repo

func (*Repo) DescribeQuery

func (r *Repo) DescribeQuery(ctx context.Context, q *sql.Query) error

func (*Repo) GetTableNameByID

func (r *Repo) GetTableNameByID(ctx context.Context, id uint32) (string, string, error)

func (*Repo) GetTypeNameByID

func (r *Repo) GetTypeNameByID(ctx context.Context, id uint32) (DataType, error)

Jump to

Keyboard shortcuts

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