query

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2017 License: MIT Imports: 27 Imported by: 9

Documentation

Index

Constants

View Source
const (
	AUTO_INCREMENT_KEY = "__auto_increment"
)
View Source
const INTERNAL_ID_COLUMN = "@__internal_id"
View Source
const STDIN_VIRTUAL_FILE_PATH = "@__STDIN"

Variables

View Source
var (
	ErrFieldAmbiguous = errors.New("field %s is ambiguous")
	ErrFieldNotExist  = errors.New("field %s does not exist")
	ErrNotGrouped     = errors.New("records are not grouped")
)
View Source
var AggregateFunctions = map[string]func(bool, []parser.Primary) parser.Primary{
	"COUNT": Count,
	"MAX":   Max,
	"MIN":   Min,
	"SUM":   Sum,
	"AVG":   Avg,
}
View Source
var AnalyticFunctions map[string]func(*View, []parser.Expression, parser.AnalyticClause) error
View Source
var Cursors = CursorMap{}
View Source
var Functions = map[string]func([]parser.Primary) (parser.Primary, error){
	"COALESCE":        Coalesce,
	"IF":              If,
	"IFNULL":          Ifnull,
	"NULLIF":          Nullif,
	"CEIL":            Ceil,
	"FLOOR":           Floor,
	"ROUND":           Round,
	"ABS":             Abs,
	"ACOS":            Acos,
	"ASIN":            Asin,
	"ATAN":            Atan,
	"ATAN2":           Atan2,
	"COS":             Cos,
	"SIN":             Sin,
	"TAN":             Tan,
	"EXP":             Exp,
	"EXP2":            Exp2,
	"EXPM1":           Expm1,
	"LOG":             Log,
	"LOG10":           Log10,
	"LOG2":            Log2,
	"LOG1P":           Log1p,
	"SQRT":            Sqrt,
	"POW":             Pow,
	"BIN_TO_DEC":      BinToDec,
	"OCT_TO_DEC":      OctToDec,
	"HEX_TO_DEC":      HexToDec,
	"BIN":             Bin,
	"OCT":             Oct,
	"HEX":             Hex,
	"RAND":            Rand,
	"TRIM":            Trim,
	"LTRIM":           Ltrim,
	"RTRIM":           Rtrim,
	"UPPER":           Upper,
	"LOWER":           Lower,
	"BASE64_ENCODE":   Base64Encode,
	"BASE64_DECODE":   Base64Decode,
	"HEX_ENCODE":      HexEncode,
	"HEX_DECODE":      HexDecode,
	"LEN":             Len,
	"BYTE_LEN":        ByteLen,
	"LPAD":            Lpad,
	"RPAD":            Rpad,
	"SUBSTR":          Substr,
	"REPLACE":         Replace,
	"MD5":             Md5,
	"SHA1":            Sha1,
	"SHA256":          Sha256,
	"SHA512":          Sha512,
	"MD5_HMAC":        Md5Hmac,
	"SHA1_HMAC":       Sha1Hmac,
	"SHA256_HMAC":     Sha256Hmac,
	"SHA512_HMAC":     Sha512Hmac,
	"NOW":             Now,
	"DATETIME_FORMAT": DatetimeFormat,
	"YEAR":            Year,
	"MONTH":           Month,
	"DAY":             Day,
	"HOUR":            Hour,
	"MINUTE":          Minute,
	"SECOND":          Second,
	"MILLISECOND":     Millisecond,
	"MICROSECOND":     Microsecond,
	"NANOSECOND":      Nanosecond,
	"WEEKDAY":         Weekday,
	"UNIX_TIME":       UnixTime,
	"UNIX_NANO_TIME":  UnixNanoTime,
	"DAY_OF_YEAR":     DayOfYear,
	"WEEK_OF_YEAR":    WeekOfYear,
	"ADD_YEAR":        AddYear,
	"ADD_MONTH":       AddMonth,
	"ADD_DAY":         AddDay,
	"ADD_HOUR":        AddHour,
	"ADD_MINUTE":      AddMinute,
	"ADD_SECOND":      AddSecond,
	"ADD_MILLI":       AddMilli,
	"ADD_MICRO":       AddMicro,
	"ADD_NANO":        AddNano,
	"DATE_DIFF":       DateDiff,
	"TIME_DIFF":       TimeDiff,
	"AUTO_INCREMENT":  AutoIncrement,
	"STRING":          String,
	"INTEGER":         Integer,
	"FLOAT":           Float,
	"BOOLEAN":         Boolean,
	"TERNARY":         Ternary,
	"DATETIME":        Datetime,
	"CALL":            Call,
}
View Source
var GlobalVars = Variables{}
View Source
var ResultSet = []Result{}
View Source
var ViewCache = NewViewMap()

Functions

func Abs

func Abs(args []parser.Primary) (parser.Primary, error)

func Acos

func Acos(args []parser.Primary) (parser.Primary, error)

func AddDay

func AddDay(args []parser.Primary) (parser.Primary, error)

func AddHour

func AddHour(args []parser.Primary) (parser.Primary, error)

func AddMicro

func AddMicro(args []parser.Primary) (parser.Primary, error)

func AddMilli

func AddMilli(args []parser.Primary) (parser.Primary, error)

func AddMinute

func AddMinute(args []parser.Primary) (parser.Primary, error)

func AddMonth

func AddMonth(args []parser.Primary) (parser.Primary, error)

func AddNano

func AddNano(args []parser.Primary) (parser.Primary, error)

func AddSecond

func AddSecond(args []parser.Primary) (parser.Primary, error)

func AddYear

func AddYear(args []parser.Primary) (parser.Primary, error)

func All

func All(value []parser.Primary, list [][]parser.Primary, operator string) (ternary.Value, error)

func Any

func Any(value []parser.Primary, list [][]parser.Primary, operator string) (ternary.Value, error)

func Asin

func Asin(args []parser.Primary) (parser.Primary, error)

func Atan

func Atan(args []parser.Primary) (parser.Primary, error)

func Atan2

func Atan2(args []parser.Primary) (parser.Primary, error)

func AutoIncrement

func AutoIncrement(args []parser.Primary) (parser.Primary, error)

func Avg

func Avg(distinct bool, list []parser.Primary) parser.Primary

func Base64Decode

func Base64Decode(args []parser.Primary) (parser.Primary, error)

func Base64Encode

func Base64Encode(args []parser.Primary) (parser.Primary, error)

func Bin

func Bin(args []parser.Primary) (parser.Primary, error)

func BinToDec

func BinToDec(args []parser.Primary) (parser.Primary, error)

func Boolean

func Boolean(args []parser.Primary) (parser.Primary, error)

func ByteLen

func ByteLen(args []parser.Primary) (parser.Primary, error)

func Calculate

func Calculate(p1 parser.Primary, p2 parser.Primary, operator int) parser.Primary

func Call added in v0.1.8

func Call(args []parser.Primary) (parser.Primary, error)

func Ceil

func Ceil(args []parser.Primary) (parser.Primary, error)

func Coalesce

func Coalesce(args []parser.Primary) (parser.Primary, error)

func Commit added in v0.1.6

func Commit() (string, error)

func Compare

func Compare(p1 parser.Primary, p2 parser.Primary, operator string) ternary.Value

func CompareRowValues added in v0.2.2

func CompareRowValues(v1 []parser.Primary, v2 []parser.Primary, operator string) (ternary.Value, error)

func Cos

func Cos(args []parser.Primary) (parser.Primary, error)

func Count

func Count(distinct bool, list []parser.Primary) parser.Primary

func CrossJoin

func CrossJoin(view *View, joinView *View)

func DateDiff

func DateDiff(args []parser.Primary) (parser.Primary, error)

func Datetime

func Datetime(args []parser.Primary) (parser.Primary, error)

func DatetimeFormat

func DatetimeFormat(args []parser.Primary) (parser.Primary, error)

func Day

func Day(args []parser.Primary) (parser.Primary, error)

func DayOfYear

func DayOfYear(args []parser.Primary) (parser.Primary, error)

func DeclareTable added in v0.2.9

func DeclareTable(expr parser.TableDeclaration) error

func DefineAnalyticFunctions added in v0.2.4

func DefineAnalyticFunctions()

func DenseRank added in v0.2.3

func DenseRank(view *View, args []parser.Expression, clause parser.AnalyticClause) error

func EncodeView added in v0.1.6

func EncodeView(view *View, format cmd.Format, delimiter rune, withoutHeader bool, encoding cmd.Encoding, lineBreak cmd.LineBreak) (string, error)

func EqualTo

func EqualTo(p1 parser.Primary, p2 parser.Primary) ternary.Value

func EquivalentTo

func EquivalentTo(p1 parser.Primary, p2 parser.Primary) ternary.Value

func Execute

func Execute(input string) (string, error)

func Exp

func Exp(args []parser.Primary) (parser.Primary, error)

func Exp2

func Exp2(args []parser.Primary) (parser.Primary, error)

func Expm1

func Expm1(args []parser.Primary) (parser.Primary, error)

func FetchCursor added in v0.1.8

func FetchCursor(name string, fetchPosition parser.Expression, vars []parser.Variable) (bool, error)

func Float

func Float(args []parser.Primary) (parser.Primary, error)

func Floor

func Floor(args []parser.Primary) (parser.Primary, error)

func GreaterThan

func GreaterThan(p1 parser.Primary, p2 parser.Primary) ternary.Value

func GreaterThanOrEqualTo

func GreaterThanOrEqualTo(p1 parser.Primary, p2 parser.Primary) ternary.Value

func Hex

func Hex(args []parser.Primary) (parser.Primary, error)

func HexDecode

func HexDecode(args []parser.Primary) (parser.Primary, error)

func HexEncode

func HexEncode(args []parser.Primary) (parser.Primary, error)

func HexToDec

func HexToDec(args []parser.Primary) (parser.Primary, error)

func Hour

func Hour(args []parser.Primary) (parser.Primary, error)

func If

func If(args []parser.Primary) (parser.Primary, error)

func Ifnull

func Ifnull(args []parser.Primary) (parser.Primary, error)

func InIntSlice added in v0.1.6

func InIntSlice(i int, list []int) bool

func InRowValueList added in v0.2.2

func InRowValueList(value []parser.Primary, list [][]parser.Primary, matchType int, operator string) (ternary.Value, error)

func InStrSlice added in v0.1.6

func InStrSlice(s string, list []string) bool

func InnerJoin

func InnerJoin(view *View, joinView *View, condition parser.Expression, parentFilter Filter) error

func Integer

func Integer(args []parser.Primary) (parser.Primary, error)

func Is

func Len

func Len(args []parser.Primary) (parser.Primary, error)

func LessThan

func LessThan(p1 parser.Primary, p2 parser.Primary) ternary.Value

func LessThanOrEqualTo

func LessThanOrEqualTo(p1 parser.Primary, p2 parser.Primary) ternary.Value

func Like

func Log

func Log(args []parser.Primary) (parser.Primary, error)

func Log10

func Log10(args []parser.Primary) (parser.Primary, error)

func Log1p

func Log1p(args []parser.Primary) (parser.Primary, error)

func Log2

func Log2(args []parser.Primary) (parser.Primary, error)

func Lower

func Lower(args []parser.Primary) (parser.Primary, error)

func Lpad

func Lpad(args []parser.Primary) (parser.Primary, error)

func Ltrim

func Ltrim(args []parser.Primary) (parser.Primary, error)

func Max

func Max(distinct bool, list []parser.Primary) parser.Primary

func Md5

func Md5(args []parser.Primary) (parser.Primary, error)

func Md5Hmac

func Md5Hmac(args []parser.Primary) (parser.Primary, error)

func Microsecond

func Microsecond(args []parser.Primary) (parser.Primary, error)

func Millisecond

func Millisecond(args []parser.Primary) (parser.Primary, error)

func Min

func Min(distinct bool, list []parser.Primary) parser.Primary

func Minute

func Minute(args []parser.Primary) (parser.Primary, error)

func Month

func Month(args []parser.Primary) (parser.Primary, error)

func Nanosecond

func Nanosecond(args []parser.Primary) (parser.Primary, error)

func NewTextField added in v0.2.6

func NewTextField(s string, sign int) textField

func NotEqualTo

func NotEqualTo(p1 parser.Primary, p2 parser.Primary) ternary.Value

func Now

func Now(args []parser.Primary) (parser.Primary, error)

func Nullif

func Nullif(args []parser.Primary) (parser.Primary, error)

func Oct

func Oct(args []parser.Primary) (parser.Primary, error)

func OctToDec

func OctToDec(args []parser.Primary) (parser.Primary, error)

func OuterJoin

func OuterJoin(view *View, joinView *View, condition parser.Expression, direction int, parentFilter Filter) error

func ParseJoinCondition

func ParseJoinCondition(join parser.Join, view *View, joinView *View) parser.Expression

func Pow

func Pow(args []parser.Primary) (parser.Primary, error)

func Print added in v0.1.6

func Print(stmt parser.Print) (string, error)

func Rand

func Rand(args []parser.Primary) (parser.Primary, error)

func Rank added in v0.2.3

func Rank(view *View, args []parser.Expression, clause parser.AnalyticClause) error

func Replace

func Replace(args []parser.Primary) (parser.Primary, error)

func Rollback added in v0.1.6

func Rollback() string

func Round

func Round(args []parser.Primary) (parser.Primary, error)

func RowNumber added in v0.2.3

func RowNumber(view *View, args []parser.Expression, clause parser.AnalyticClause) error

func Rpad

func Rpad(args []parser.Primary) (parser.Primary, error)

func Rtrim

func Rtrim(args []parser.Primary) (parser.Primary, error)

func Second

func Second(args []parser.Primary) (parser.Primary, error)

func SetFlag added in v0.1.6

func SetFlag(stmt parser.SetFlag) error

func Sha1

func Sha1(args []parser.Primary) (parser.Primary, error)

func Sha1Hmac

func Sha1Hmac(args []parser.Primary) (parser.Primary, error)

func Sha256

func Sha256(args []parser.Primary) (parser.Primary, error)

func Sha256Hmac

func Sha256Hmac(args []parser.Primary) (parser.Primary, error)

func Sha512

func Sha512(args []parser.Primary) (parser.Primary, error)

func Sha512Hmac

func Sha512Hmac(args []parser.Primary) (parser.Primary, error)

func Sin

func Sin(args []parser.Primary) (parser.Primary, error)

func Sqrt

func Sqrt(args []parser.Primary) (parser.Primary, error)

func String

func String(args []parser.Primary) (parser.Primary, error)

func Substr

func Substr(args []parser.Primary) (parser.Primary, error)

func Sum

func Sum(distinct bool, list []parser.Primary) parser.Primary

func Tan

func Tan(args []parser.Primary) (parser.Primary, error)

func Ternary

func Ternary(args []parser.Primary) (parser.Primary, error)

func TimeDiff

func TimeDiff(args []parser.Primary) (parser.Primary, error)

func Trim

func Trim(args []parser.Primary) (parser.Primary, error)

func UnixNanoTime

func UnixNanoTime(args []parser.Primary) (parser.Primary, error)

func UnixTime

func UnixTime(args []parser.Primary) (parser.Primary, error)

func Upper

func Upper(args []parser.Primary) (parser.Primary, error)

func WeekOfYear

func WeekOfYear(args []parser.Primary) (parser.Primary, error)

func Weekday

func Weekday(args []parser.Primary) (parser.Primary, error)

func Year

func Year(args []parser.Primary) (parser.Primary, error)

Types

type Cell

type Cell []parser.Primary

func NewCell

func NewCell(value parser.Primary) Cell

func NewGroupCell

func NewGroupCell(values []parser.Primary) Cell

func (Cell) GroupedPrimary

func (cell Cell) GroupedPrimary(index int) parser.Primary

func (Cell) Len

func (cell Cell) Len() int

func (Cell) Primary

func (cell Cell) Primary() parser.Primary

type CommonTables added in v0.2.4

type CommonTables map[string]*View

func (CommonTables) Copy added in v0.2.4

func (ct CommonTables) Copy() CommonTables

func (CommonTables) Get added in v0.2.4

func (ct CommonTables) Get(name string) (*View, error)

func (CommonTables) Load added in v0.2.4

func (ct CommonTables) Load(clause parser.CommonTableClause) error

func (CommonTables) Merge added in v0.2.4

func (ct CommonTables) Merge(tables CommonTables) CommonTables

func (CommonTables) Set added in v0.2.4

func (ct CommonTables) Set(commonTable parser.CommonTable) error

type ComparisonResult

type ComparisonResult int
const (
	EQUAL ComparisonResult = iota
	NOT_EQUAL
	LESS
	GREATER
	INCOMMENSURABLE
)

func CompareCombinedly

func CompareCombinedly(p1 parser.Primary, p2 parser.Primary) ComparisonResult

func (ComparisonResult) String

func (cr ComparisonResult) String() string

type Cursor added in v0.1.8

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

func NewCursor added in v0.1.8

func NewCursor(name string, query parser.SelectQuery) *Cursor

func (*Cursor) Close added in v0.1.8

func (c *Cursor) Close()

func (*Cursor) Fetch added in v0.1.8

func (c *Cursor) Fetch(position int, number int) ([]parser.Primary, error)

func (*Cursor) Open added in v0.1.8

func (c *Cursor) Open() error

type CursorMap added in v0.1.8

type CursorMap map[string]*Cursor

func (CursorMap) Add added in v0.1.8

func (m CursorMap) Add(key string, query parser.SelectQuery) error

func (CursorMap) Close added in v0.1.8

func (m CursorMap) Close(key string) error

func (CursorMap) Dispose added in v0.1.8

func (m CursorMap) Dispose(key string)

func (CursorMap) Fetch added in v0.1.8

func (m CursorMap) Fetch(key string, position int, number int) ([]parser.Primary, error)

func (CursorMap) IsInRange added in v0.2.5

func (m CursorMap) IsInRange(key string) (ternary.Value, error)

func (CursorMap) IsOpen added in v0.2.5

func (m CursorMap) IsOpen(key string) (ternary.Value, error)

func (CursorMap) Open added in v0.1.8

func (m CursorMap) Open(key string) error

type FileInfo

type FileInfo struct {
	Path      string
	Delimiter rune
	NoHeader  bool
	Encoding  cmd.Encoding
	LineBreak cmd.LineBreak
	Temporary bool
}

func NewFileInfo

func NewFileInfo(filename string, repository string, delimiter rune) (*FileInfo, error)

type Filter

type Filter struct {
	Records      []FilterRecord
	CommonTables CommonTables

	RecursiveTable   parser.CommonTable
	RecursiveTmpView *View
	// contains filtered or unexported fields
}

func NewFilterForLoop added in v0.2.4

func NewFilterForLoop(view *View, parentFilter Filter) Filter

func NewFilterForRecord added in v0.2.4

func NewFilterForRecord(view *View, recordIndex int, parentFilter Filter) Filter

func (Filter) Copy added in v0.2.4

func (f Filter) Copy() Filter

func (Filter) Evaluate

func (f Filter) Evaluate(expr parser.Expression) (parser.Primary, error)

func (Filter) Merge added in v0.2.4

func (f Filter) Merge(filter Filter) Filter

func (Filter) RecordCount added in v0.2.4

func (f Filter) RecordCount() int

type FilterRecord

type FilterRecord struct {
	View        *View
	RecordIndex int
}
type Header []HeaderField

func AddHeaderField

func AddHeaderField(h Header, column string, alias string) (header Header, index int)

func MergeHeader

func MergeHeader(h1 Header, h2 Header) Header

func NewDualHeader

func NewDualHeader() Header

func NewEmptyHeader

func NewEmptyHeader(len int) Header

func NewHeader

func NewHeader(ref string, words []string) Header

func NewHeaderWithoutId added in v0.1.6

func NewHeaderWithoutId(ref string, words []string) Header

func (Header) Contains

func (h Header) Contains(fieldRef parser.FieldReference) (int, error)

func (Header) ContainsObject added in v0.2.3

func (h Header) ContainsObject(obj parser.Expression) (int, error)

func (Header) Copy added in v0.1.6

func (h Header) Copy() Header

func (Header) Len

func (h Header) Len() int

func (Header) TableColumnNames added in v0.1.6

func (h Header) TableColumnNames() []string

func (Header) TableColumns

func (h Header) TableColumns() []parser.Expression

type HeaderField

type HeaderField struct {
	Reference  string
	Column     string
	Alias      string
	FromTable  bool
	IsGroupKey bool
}

func (HeaderField) Label

func (hf HeaderField) Label() string

type IdentificationError

type IdentificationError struct {
	Field parser.FieldReference
	Err   error
}

func (IdentificationError) Error

func (e IdentificationError) Error() string

type NotGroupedError

type NotGroupedError struct {
	Function string
	Err      error
}

func (NotGroupedError) Error

func (e NotGroupedError) Error() string

type Record

type Record []Cell

func NewEmptyRecord

func NewEmptyRecord(len int) Record

func NewRecord

func NewRecord(internalId int, values []parser.Primary) Record

func NewRecordWithoutId added in v0.1.6

func NewRecordWithoutId(values []parser.Primary) Record

func (Record) Copy added in v0.1.6

func (r Record) Copy() Record

func (Record) GroupLen

func (r Record) GroupLen() int

func (Record) IsEqualTo added in v0.2.1

func (r Record) IsEqualTo(record Record) bool

func (Record) Match added in v0.2.3

func (r Record) Match(record Record, indices []int) bool

type Records added in v0.2.1

type Records []Record

func (Records) Contains added in v0.2.1

func (r Records) Contains(record Record) bool

type Result

type Result struct {
	Type          StatementType
	View          *View
	FileInfo      *FileInfo
	OperatedCount int
	Log           string
}

type StatementFlow added in v0.1.8

type StatementFlow int
const (
	TERMINATE StatementFlow = iota
	ERROR
	EXIT
	BREAK
	CONTINUE
)

func ExecuteProgram added in v0.1.8

func ExecuteProgram(program []parser.Statement) (StatementFlow, string, error)

func ExecuteStatement added in v0.1.6

func ExecuteStatement(stmt parser.Statement) (StatementFlow, string, error)

func IfStmt added in v0.1.8

func IfStmt(stmt parser.If) (StatementFlow, string, error)

func While added in v0.1.8

func While(stmt parser.While) (StatementFlow, string, error)

func WhileInCursor added in v0.1.8

func WhileInCursor(stmt parser.WhileInCursor) (StatementFlow, string, error)

type StatementType added in v0.1.6

type StatementType int
const (
	SELECT StatementType = iota
	INSERT
	UPDATE
	DELETE
	CREATE_TABLE
	ADD_COLUMNS
	DROP_COLUMNS
	RENAME_COLUMN
	PRINT
)

type Variables

type Variables map[string]parser.Primary

func (Variables) Add

func (v Variables) Add(key string, value parser.Primary) error

func (Variables) ClearAutoIncrement

func (v Variables) ClearAutoIncrement()

func (Variables) Decrare

func (v Variables) Decrare(declaration parser.VariableDeclaration, filter Filter) error

func (Variables) Delete

func (v Variables) Delete(key string)

func (Variables) Get

func (v Variables) Get(key string) (parser.Primary, error)

func (Variables) Increment

func (v Variables) Increment(key string, initialVal int64) parser.Primary

func (Variables) Set

func (v Variables) Set(key string, value parser.Primary) error

func (Variables) Substitute

func (v Variables) Substitute(substitution parser.VariableSubstitution, filter Filter) (parser.Primary, error)

type View

type View struct {
	Header  Header
	Records Records

	FileInfo *FileInfo

	ParentFilter Filter

	OperatedRecords int
	OperatedFields  int

	UseInternalId bool
	// contains filtered or unexported fields
}

func AddColumns added in v0.1.6

func AddColumns(query parser.AddColumns) (*View, error)

func CreateTable added in v0.1.6

func CreateTable(query parser.CreateTable) (*View, error)

func Delete added in v0.1.6

func Delete(query parser.DeleteQuery) ([]*View, error)

func DropColumns added in v0.1.6

func DropColumns(query parser.DropColumns) (*View, error)

func Insert added in v0.1.6

func Insert(query parser.InsertQuery) (*View, error)

func NewView

func NewView() *View

func NewViewFromGroupedRecord

func NewViewFromGroupedRecord(filterRecord FilterRecord) *View

func RenameColumn added in v0.1.6

func RenameColumn(query parser.RenameColumn) (*View, error)

func Select added in v0.1.6

func Select(query parser.SelectQuery) (*View, error)

func SelectAsSubquery added in v0.2.4

func SelectAsSubquery(query parser.SelectQuery, parentFilter Filter) (*View, error)

func Update added in v0.1.6

func Update(query parser.UpdateQuery) ([]*View, error)

func (*View) Copy added in v0.1.6

func (view *View) Copy() *View

func (*View) Distinct added in v0.2.1

func (view *View) Distinct()

func (*View) Except added in v0.2.1

func (view *View) Except(calcView *View, all bool)

func (*View) Extract

func (view *View) Extract()

func (*View) FieldIndex added in v0.1.6

func (view *View) FieldIndex(fieldRef parser.FieldReference) (int, error)

func (*View) FieldIndices added in v0.1.6

func (view *View) FieldIndices(fields []parser.Expression) ([]int, error)

func (*View) FieldLen

func (view *View) FieldLen() int

func (*View) FieldViewName added in v0.1.8

func (view *View) FieldViewName(fieldRef parser.FieldReference) (string, error)

func (*View) Fix

func (view *View) Fix()

func (*View) GroupBy

func (view *View) GroupBy(clause parser.GroupByClause) error

func (*View) Having

func (view *View) Having(clause parser.HavingClause) error

func (*View) InsertFromQuery added in v0.1.6

func (view *View) InsertFromQuery(fields []parser.Expression, query parser.SelectQuery, filter Filter) error

func (*View) InsertValues added in v0.1.6

func (view *View) InsertValues(fields []parser.Expression, list []parser.Expression, filter Filter) error

func (*View) InternalRecordId added in v0.1.6

func (view *View) InternalRecordId(ref string, recordIndex int) (int, error)

func (*View) Intersect added in v0.2.1

func (view *View) Intersect(calcView *View, all bool)

func (*View) Len

func (view *View) Len() int

func (*View) Less

func (view *View) Less(i, j int) bool

func (*View) Limit

func (view *View) Limit(clause parser.LimitClause) error

func (*View) Load added in v0.1.6

func (view *View) Load(clause parser.FromClause, parentFilter Filter) error

func (*View) LoadFromIdentifier added in v0.1.6

func (view *View) LoadFromIdentifier(table parser.Identifier) error

func (*View) LoadFromIdentifierWithCommonTables added in v0.2.4

func (view *View) LoadFromIdentifierWithCommonTables(table parser.Identifier, parentFilter Filter) error

func (*View) Offset added in v0.2.2

func (view *View) Offset(clause parser.OffsetClause) error

func (*View) OrderBy

func (view *View) OrderBy(clause parser.OrderByClause) error

func (*View) RecordLen

func (view *View) RecordLen() int

func (*View) Select

func (view *View) Select(clause parser.SelectClause) error

func (*View) SelectAllColumns added in v0.1.6

func (view *View) SelectAllColumns() error

func (*View) Swap

func (view *View) Swap(i, j int)

func (*View) Union added in v0.2.1

func (view *View) Union(calcView *View, all bool)

func (*View) UpdateHeader added in v0.2.4

func (view *View) UpdateHeader(reference string, fields []parser.Expression) error

func (*View) Where

func (view *View) Where(clause parser.WhereClause) error

type ViewMap added in v0.1.6

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

func NewViewMap added in v0.1.6

func NewViewMap() *ViewMap

func (*ViewMap) Clear added in v0.1.6

func (m *ViewMap) Clear()

func (*ViewMap) ClearAliases added in v0.1.6

func (m *ViewMap) ClearAliases()

func (*ViewMap) Exists added in v0.1.6

func (m *ViewMap) Exists(fpath string) (string, bool)

func (*ViewMap) Get added in v0.1.6

func (m *ViewMap) Get(fpath string) (*View, error)

func (*ViewMap) GetWithInternalId added in v0.1.6

func (m *ViewMap) GetWithInternalId(fpath string) (*View, error)

func (*ViewMap) HasAlias added in v0.1.6

func (m *ViewMap) HasAlias(alias string) (string, bool)

func (*ViewMap) HasTemporaryTable added in v0.2.9

func (m *ViewMap) HasTemporaryTable(name string) bool

func (*ViewMap) Replace added in v0.2.0

func (m *ViewMap) Replace(view *View) error

func (*ViewMap) Set added in v0.1.6

func (m *ViewMap) Set(view *View, alias string) error

func (*ViewMap) SetAlias added in v0.1.6

func (m *ViewMap) SetAlias(alias string, fpath string) error

Jump to

Keyboard shortcuts

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