query

package
v0.10.14 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const KeyWhere = "{{.where}}"

Variables

This section is empty.

Functions

func Query added in v0.10.14

func Query[T any](db *gorm.DB, r *RawQuery, data map[string]any) ([]T, error)

Types

type RawQuery

type RawQuery struct {
	Sql     string
	Preset  map[string]any
	Params  []string
	Where   map[string]string // key: where condition, value: param key, e.g. "id = ?", "id"
	Orderby string
	Groupby string
	Limit   int
	Offset  int
}

func (*RawQuery) Query

func (r *RawQuery) Query(db *gorm.DB, data map[string]any) ([]map[string]any, error)

type RawQuerySerice

type RawQuerySerice struct {
	Source      string
	EnabledAuth bool
	Base        string
	Items       []SerivceItem
	// contains filtered or unexported fields
}

type RawQueryWhere added in v0.10.14

type RawQueryWhere struct {
	Cond  string
	Param string
	Empty string // optional settings, where condition for params is empty
}

it's not enabled yet.

type SerivceItem

type SerivceItem struct {
	Uri     string
	Query   RawQuery
	Details *RawQuery
}

Jump to

Keyboard shortcuts

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