qutil

package
v0.0.0-...-8b6df7a Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2015 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Year = IntervalUnit(iota)
	Month
	Day
	Hour
	Minute
	Second
)

Variables

View Source
var (
	// MySQL implements a dialect in MySQL.
	MySQL = Dialect(mySQL{})
	// PostgreSQL implements a dialect in PostgreSQL.
	PostgreSQL = Dialect(postgreSQL{})
	// SQLite implements a dialect in SQLite.
	SQLite = Dialect(sqlite{})
)

Functions

This section is empty.

Types

type Context

type Context struct {
	Starter     interface{}
	CUD         bool // Whether current context is Create or Update or Delete.
	Dialect     Dialect
	Placeholder Placeholder
	Args        []interface{}
	ArgsMap     map[interface{}]int
}

func NewContext

func NewContext(starter interface{}, bufCap int, argsCap int, d Dialect) ([]byte, *Context)

type Dialect

type Dialect interface {
	Placeholder() Placeholder
	Quote(buf []byte, word string) []byte
	CanUseReturning() bool
	CanUseInnerJoinWithoutCondition() bool
	CanUseLeftJoinWithoutCondition() bool
	CharLengthName() string
	AddInterval(ctx *Context, buf []byte, l interface{}, intervals ...Interval) []byte
}

type Interval

type Interval interface {
	Value() int
	Unit() IntervalUnit
}

type IntervalUnit

type IntervalUnit int

type Placeholder

type Placeholder interface {
	Next(buf []byte) []byte
}

Jump to

Keyboard shortcuts

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