sqlhelper

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

SQL Helper

Installation

go get github.com/TPM-Common/Gomon/sqlhelper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetInsert

func SetInsert(ins [][2]any) (cols, nums string, args []any)

func SetWhere

func SetWhere(sql *string, args *[]any, query []any, addWhere bool)

Types

type LimitOffset

type LimitOffset struct {
	Limit  int
	Offset int
}

func (LimitOffset) Set

func (lo LimitOffset) Set(sql *string, args *[]any)

type OrderBy

type OrderBy struct {
	Exprs string
	Sort  string
	Nulls string
}

func (OrderBy) Set

func (ob OrderBy) Set(sql *string, addOrderBy bool)

type OrderBys

type OrderBys []OrderBy

func (OrderBys) Set

func (obs OrderBys) Set(sql *string, addOrderBy bool)

type SearchParams

type SearchParams struct {
	WhereLikes  WhereLikes
	OrderBys    OrderBys
	LimitOffset *LimitOffset

	DefaultOrderBy *OrderBy
	MaxResults     int
}

func (SearchParams) Set

func (s SearchParams) Set(sql *string, args *[]any)

type WhereCondition

type WhereCondition struct {
	Expression string
	Value      interface{}
}

func (WhereCondition) Set

func (wc WhereCondition) Set(sql *string, args *[]any, addWhere bool)

type WhereLike

type WhereLike struct {
	QueryString string
	Column      string
	Inverse     bool
	Insensitive bool
}

func (WhereLike) Set

func (wl WhereLike) Set(sql *string, args *[]any, addWhere bool)

type WhereLikeOperator

type WhereLikeOperator struct {
	WhereLike
	Operator string
}

type WhereLikes

type WhereLikes []WhereLikeOperator

func (WhereLikes) Set

func (wls WhereLikes) Set(sql *string, args *[]any, addWhere bool)

Jump to

Keyboard shortcuts

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