pyooq

package module
v0.0.0-...-dba5aa2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: BSD-2-Clause Imports: 8 Imported by: 0

README

pyooq

Go fluent DSL for generating SQL queries

Documentation

Index

Constants

View Source
const InvalidComparison = ^Comparison(0)
View Source
const InvalidIndexType = ^IndexType(0)
View Source
const InvalidJoin = ^Join(0)
View Source
const InvalidKind = ^Kind(0)
View Source
const InvalidOperator = ^Operator(0)
View Source
const InvalidType = ^Type(0)

Variables

View Source
var (
	Skip           = errors.New("skip")
	NotImplemented = errors.New("not implemented")
)

Functions

This section is empty.

Types

type BaseVisitor

type BaseVisitor struct{}

func (BaseVisitor) VisitBoolLiteral

func (BaseVisitor) VisitBoolLiteral(v bool) error

func (BaseVisitor) VisitBytesLiteral

func (BaseVisitor) VisitBytesLiteral(v []byte) error

func (BaseVisitor) VisitColumn

func (BaseVisitor) VisitColumn(x ColumnExpr) error

func (BaseVisitor) VisitFloatLiteral

func (BaseVisitor) VisitFloatLiteral(v float64) error

func (BaseVisitor) VisitIntLiteral

func (BaseVisitor) VisitIntLiteral(v int64) error

func (BaseVisitor) VisitNullLiteral

func (BaseVisitor) VisitNullLiteral() error

func (BaseVisitor) VisitOp

func (BaseVisitor) VisitOp(x OpExpr) error

func (BaseVisitor) VisitQuery

func (BaseVisitor) VisitQuery(q *Query) error

func (BaseVisitor) VisitSplat

func (BaseVisitor) VisitSplat(x SplatExpr) error

func (BaseVisitor) VisitStringLiteral

func (BaseVisitor) VisitStringLiteral(v string) error

func (BaseVisitor) VisitTable

func (BaseVisitor) VisitTable(x TableExpr) error

func (BaseVisitor) VisitTimeLiteral

func (BaseVisitor) VisitTimeLiteral(v time.Time) error

func (BaseVisitor) VisitUintLiteral

func (BaseVisitor) VisitUintLiteral(v uint64) error

type BoolLiteral

type BoolLiteral bool

func (BoolLiteral) Append

func (lit BoolLiteral) Append(out []byte) []byte

func (BoolLiteral) GoAppend

func (lit BoolLiteral) GoAppend(out []byte) []byte

func (BoolLiteral) GoString

func (lit BoolLiteral) GoString() string

func (BoolLiteral) IsValid

func (lit BoolLiteral) IsValid() bool

func (BoolLiteral) Kind

func (lit BoolLiteral) Kind() Kind

func (BoolLiteral) Raw

func (lit BoolLiteral) Raw() bool

func (BoolLiteral) String

func (lit BoolLiteral) String() string

func (BoolLiteral) Type

func (lit BoolLiteral) Type() Type

func (BoolLiteral) Visit

func (lit BoolLiteral) Visit(v Visitor) error

type BytesLiteral

type BytesLiteral []byte

func (BytesLiteral) Append

func (lit BytesLiteral) Append(out []byte) []byte

func (BytesLiteral) GoAppend

func (lit BytesLiteral) GoAppend(out []byte) []byte

func (BytesLiteral) GoString

func (lit BytesLiteral) GoString() string

func (BytesLiteral) IsValid

func (lit BytesLiteral) IsValid() bool

func (BytesLiteral) Kind

func (lit BytesLiteral) Kind() Kind

func (BytesLiteral) Raw

func (lit BytesLiteral) Raw() []byte

func (BytesLiteral) String

func (lit BytesLiteral) String() string

func (BytesLiteral) Type

func (lit BytesLiteral) Type() Type

func (BytesLiteral) Visit

func (lit BytesLiteral) Visit(v Visitor) error

type Column

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

func (*Column) Append

func (c *Column) Append(out []byte) []byte

func (*Column) Expr

func (c *Column) Expr() ColumnExpr

func (*Column) ExprUsing

func (c *Column) ExprUsing(tx TableExpr) ColumnExpr

func (*Column) GoAppend

func (c *Column) GoAppend(out []byte) []byte

func (*Column) GoString

func (c *Column) GoString() string

func (*Column) IsValid

func (c *Column) IsValid() bool

func (*Column) Name

func (c *Column) Name() string

func (*Column) Schema

func (c *Column) Schema() *Schema

func (*Column) String

func (c *Column) String() string

func (*Column) Table

func (c *Column) Table() *Table

func (*Column) Type

func (c *Column) Type() Type

type ColumnExpr

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

func (ColumnExpr) Append

func (cx ColumnExpr) Append(out []byte) []byte

func (ColumnExpr) Column

func (cx ColumnExpr) Column() *Column

func (ColumnExpr) GoAppend

func (cx ColumnExpr) GoAppend(out []byte) []byte

func (ColumnExpr) GoString

func (cx ColumnExpr) GoString() string

func (ColumnExpr) IsValid

func (cx ColumnExpr) IsValid() bool

func (ColumnExpr) Kind

func (cx ColumnExpr) Kind() Kind

func (ColumnExpr) Name

func (cx ColumnExpr) Name() string

func (ColumnExpr) String

func (cx ColumnExpr) String() string

func (ColumnExpr) Table

func (cx ColumnExpr) Table() *Table

func (ColumnExpr) TableExpr

func (cx ColumnExpr) TableExpr() TableExpr

func (ColumnExpr) TableName

func (cx ColumnExpr) TableName() string

func (ColumnExpr) Type

func (cx ColumnExpr) Type() Type

func (ColumnExpr) Visit

func (cx ColumnExpr) Visit(v Visitor) error

type ColumnOption

type ColumnOption = Option[ColumnOptions]

type ColumnOptions

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

type Comparison

type Comparison byte
const (
	Cmp_EQ Comparison = iota
	Cmp_NE
	Cmp_LT
	Cmp_LE
	Cmp_GE
	Cmp_GT

	Cmp_LTE = Cmp_LE
	Cmp_GTE = Cmp_GE
)
const NumComparisons Comparison = 6

func (Comparison) Append

func (enum Comparison) Append(out []byte) []byte

func (Comparison) Eval

func (enum Comparison) Eval(cmp int) bool

func (Comparison) GoAppend

func (enum Comparison) GoAppend(out []byte) []byte

func (Comparison) GoString

func (enum Comparison) GoString() string

func (Comparison) IsValid

func (enum Comparison) IsValid() bool

func (Comparison) MarshalText

func (enum Comparison) MarshalText() ([]byte, error)

func (*Comparison) Parse

func (enum *Comparison) Parse(input string) error

func (Comparison) String

func (enum Comparison) String() string

func (*Comparison) UnmarshalText

func (enum *Comparison) UnmarshalText(input []byte) error

type Desc

type Desc bool

func (Desc) ApplyTo

func (desc Desc) ApplyTo(o *IndexedColumnOptions)

type Expr

type Expr interface {
	IsValid() bool
	Kind() Kind
	Visit(Visitor) error
	Stringer
}

type FloatLiteral

type FloatLiteral float64

func (FloatLiteral) Append

func (lit FloatLiteral) Append(out []byte) []byte

func (FloatLiteral) GoAppend

func (lit FloatLiteral) GoAppend(out []byte) []byte

func (FloatLiteral) GoString

func (lit FloatLiteral) GoString() string

func (FloatLiteral) IsValid

func (lit FloatLiteral) IsValid() bool

func (FloatLiteral) Kind

func (lit FloatLiteral) Kind() Kind

func (FloatLiteral) Raw

func (lit FloatLiteral) Raw() float64

func (FloatLiteral) String

func (lit FloatLiteral) String() string

func (FloatLiteral) Type

func (lit FloatLiteral) Type() Type

func (FloatLiteral) Visit

func (lit FloatLiteral) Visit(v Visitor) error

type Index

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

func (*Index) Append

func (i *Index) Append(out []byte) []byte

func (*Index) Column

func (i *Index) Column(index uint) *IndexedColumn

func (*Index) GoAppend

func (i *Index) GoAppend(out []byte) []byte

func (*Index) GoString

func (i *Index) GoString() string

func (*Index) IsValid

func (i *Index) IsValid() bool

func (*Index) Name

func (i *Index) Name() string

func (*Index) NumColumns

func (i *Index) NumColumns() uint

func (*Index) Schema

func (i *Index) Schema() *Schema

func (*Index) String

func (i *Index) String() string

func (*Index) Table

func (i *Index) Table() *Table

func (*Index) Type

func (i *Index) Type() IndexType

type IndexBuilder

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

func (IndexBuilder) Add

func (ib IndexBuilder) Add(name string, opts ...IndexedColumnOption) IndexBuilder

func (IndexBuilder) BuildIndex

func (ib IndexBuilder) BuildIndex() TableBuilder

func (IndexBuilder) Type

func (ib IndexBuilder) Type(it IndexType) IndexBuilder

type IndexOption

type IndexOption = Option[IndexOptions]

type IndexOptions

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

type IndexType

type IndexType byte
const (
	Index_NonUnique IndexType = iota
	Index_Unique
	Index_PrimaryKey
)
const NumIndexTypes IndexType = 3

func (IndexType) Append

func (enum IndexType) Append(out []byte) []byte

func (IndexType) GoAppend

func (enum IndexType) GoAppend(out []byte) []byte

func (IndexType) GoString

func (enum IndexType) GoString() string

func (IndexType) IsUnique

func (enum IndexType) IsUnique() bool

func (IndexType) IsValid

func (enum IndexType) IsValid() bool

func (IndexType) MarshalText

func (enum IndexType) MarshalText() ([]byte, error)

func (*IndexType) Parse

func (enum *IndexType) Parse(input string) error

func (IndexType) String

func (enum IndexType) String() string

func (*IndexType) UnmarshalText

func (enum *IndexType) UnmarshalText(input []byte) error

type IndexedColumn

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

func (*IndexedColumn) Append

func (ic *IndexedColumn) Append(out []byte) []byte

func (*IndexedColumn) Column

func (ic *IndexedColumn) Column() *Column

func (*IndexedColumn) GoAppend

func (ic *IndexedColumn) GoAppend(out []byte) []byte

func (*IndexedColumn) GoString

func (ic *IndexedColumn) GoString() string

func (*IndexedColumn) Index

func (ic *IndexedColumn) Index() *Index

func (*IndexedColumn) IsDesc

func (ic *IndexedColumn) IsDesc() bool

func (*IndexedColumn) IsValid

func (ic *IndexedColumn) IsValid() bool

func (*IndexedColumn) Schema

func (ic *IndexedColumn) Schema() *Schema

func (*IndexedColumn) String

func (ic *IndexedColumn) String() string

func (*IndexedColumn) Table

func (ic *IndexedColumn) Table() *Table

type IndexedColumnOption

type IndexedColumnOption = Option[IndexedColumnOptions]

type IndexedColumnOptions

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

type IntLiteral

type IntLiteral int64

func (IntLiteral) Append

func (lit IntLiteral) Append(out []byte) []byte

func (IntLiteral) GoAppend

func (lit IntLiteral) GoAppend(out []byte) []byte

func (IntLiteral) GoString

func (lit IntLiteral) GoString() string

func (IntLiteral) IsValid

func (lit IntLiteral) IsValid() bool

func (IntLiteral) Kind

func (lit IntLiteral) Kind() Kind

func (IntLiteral) Raw

func (lit IntLiteral) Raw() int64

func (IntLiteral) String

func (lit IntLiteral) String() string

func (IntLiteral) Type

func (lit IntLiteral) Type() Type

func (IntLiteral) Visit

func (lit IntLiteral) Visit(v Visitor) error

type Join

type Join byte
const (
	Join_Inner Join = iota
	Join_Outer
)
const NumJoins Join = 2

func (Join) Append

func (enum Join) Append(out []byte) []byte

func (Join) GoAppend

func (enum Join) GoAppend(out []byte) []byte

func (Join) GoString

func (enum Join) GoString() string

func (Join) IsValid

func (enum Join) IsValid() bool

func (Join) MarshalText

func (enum Join) MarshalText() ([]byte, error)

func (*Join) Parse

func (enum *Join) Parse(input string) error

func (Join) String

func (enum Join) String() string

func (*Join) UnmarshalText

func (enum *Join) UnmarshalText(input []byte) error

type Kind

type Kind byte
const (
	Kind_Unspec Kind = iota
	Kind_Query
	Kind_Table
	Kind_Splat
	Kind_Column
	Kind_Literal
	Kind_Op
)
const NumKinds Kind = 7

func (Kind) Append

func (enum Kind) Append(out []byte) []byte

func (Kind) GoAppend

func (enum Kind) GoAppend(out []byte) []byte

func (Kind) GoString

func (enum Kind) GoString() string

func (Kind) IsValid

func (enum Kind) IsValid() bool

func (Kind) MarshalText

func (enum Kind) MarshalText() ([]byte, error)

func (*Kind) Parse

func (enum *Kind) Parse(input string) error

func (Kind) String

func (enum Kind) String() string

func (*Kind) UnmarshalText

func (enum *Kind) UnmarshalText(input []byte) error

type NullLiteral

type NullLiteral struct{}

func (NullLiteral) Append

func (lit NullLiteral) Append(out []byte) []byte

func (NullLiteral) GoAppend

func (lit NullLiteral) GoAppend(out []byte) []byte

func (NullLiteral) GoString

func (lit NullLiteral) GoString() string

func (NullLiteral) IsValid

func (lit NullLiteral) IsValid() bool

func (NullLiteral) Kind

func (lit NullLiteral) Kind() Kind

func (NullLiteral) String

func (lit NullLiteral) String() string

func (NullLiteral) Type

func (lit NullLiteral) Type() Type

func (NullLiteral) Visit

func (lit NullLiteral) Visit(v Visitor) error

type OpExpr

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

func Add

func Add[TA ValueExpr, TB ValueExpr](a TA, b TB) OpExpr

func Identity

func Identity[T ValueExpr](x T) OpExpr

func (OpExpr) Append

func (ox OpExpr) Append(out []byte) []byte

func (OpExpr) GoAppend

func (ox OpExpr) GoAppend(out []byte) []byte

func (OpExpr) GoString

func (ox OpExpr) GoString() string

func (OpExpr) IsValid

func (ox OpExpr) IsValid() bool

func (OpExpr) Kind

func (ox OpExpr) Kind() Kind

func (OpExpr) NumOperands

func (ox OpExpr) NumOperands() uint

func (OpExpr) Operand

func (ox OpExpr) Operand(index uint) Expr

func (OpExpr) Operator

func (ox OpExpr) Operator() Operator

func (OpExpr) String

func (ox OpExpr) String() string

func (OpExpr) Type

func (ox OpExpr) Type() Type

func (OpExpr) Visit

func (ox OpExpr) Visit(v Visitor) error

type Operator

type Operator byte
const (
	OpIdentity Operator = iota
	OpNot
	OpAnd
	OpNand
	OpOr
	OpNor
	OpXor
	OpXnor
	OpAndNot
	OpEQ
	OpNE
	OpLT
	OpLE
	OpGE
	OpGT
	OpNeg
	OpAdd
	OpSub
	OpMul
	OpDiv
	OpMod
	OpSplat
)
const NumOperators Operator = 22

func (Operator) Append

func (enum Operator) Append(out []byte) []byte

func (Operator) GoAppend

func (enum Operator) GoAppend(out []byte) []byte

func (Operator) GoString

func (enum Operator) GoString() string

func (Operator) IsValid

func (enum Operator) IsValid() bool

func (Operator) MarshalText

func (enum Operator) MarshalText() ([]byte, error)

func (*Operator) Parse

func (enum *Operator) Parse(input string) error

func (Operator) String

func (enum Operator) String() string

func (*Operator) UnmarshalText

func (enum *Operator) UnmarshalText(input []byte) error

type Option

type Option[T any] interface {
	ApplyTo(*T)
}

type OrderCriterion

type OrderCriterion struct {
	Index  uint
	IsDesc bool
}

type Query

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

func (*Query) Append

func (q *Query) Append(out []byte) []byte

func (*Query) From

func (q *Query) From() QueryFrom

func (*Query) GoAppend

func (q *Query) GoAppend(out []byte) []byte

func (*Query) GoString

func (q *Query) GoString() string

func (*Query) IsValid

func (q *Query) IsValid() bool

func (*Query) Kind

func (q *Query) Kind() Kind

func (*Query) OrderBy

func (q *Query) OrderBy() QueryOrderBy

func (*Query) Select

func (q *Query) Select() QuerySelect

func (*Query) String

func (q *Query) String() string

func (*Query) Visit

func (q *Query) Visit(v Visitor) error

func (*Query) Where

func (q *Query) Where() ValueExpr

type QueryBuilder

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

func From

func From(table TableExpr) QueryBuilder

func NoFrom

func NoFrom() QueryBuilder

func (QueryBuilder) Build

func (qb QueryBuilder) Build() *Query

func (QueryBuilder) InnerJoin

func (qb QueryBuilder) InnerJoin(table TableExpr, cond ValueExpr) QueryBuilder

func (QueryBuilder) Join

func (qb QueryBuilder) Join(join Join, table TableExpr, cond ValueExpr) QueryBuilder

func (QueryBuilder) OuterJoin

func (qb QueryBuilder) OuterJoin(table TableExpr, cond ValueExpr) QueryBuilder

func (QueryBuilder) Select

func (qb QueryBuilder) Select(selections ...ValueExpr) QueryBuilder

func (QueryBuilder) Where

func (qb QueryBuilder) Where(where ValueExpr) QueryBuilder

type QueryColumn

type QueryColumn struct {
	Name  string
	Value ValueExpr
}

type QueryFrom

type QueryFrom interface {
	IsEmpty() bool
	Base() TableExpr
	NumJoins() uint
	Join(index uint) QueryJoin
}

type QueryJoin

type QueryJoin struct {
	Type      Join
	Table     TableExpr
	Condition ValueExpr
}

type QueryOrderBy

type QueryOrderBy interface {
	IsEmpty() bool
	NumCriteria() uint
	Criterion(index uint) OrderCriterion
}

type QuerySelect

type QuerySelect interface {
	IsEmpty() bool
	NumColumns() uint
	Column(index uint) QueryColumn
}

type Schema

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

func (*Schema) Append

func (s *Schema) Append(out []byte) []byte

func (*Schema) ByName

func (s *Schema) ByName(name string) *Table

func (*Schema) GoAppend

func (s *Schema) GoAppend(out []byte) []byte

func (*Schema) GoString

func (s *Schema) GoString() string

func (*Schema) IsValid

func (s *Schema) IsValid() bool

func (*Schema) NumTables

func (s *Schema) NumTables() uint

func (*Schema) String

func (s *Schema) String() string

func (*Schema) Table

func (s *Schema) Table(index uint) *Table

type SchemaBuilder

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

func BuildSchema

func BuildSchema(opts ...SchemaOption) SchemaBuilder

func (SchemaBuilder) Build

func (sb SchemaBuilder) Build() *Schema

func (SchemaBuilder) Table

func (sb SchemaBuilder) Table(name string, opts ...TableOption) TableBuilder

type SchemaOption

type SchemaOption = Option[SchemaOptions]

type SchemaOptions

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

type SplatExpr

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

func (SplatExpr) Append

func (sx SplatExpr) Append(out []byte) []byte

func (SplatExpr) GoAppend

func (sx SplatExpr) GoAppend(out []byte) []byte

func (SplatExpr) GoString

func (sx SplatExpr) GoString() string

func (SplatExpr) IsValid

func (sx SplatExpr) IsValid() bool

func (SplatExpr) Kind

func (sx SplatExpr) Kind() Kind

func (SplatExpr) Name

func (sx SplatExpr) Name() string

func (SplatExpr) String

func (sx SplatExpr) String() string

func (SplatExpr) Table

func (sx SplatExpr) Table() *Table

func (SplatExpr) TableExpr

func (sx SplatExpr) TableExpr() TableExpr

func (SplatExpr) Visit

func (sx SplatExpr) Visit(v Visitor) error

type StringLiteral

type StringLiteral string

func (StringLiteral) Append

func (lit StringLiteral) Append(out []byte) []byte

func (StringLiteral) GoAppend

func (lit StringLiteral) GoAppend(out []byte) []byte

func (StringLiteral) GoString

func (lit StringLiteral) GoString() string

func (StringLiteral) IsValid

func (lit StringLiteral) IsValid() bool

func (StringLiteral) Kind

func (lit StringLiteral) Kind() Kind

func (StringLiteral) Raw

func (lit StringLiteral) Raw() string

func (StringLiteral) String

func (lit StringLiteral) String() string

func (StringLiteral) Type

func (lit StringLiteral) Type() Type

func (StringLiteral) Visit

func (lit StringLiteral) Visit(v Visitor) error

type Stringer

type Stringer interface {
	GoAppend(out []byte) []byte
	GoString() string
	Append(out []byte) []byte
	String() string
}

type Table

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

func (*Table) Append

func (t *Table) Append(out []byte) []byte

func (*Table) As

func (t *Table) As(alias string) TableExpr

func (*Table) ByName

func (t *Table) ByName(name string) *Column

func (*Table) Column

func (t *Table) Column(index uint) *Column

func (*Table) Expr

func (t *Table) Expr() TableExpr

func (*Table) GoAppend

func (t *Table) GoAppend(out []byte) []byte

func (*Table) GoString

func (t *Table) GoString() string

func (*Table) Index

func (t *Table) Index(index uint) *Index

func (*Table) IndexByName

func (t *Table) IndexByName(name string) *Index

func (*Table) IsValid

func (t *Table) IsValid() bool

func (*Table) Name

func (t *Table) Name() string

func (*Table) NumColumns

func (t *Table) NumColumns() uint

func (*Table) NumIndices

func (t *Table) NumIndices() uint

func (*Table) PrimaryKey

func (t *Table) PrimaryKey() *Index

func (*Table) Schema

func (t *Table) Schema() *Schema

func (*Table) String

func (t *Table) String() string

type TableBuilder

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

func (TableBuilder) BuildTable

func (tb TableBuilder) BuildTable() SchemaBuilder

func (TableBuilder) Column

func (tb TableBuilder) Column(name string, t Type, opts ...ColumnOption) TableBuilder

func (TableBuilder) Index

func (tb TableBuilder) Index(name string, opts ...IndexOption) IndexBuilder

func (TableBuilder) PrimaryKey

func (tb TableBuilder) PrimaryKey(opts ...IndexOption) IndexBuilder

func (TableBuilder) Unique

func (tb TableBuilder) Unique(name string, opts ...IndexOption) IndexBuilder

type TableExpr

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

func (TableExpr) Append

func (tx TableExpr) Append(out []byte) []byte

func (TableExpr) As

func (tx TableExpr) As(alias string) TableExpr

func (TableExpr) GoAppend

func (tx TableExpr) GoAppend(out []byte) []byte

func (TableExpr) GoString

func (tx TableExpr) GoString() string

func (TableExpr) IsValid

func (tx TableExpr) IsValid() bool

func (TableExpr) Kind

func (tx TableExpr) Kind() Kind

func (TableExpr) Name

func (tx TableExpr) Name() string

func (TableExpr) Splat

func (tx TableExpr) Splat() SplatExpr

func (TableExpr) String

func (tx TableExpr) String() string

func (TableExpr) Table

func (tx TableExpr) Table() *Table

func (TableExpr) Visit

func (tx TableExpr) Visit(v Visitor) error

type TableOption

type TableOption = Option[TableOptions]

type TableOptions

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

type TimeLiteral

type TimeLiteral struct{ Time time.Time }

func (TimeLiteral) Append

func (lit TimeLiteral) Append(out []byte) []byte

func (TimeLiteral) GoAppend

func (lit TimeLiteral) GoAppend(out []byte) []byte

func (TimeLiteral) GoString

func (lit TimeLiteral) GoString() string

func (TimeLiteral) IsValid

func (lit TimeLiteral) IsValid() bool

func (TimeLiteral) Kind

func (lit TimeLiteral) Kind() Kind

func (TimeLiteral) Raw

func (lit TimeLiteral) Raw() time.Time

func (TimeLiteral) String

func (lit TimeLiteral) String() string

func (TimeLiteral) Type

func (lit TimeLiteral) Type() Type

func (TimeLiteral) Visit

func (lit TimeLiteral) Visit(v Visitor) error

type Type

type Type byte
const (
	Type_Void Type = iota
	Type_Null
	Type_I64
	Type_I32
	Type_I16
	Type_I8
	Type_U64
	Type_U32
	Type_U16
	Type_U8
	Type_F64
	Type_F32
	Type_Bool
	Type_Timestamp
	Type_String
	Type_Bytes
	Type_UUID
	Type_IPAddr
)
const NumTypes Type = 18

func (Type) Append

func (enum Type) Append(out []byte) []byte

func (Type) GoAppend

func (enum Type) GoAppend(out []byte) []byte

func (Type) GoString

func (enum Type) GoString() string

func (Type) IsValid

func (enum Type) IsValid() bool

func (Type) MarshalText

func (enum Type) MarshalText() ([]byte, error)

func (Type) NarrowsTo

func (enum Type) NarrowsTo(other Type) bool

func (*Type) Parse

func (enum *Type) Parse(input string) error

func (Type) String

func (enum Type) String() string

func (*Type) UnmarshalText

func (enum *Type) UnmarshalText(input []byte) error

func (Type) WidensTo

func (enum Type) WidensTo(other Type) bool

type UintLiteral

type UintLiteral uint64

func (UintLiteral) Append

func (lit UintLiteral) Append(out []byte) []byte

func (UintLiteral) GoAppend

func (lit UintLiteral) GoAppend(out []byte) []byte

func (UintLiteral) GoString

func (lit UintLiteral) GoString() string

func (UintLiteral) IsValid

func (lit UintLiteral) IsValid() bool

func (UintLiteral) Kind

func (lit UintLiteral) Kind() Kind

func (UintLiteral) Raw

func (lit UintLiteral) Raw() uint64

func (UintLiteral) String

func (lit UintLiteral) String() string

func (UintLiteral) Type

func (lit UintLiteral) Type() Type

func (UintLiteral) Visit

func (lit UintLiteral) Visit(v Visitor) error

type ValueExpr

type ValueExpr interface {
	Expr
	Type() Type
}

type Visitor

type Visitor interface {
	VisitQuery(*Query) error
	VisitTable(TableExpr) error
	VisitSplat(SplatExpr) error
	VisitColumn(ColumnExpr) error
	VisitOp(OpExpr) error

	VisitNullLiteral() error
	VisitBoolLiteral(bool) error
	VisitIntLiteral(int64) error
	VisitUintLiteral(uint64) error
	VisitFloatLiteral(float64) error
	VisitStringLiteral(string) error
	VisitBytesLiteral([]byte) error
	VisitTimeLiteral(time.Time) error
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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