dyna

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT, MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Offset   = "offset"
	Fulltext = "fulltext"
	Order    = "order"
	Limit    = "limit"
)
View Source
const (
	Asc  = "asc"
	Desc = "desc"
)

Variables

View Source
var (
	DefaultLimit = 20
)
View Source
var (
	ErrorSliceValue = errors.New("value must be a slice")
)

Functions

This section is empty.

Types

type Dyna

type Dyna interface {
	DB(db *esquel.DB, query Query) Dyna
	Data(data []map[string]any) Dyna

	GetAllFunc(fn func(param Param, t any) error) Dyna
	GetOneFunc(fn func(name string, v any, t any) error) Dyna
	GetManyFunc(fn func(name string, v any, t any) error) Dyna

	GetAll(param Param, t any) error
	GetOne(name string, v any, t any) error
	GetMany(name string, v any, t any) error

	MustGetAll(param Param, t any)
	MustGetOne(name string, v any, t any)
	MustGetMany(name string, v any, t any)
}

func New

func New() Dyna

type Fields

type Fields struct {
	Fulltext []string
	Order    map[string]string
}

type OrderParam

type OrderParam struct {
	Field     string
	Direction string
}

type Param

type Param struct {
	Fulltext string
	Offset   int
	Limit    int
	Order    []string
	Group    []string
	Fields   Fields
}

func (Param) Parse

func (p Param) Parse(c hiro.Ctx) Param

func (Param) Use

func (p Param) Use(q *esquel.Esquel)

type Query

type Query struct {
	Table  string
	Fields map[string]string
	Value  string
	Alias  string
}

func CreateSelect

func CreateSelect(table, textColumn string, props SelectProps) Query

func (Query) CanUse

func (q Query) CanUse() bool

type SelectProps added in v0.1.1

type SelectProps struct {
	ValueColumn string
}

Jump to

Keyboard shortcuts

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