db

package
v1.1.42 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RDBConSt

type RDBConSt interface {
	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
}

type RDBConnection

type RDBConnection interface {
	DbExec(ctx context.Context, sql string, args ...any) error
	DbQuery(ctx context.Context, sql string, args ...any) (RDBRows, error)
	DbQueryRow(ctx context.Context, sql string, args ...any) RDBRow
	DbExecM(ctx context.Context, sql string, argMap map[string]any) error
	DbQueryM(ctx context.Context, sql string, argMap map[string]any) (RDBRows, error)
	DbQueryRowM(ctx context.Context, sql string, argMap map[string]any) RDBRow
	HErr(err error) error
}

type RDBConnectionWithHelpers

type RDBConnectionWithHelpers interface {
	RDBConnection

	HfList(ctx context.Context, ops RDBListOptions) (int64, error)
	HfGenerateSort(rNames []string, allowed map[string]string) []string
	HfGet(ctx context.Context, ops RDBGetOptions) error
	HfCreate(ctx context.Context, ops RDBCreateOptions) error
	HfUpdate(ctx context.Context, ops RDBUpdateOptions) error
	HfGetCUFields(obj any) (map[string]any, map[string]bool)
	HfOptionalWhere(conds []string) string
	HfDelete(ctx context.Context, ops RDBDeleteOptions) error
}

type RDBContextTransaction

type RDBContextTransaction interface {
	RenewContextTransaction(ctx context.Context) error
	TransactionFn(ctx context.Context, f func(context.Context) error) error
	TransactionAddAsyncCallback(ctx context.Context, f func())
}

type RDBCreateOptions added in v1.1.2

type RDBCreateOptions struct {
	Table  string
	Obj    any
	RetCol string
	RetV   any
}

type RDBDeleteOptions added in v1.1.2

type RDBDeleteOptions struct {
	Table string
	Conds []string
	Args  map[string]any
}

type RDBFull

type RDBFull interface {
	RDBConnectionWithHelpers
	RDBContextTransaction
}

type RDBGetOptions added in v1.1.2

type RDBGetOptions struct {
	Dst      any
	Tables   []string
	Conds    []string
	Args     map[string]any
	ColExprs map[string]string
}

type RDBListOptions added in v1.1.2

type RDBListOptions struct {
	Distinct         bool
	Dst              any
	Tables           []string
	LPars            dopTypes.ListParams
	Conds            []string
	Args             map[string]any
	ColTableAlias    string
	CountCol         string
	ColExprs         map[string]string
	AllowedSorts     map[string]string
	AllowedSortNames map[string]string
}

type RDBMin

type RDBMin interface {
	RDBConnection
	RDBContextTransaction
}

type RDBRow

type RDBRow interface {
	Scan(dest ...any) error
}

type RDBRows

type RDBRows interface {
	Close()
	Err() error
	Next() bool
	Scan(dest ...any) error
}

type RDBUpdateOptions added in v1.1.2

type RDBUpdateOptions struct {
	Table string
	Obj   any
	Conds []string
	Args  map[string]any
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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