utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AccountAddressPrefix = "glitter"

Variables

This section is empty.

Functions

func BuildBatchInsertStatement

func BuildBatchInsertStatement(table string, columns []string, rowValues [][]interface{}) (string, []*glittertypes.Argument, error)

func BuildDeleteStatement

func BuildDeleteStatement(table string, whereEqual map[string]interface{}, orderBy string, asc bool, limit int) (string, []*glittertypes.Argument, error)

BuildDeleteStatement where connected by and

func BuildInsertStatement

func BuildInsertStatement(table string, columnToValues map[string]interface{}) (string, []*glittertypes.Argument, error)

func BuildUpdateStatement

func BuildUpdateStatement(table string, columns map[string]interface{}, whereEqual map[string]interface{}) (string, []*glittertypes.Argument, error)

BuildUpdateStatement where connected by and

func DateRangeQuery

func DateRangeQuery(field, operator, value string, boost float64) string

func FullTableName

func FullTableName(db, table string) string

func GetEvmAddrFromGlitterAddr

func GetEvmAddrFromGlitterAddr(glitterAddr string) (string, error)

func GetGlitterAddrFromEvmAddr

func GetGlitterAddrFromEvmAddr(evmAddr string) (string, error)

func HighlightHint

func HighlightHint(fields []string) string

func MatchPhraseQuery

func MatchPhraseQuery(field, query string, boost float64) string

func MatchQuery

func MatchQuery(field, query string, boost float64) string

func NumericRangeQuery

func NumericRangeQuery(field, operator string, value int, boost float64) string

func RegexpQuery

func RegexpQuery(field, query string, boost float64) string

func SetBip44CoinType

func SetBip44CoinType(config *sdk.Config)

Types

type QueryString

type QueryString struct {
	Querys    []string
	DB        string
	Table     string
	Fields    string
	Highlight string
	Limit     int64
	Offset    int64
}

func NewCandyQueryString

func NewCandyQueryString(db, table, fields string, limit, offset int64) *QueryString

func NewQueryString

func NewQueryString() *QueryString

func (*QueryString) Add

func (q *QueryString) Add(query string)

func (*QueryString) AddDateRangeQuery

func (q *QueryString) AddDateRangeQuery(field, operator, value string, boost float64)

func (*QueryString) AddHighLight

func (q *QueryString) AddHighLight(fields []string) error

func (*QueryString) AddMatchPhraseQuery

func (q *QueryString) AddMatchPhraseQuery(field, query string, boost float64)

func (*QueryString) AddMatchQuery

func (q *QueryString) AddMatchQuery(field, query string, boost float64)

func (*QueryString) AddNumericRangeQuery

func (q *QueryString) AddNumericRangeQuery(field, operator string, value int, boost float64)

func (*QueryString) AddRegexpQuery

func (q *QueryString) AddRegexpQuery(field, query string, boost float64)

func (*QueryString) Build

func (q *QueryString) Build() (string, []*glittertypes.Argument, error)

func (*QueryString) GetQueryString

func (q *QueryString) GetQueryString() string

func (*QueryString) Row

func (q *QueryString) Row(sql string, args ...interface{}) (string, []*glittertypes.Argument, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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