sql

package
v0.0.0-...-390c17b Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTemplate

func InitTemplate(name, tpl string) (*template.Template, error)

Types

type ParamHandler

type ParamHandler interface {
	proto.Message
	Params() []interface{}
}

type TemplatedQuery

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

func NewTemplatedQuery

func NewTemplatedQuery(
	tpl *template.Template, db *sql.DB, obj ParamHandler,
) *TemplatedQuery

func (*TemplatedQuery) GetCount

func (t *TemplatedQuery) GetCount(ctx context.Context) (count int, err error)

func (*TemplatedQuery) GetPage

func (t *TemplatedQuery) GetPage(
	ctx context.Context, limit, offset int, sortOrder string,
) (rows *sql.Rows, err error)

func (*TemplatedQuery) GetQuery

func (t *TemplatedQuery) GetQuery(
	ctx context.Context, sortOrder string,
) (rows *sql.Rows, err error)

Jump to

Keyboard shortcuts

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