sqlbuilder

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DELETE = "DELETE"
View Source
const INNER_JOIN = "INNER JOIN"
View Source
const INSERT = "INSERT"
View Source
const INSERT_OR_UPDATE = "INSERT_OR_UPDATE"
View Source
const JOIN = "JOIN"
View Source
const LEFT_JOIN = "LEFT JOIN"
View Source
const RIGHT_JOIN = "RIGHT JOIN"
View Source
const SELECT = "SELECT"
View Source
const SELECT_DISTINCT = "SELECT DISTINCT"
View Source
const UPDATE = "UPDATE"

Variables

This section is empty.

Functions

func Custom

func Custom(query string, args ...Value) string

func EscapeID

func EscapeID(id string) string

func GetDefaultLocation

func GetDefaultLocation() *time.Location

func InterpolateParams

func InterpolateParams(query string, args []Value, loc *time.Location) (string, error)

func SetDefaultLocation

func SetDefaultLocation(loc *time.Location)

Types

type QueryBuilder

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

func Table

func Table(tableName string) *QueryBuilder

func (*QueryBuilder) And

func (q *QueryBuilder) And(query string, args ...Value) *QueryBuilder

func (*QueryBuilder) AndRow

func (q *QueryBuilder) AndRow(row Row) *QueryBuilder

func (*QueryBuilder) As

func (q *QueryBuilder) As(name string) *QueryBuilder

func (*QueryBuilder) Build

func (q *QueryBuilder) Build() string

func (*QueryBuilder) Clone

func (q *QueryBuilder) Clone() *QueryBuilder

func (*QueryBuilder) Count

func (q *QueryBuilder) Count(field string) *QueryBuilder

func (*QueryBuilder) Delete

func (q *QueryBuilder) Delete() *QueryBuilder

func (*QueryBuilder) Fields

func (q *QueryBuilder) Fields(fields ...string) *QueryBuilder

func (*QueryBuilder) Format

func (q *QueryBuilder) Format(query string, args ...Value) string

func (*QueryBuilder) GroupBy

func (q *QueryBuilder) GroupBy(tpl string, args ...Value) *QueryBuilder

func (*QueryBuilder) Having

func (q *QueryBuilder) Having(tpl string, args ...Value) *QueryBuilder

func (*QueryBuilder) InnerJoin

func (q *QueryBuilder) InnerJoin(tableName string, fields ...string) *QueryBuilder

func (*QueryBuilder) Insert

func (q *QueryBuilder) Insert(row Row) *QueryBuilder

func (*QueryBuilder) InsertMany

func (q *QueryBuilder) InsertMany(rows []Row) *QueryBuilder

func (*QueryBuilder) Join

func (q *QueryBuilder) Join(tableName string, fields ...string) *QueryBuilder

func (*QueryBuilder) LeftJoin

func (q *QueryBuilder) LeftJoin(tableName string, fields ...string) *QueryBuilder

func (*QueryBuilder) Limit

func (q *QueryBuilder) Limit(n int) *QueryBuilder

func (*QueryBuilder) Location

func (q *QueryBuilder) Location(loc *time.Location) *QueryBuilder

func (*QueryBuilder) On

func (q *QueryBuilder) On(condition string, args ...Value) *QueryBuilder

func (*QueryBuilder) OnDuplicateKeyUpdate

func (q *QueryBuilder) OnDuplicateKeyUpdate() *QueryBuilder

func (*QueryBuilder) OrderBy

func (q *QueryBuilder) OrderBy(tpl string, args ...Value) *QueryBuilder

func (*QueryBuilder) RightJoin

func (q *QueryBuilder) RightJoin(tableName string, fields ...string) *QueryBuilder

func (*QueryBuilder) Select

func (q *QueryBuilder) Select(fields ...string) *QueryBuilder

func (*QueryBuilder) SelectDistinct

func (q *QueryBuilder) SelectDistinct(fields ...string) *QueryBuilder

func (*QueryBuilder) Set

func (q *QueryBuilder) Set(update string, args ...Value) *QueryBuilder

func (*QueryBuilder) SetRow

func (q *QueryBuilder) SetRow(row Row) *QueryBuilder

func (*QueryBuilder) Skip

func (q *QueryBuilder) Skip(n int) *QueryBuilder

func (*QueryBuilder) Table

func (q *QueryBuilder) Table(tableName string) *QueryBuilder

func (*QueryBuilder) Update

func (q *QueryBuilder) Update() *QueryBuilder

func (*QueryBuilder) Where

func (q *QueryBuilder) Where(query string, args ...Value) *QueryBuilder

func (*QueryBuilder) WhereRow

func (q *QueryBuilder) WhereRow(row Row) *QueryBuilder

type Row

type Row = map[string]interface{}

type Value

type Value = driver.Value

Jump to

Keyboard shortcuts

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