db

package
v1.0.0-beta.23 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MergeDuplicates  = "merge-duplicates"
	IgnoreDuplicates = "ignore-duplicates"
)

Variables

This section is empty.

Functions

func GetColumnList

func GetColumnList(m interface{}) []string

func GetTable

func GetTable(m interface{}) string

func PostgrestRequestBind

func PostgrestRequestBind(ctx raiden.Context, method string, url string, payload []byte, headers map[string]string, bypass bool, result interface{}) (*fasthttp.Response, error)

func SliceToStringSlice

func SliceToStringSlice(slice interface{}) []string

Types

type CountOptions

type CountOptions struct {
	Count string
}

type ModelBase

type ModelBase struct {
	raiden.ModelBase
}

func (*ModelBase) Execute

func (m *ModelBase) Execute() (model *ModelBase)

type Query

type Query struct {
	Context raiden.Context

	Columns      []string
	Relations    []string
	WhereAndList *[]string
	WhereOrList  *[]string
	OrderList    *[]string
	LimitValue   int
	OffsetValue  int
	Errors       []error
	ByPass       bool
	// contains filtered or unexported fields
}

func NewQuery

func NewQuery(ctx raiden.Context) *Query

func (*Query) AsSystem

func (q *Query) AsSystem() *Query

func (*Query) Avg

func (q *Query) Avg(column string, alias string) *Query

func (*Query) Count

func (q *Query) Count(opts ...CountOptions) (int, error)

func (*Query) Delete

func (q *Query) Delete() error

func (*Query) Eq

func (q *Query) Eq(column string, value any) *Query

func (*Query) From

func (q *Query) From(m interface{}) *Query

func (Query) Get

func (q Query) Get(collection interface{}) error

func (Query) GetUrl

func (q Query) GetUrl() string

func (*Query) Gt

func (q *Query) Gt(column string, value int) *Query

func (*Query) Gte

func (q *Query) Gte(column string, value any) *Query

func (*Query) HasError

func (q *Query) HasError() bool

func (*Query) Ilike

func (q *Query) Ilike(column string, value string) *Query

func (*Query) In

func (q *Query) In(column string, value any) *Query

func (*Query) Insert

func (q *Query) Insert(payload interface{}, model interface{}) error

func (*Query) Like

func (q *Query) Like(column string, value string) *Query

func (*Query) Limit

func (q *Query) Limit(value int) *Query

func (*Query) Lt

func (q *Query) Lt(column string, value any) *Query

func (*Query) Lte

func (q *Query) Lte(column string, value any) *Query

func (*Query) Max

func (q *Query) Max(column string, alias string) *Query

func (*Query) Min

func (q *Query) Min(column string, alias string) *Query

func (*Query) Model

func (q *Query) Model(m interface{}) *Query

Model is the From alias

func (*Query) Neq

func (q *Query) Neq(column string, value any) *Query

func (*Query) Offset

func (q *Query) Offset(value int) *Query

func (*Query) OrEq

func (q *Query) OrEq(column string, value any) *Query

func (*Query) OrGt

func (q *Query) OrGt(column string, value int) *Query

func (*Query) OrGte

func (q *Query) OrGte(column string, value any) *Query

func (*Query) OrIlike

func (q *Query) OrIlike(column string, value string) *Query

func (*Query) OrIn

func (q *Query) OrIn(column string, value any) *Query

func (*Query) OrLike

func (q *Query) OrLike(column string, value string) *Query

func (*Query) OrLt

func (q *Query) OrLt(column string, value any) *Query

func (*Query) OrLte

func (q *Query) OrLte(column string, value any) *Query

func (*Query) OrNeq

func (q *Query) OrNeq(column string, value any) *Query

func (*Query) OrderAsc

func (q *Query) OrderAsc(column string) *Query

func (*Query) OrderDesc

func (q *Query) OrderDesc(column string) *Query

func (Query) Select

func (q Query) Select(columns []string) (model *Query)

func (Query) Single

func (q Query) Single(model interface{}) error

func (*Query) Sum

func (q *Query) Sum(column string, alias string) *Query

func (*Query) Update

func (q *Query) Update(p interface{}, model interface{}) error

func (*Query) Upsert

func (q *Query) Upsert(payload []interface{}, opt UpsertOptions) error

func (*Query) With

func (q *Query) With(r string, columns map[string][]string) *Query

type UpsertOptions

type UpsertOptions = struct {
	OnConflict string
}

Jump to

Keyboard shortcuts

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