dyna

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT, MIT Imports: 10 Imported by: 1 module, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

	FindFunc(fn func(param Param, t any) error) Dyna
	FindOneFunc(fn func(name string, v any, t any) error) Dyna
	FindManyFunc(fn func(name string, v any, t any) error) Dyna

	Find(param Param, t any) error
	FindOne(name string, v any, t any) error
	FindMany(name string, v any, t any) error

	MustFind(param Param, t any)
	MustFindOne(name string, v any, t any)
	MustFindMany(name string, v any, t any)
}

func New

func New() Dyna

type Fields

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

type Param

type Param struct {
	Fulltext  string
	Offset    int
	Limit     int
	Order     []string
	Group     []string
	Filter    []string
	FilterMap hiro.Map
	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