tk

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeywordSelect   = "SELECT"
	KeywordUpdate   = "UPDATE"
	KeywordSet      = "SET"
	KeywordInsert   = "INSERT"
	KeywordDELETE   = "DELETE"
	KeywordDISTINCE = "DISTINCT"
	KeywordFrom     = "FROM"
	KeywordWhere    = "WHERE"
	KeywordOrderBy  = "ORDER BY"
)
View Source
const (
	KeywordIsNull     = "IS NULL"
	KeywordIsNotNull  = "IS NOT NULL"
	KeywordIn         = "IN"
	KeywordNotIn      = "NOT IN"
	KeywordLike       = "LIKE"
	KeywordNotLike    = "NOT LIKE"
	KeywordBetween    = "BETWEEN"
	KeywordNotBetween = "NOT BETWEEN"
	KeywordAnd        = "AND"
	KeywordOr         = "OR"
)
View Source
const (
	KeywordEqual      = "="
	KeywordNotEqual   = "<>"
	KeywordGreater    = ">"
	KeywordNotGreater = "<="
	KeywordLess       = "<"
	KeywordNotLess    = ">="
)
View Source
const (
	Placeholder        = "?"
	PlaceholderString  = "?"
	PlaceholderNumeric = "?"
)

Variables

This section is empty.

Functions

func NewExample

func NewExample() *example

Types

type Criteria

type Criteria interface {
	AndIsNull(field string) Criteria
	AndIsNotNull(field string) Criteria
	AndEqualTo(field string, value interface{}) Criteria
	AndNotEqualTo(field string, value interface{}) Criteria
	AndGreaterThan(field string, value interface{}) Criteria
	AndNotGreaterThan(field string, value interface{}) Criteria
	AndLessThan(field string, value interface{}) Criteria
	AndNotLessThan(field string, value interface{}) Criteria
	AndIn(field string, list ...interface{}) Criteria
	AndNotIn(field string, list ...interface{}) Criteria
	AndLike(field string, value interface{}) Criteria
	AndNotLike(field string, value interface{}) Criteria
	AndBetween(field string, value1, value2 interface{}) Criteria
	AndNotBetween(field string, value1, value2 interface{}) Criteria

	OrIsNull(field string) Criteria
	OrIsNotNull(field string) Criteria
	OrEqualTo(field string, value interface{}) Criteria
	OrNotEqualTo(field string, value interface{}) Criteria
	OrGreaterThan(field string, value interface{}) Criteria
	OrNotGreaterThan(field string, value interface{}) Criteria
	OrLessThan(field string, value interface{}) Criteria
	OrNotLessThan(field string, value interface{}) Criteria
	OrIn(field string, list ...interface{}) Criteria
	OrNotIn(field string, list ...interface{}) Criteria
	OrLike(field string, value interface{}) Criteria
	OrNotLike(field string, value interface{}) Criteria
	OrBetween(field string, value1, value2 interface{}) Criteria
	OrNotBetween(field string, value1, value2 interface{}) Criteria
	// contains filtered or unexported methods
}

type Example

type Example interface {
	CreateCriteria() Criteria
	Or(criteria Criteria) Example
	And(criteria Criteria) Example
	OrderBy(order string) Example
	Distinct(d bool) Example

	String() string
	// contains filtered or unexported methods
}

type ISelectMapper

type ISelectMapper interface {
	SelectByExample(example Example, value interface{})
}

type SelectMapper

type SelectMapper struct {
	types.Repository
	// contains filtered or unexported fields
}

func NewSelectMapper

func NewSelectMapper(table string, db *gorm.DB) *SelectMapper

func (*SelectMapper) SelectByExample

func (s *SelectMapper) SelectByExample(example Example, value interface{}) error

type UpdateMapper

type UpdateMapper struct {
	// contains filtered or unexported fields
}

func NewUpdateMapper

func NewUpdateMapper(table string) *UpdateMapper

func (*UpdateMapper) UpdateByExample

func (s *UpdateMapper) UpdateByExample(example Example, value interface{}) error

Jump to

Keyboard shortcuts

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