builder

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBTag

func DBTag(f reflect.StructField) []string

func FieldName

func FieldName(f reflect.StructField) string

func GetTable

func GetTable(m any) string

func GetTableSingular

func GetTableSingular(m any) string

func GetValue

func GetValue(v any, key string) (any, bool)

func PrimaryKey

func PrimaryKey(m any) []string

Types

type Group

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

func (*Group) ToSQL

func (g *Group) ToSQL(d dialects.Dialect) (string, []any, error)

type Identifier

type Identifier string

func (Identifier) ToSQL

func (i Identifier) ToSQL(d dialects.Dialect) (string, []any, error)

type Literal

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

func (Literal) ToSQL

func (l Literal) ToSQL(d dialects.Dialect) (string, []any, error)

type PrimaryKeyer

type PrimaryKeyer interface {
	PrimaryKey() []string
}

type Raw

type Raw string

func (Raw) ToSQL

func (r Raw) ToSQL(d dialects.Dialect) (string, []any, error)

type SQLResult

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

func Result

func Result() *SQLResult

func (*SQLResult) Add

func (r *SQLResult) Add(sql string, bindings []any, err error) *SQLResult

func (*SQLResult) AddString

func (r *SQLResult) AddString(sql string) *SQLResult

func (*SQLResult) ToSQL

func (r *SQLResult) ToSQL(d dialects.Dialect) (string, []any, error)

type Tabler

type Tabler interface {
	Table() string
}

type ToSQLer

type ToSQLer interface {
	ToSQL(d dialects.Dialect) (string, []any, error)
}

func IdentifierList

func IdentifierList(strs []string) []ToSQLer

func Join

func Join(sqlers []ToSQLer, sep string) ToSQLer

func LiteralList

func LiteralList(values []any) []ToSQLer

func NewGroup

func NewGroup(sqler ToSQLer) ToSQLer

func NewLiteral

func NewLiteral(v any) ToSQLer

Jump to

Keyboard shortcuts

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