types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// InnerJoin has a "INNER JOIN" type.
	InnerJoin = JoinType("INNER JOIN")
	// LeftJoin has a "LEFT JOIN" type.
	LeftJoin = JoinType("LEFT JOIN")
	// RightJoin has a "RIGHT JOIN" type.
	RightJoin = JoinType("RIGHT JOIN")
)

Join types.

View Source
const (
	And = LogicalOperator("AND")
	Or  = LogicalOperator("OR")
	Not = LogicalOperator("NOT")
)

Logical operators.

View Source
const (
	Equal              = ComparisonOperator("=")
	NotEqual           = ComparisonOperator("!=")
	Is                 = ComparisonOperator("IS")
	IsNot              = ComparisonOperator("IS NOT")
	GreaterThan        = ComparisonOperator(">")
	GreaterThanOrEqual = ComparisonOperator(">=")
	LessThan           = ComparisonOperator("<")
	LessThanOrEqual    = ComparisonOperator("<=")
	In                 = ComparisonOperator("IN")
	NotIn              = ComparisonOperator("NOT IN")
	Like               = ComparisonOperator("LIKE")
	NotLike            = ComparisonOperator("NOT LIKE")
	ILike              = ComparisonOperator("ILIKE")
	NotILike           = ComparisonOperator("NOT ILIKE")
	Between            = ComparisonOperator("BETWEEN")
	NotBetween         = ComparisonOperator("NOT BETWEEN")
)

Comparison operators.

View Source
const (
	// Asc indicates forward order.
	Asc = OrderType("ASC")
	// Desc indicates reverse order.
	Desc = OrderType("DESC")
)

Order types.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComparisonOperator

type ComparisonOperator string

ComparisonOperator represents a comparison operator.

func (ComparisonOperator) String

func (e ComparisonOperator) String() string

type Context

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

A Context is passed to a root stmt.Statement to generate a query.

func NewContext

func NewContext() *Context

NewContext creates a new Context instance.

func (*Context) Bind

func (ctx *Context) Bind(value interface{})

Bind adds given value in context's values.

func (*Context) Query

func (ctx *Context) Query() string

Query returns the underlaying query.

func (*Context) Values

func (ctx *Context) Values() map[string]interface{}

Values returns the underlaying values of the query.

func (*Context) Write

func (ctx *Context) Write(query string)

Write appends given subquery in context's buffer.

type JoinType

type JoinType string

JoinType represents a join type.

func (JoinType) String

func (e JoinType) String() string

type LogicalOperator

type LogicalOperator string

LogicalOperator represents a logical operator.

func (LogicalOperator) String

func (e LogicalOperator) String() string

type Map

type Map map[interface{}]interface{}

Map is a key/value map.

type OrderType

type OrderType string

OrderType represents an order type.

func (OrderType) String

func (e OrderType) String() string

type Pair

type Pair struct {
	Key   interface{}
	Value interface{}
}

Pair is a key/value pair.

Jump to

Keyboard shortcuts

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