octosql: github.com/cube2222/octosql Index | Files | Directories

package octosql

import "github.com/cube2222/octosql"

Index

Package Files

sorted_keys.go values.go values.pb.go variables.go

Constants

const (
    NullIdentifier      = 1  /* Nonexistent */
    PhantomIdentifier   = 2  /* Nonexistent */
    IntIdentifier       = 3  /* Number */
    FloatIdentifier     = 4  /* Number */
    BoolIdentifier      = 5  /* Bool */
    StringIdentifier    = 6  /* Until StringDelimiter */
    TimestampIdentifier = 7  /* Number */
    DurationIdentifier  = 8  /* Number */
    TupleIdentifier     = 9  /* Until TupleDelimiter */
    ObjectIdentifier    = 10 /* Object is a tuple */
    StringDelimiter     = 11
    TupleDelimiter      = 12
)

Delimiters must be less than 128 and different from identifiers Identifiers must all be unique and less than 128

const (
    NumberMarshalLength      = 1 + 8 // b[0] = type, b[1:] = marshal
    BoolMarshalLength        = 1 + 1 // b[0] = type, b[1] = 0/1
    NonexistentMarshalLength = 1     // null and phantom
)
const (
    BYTE_OFFSET         = 128
    MinimalTupleLength  = 1 + 1 + 1 // b[0] = type, b[1] = element, b[2] = end of tuple
    MinimalStringLength = 1 + 1     // b[0] = type, b[1] = end of string
)
const StarExpressionName = "*star*"

Variables

var ErrVariableNotFound = errors.New("variable not found")

func AreEqual Uses

func AreEqual(left, right Value) bool

octosql.AreEqual checks the equality of the given values, returning false if the types don't match.

func MarshalObject Uses

func MarshalObject(o map[string]Value) []byte

func MonotonicMarshalBool Uses

func MonotonicMarshalBool(b bool) []byte

Marshal bool

func MonotonicMarshalDuration Uses

func MonotonicMarshalDuration(d time.Duration) []byte

Marshal Duration

func MonotonicMarshalFloat Uses

func MonotonicMarshalFloat(f float64) []byte

Marshal float Based on the code from https://github.com/danburkert/bytekey

func MonotonicMarshalInt64 Uses

func MonotonicMarshalInt64(i int64) []byte

Marshal int and int64

func MonotonicMarshalNull Uses

func MonotonicMarshalNull() []byte

Marshal null

func MonotonicMarshalPhantom Uses

func MonotonicMarshalPhantom() []byte

Marshal phantom

func MonotonicMarshalString Uses

func MonotonicMarshalString(s string) []byte

Marshal string

func MonotonicMarshalTime Uses

func MonotonicMarshalTime(t time.Time) []byte

Marshal Timestamp

func MonotonicMarshalTuple Uses

func MonotonicMarshalTuple(vs []Value) []byte

Marshal Tuple

func MonotonicUnmarshalBool Uses

func MonotonicUnmarshalBool(b []byte) (bool, error)

func MonotonicUnmarshalDuration Uses

func MonotonicUnmarshalDuration(b []byte) (time.Duration, error)

func MonotonicUnmarshalFloat Uses

func MonotonicUnmarshalFloat(b []byte) (float64, error)

func MonotonicUnmarshalInt64 Uses

func MonotonicUnmarshalInt64(b []byte) (int64, error)

func MonotonicUnmarshalNull Uses

func MonotonicUnmarshalNull(b []byte) error

func MonotonicUnmarshalPhantom Uses

func MonotonicUnmarshalPhantom(b []byte) error

func MonotonicUnmarshalString Uses

func MonotonicUnmarshalString(b []byte) (string, error)

func MonotonicUnmarshalTime Uses

func MonotonicUnmarshalTime(b []byte) (time.Time, error)

func UnmarshalObject Uses

func UnmarshalObject(b []byte) (map[string]Value, error)

func VariableNamesToStrings Uses

func VariableNamesToStrings(vars []VariableName) []string

type Comparison Uses

type Comparison int
const (
    LessThan    Comparison = -1
    Equal       Comparison = 0
    GreaterThan Comparison = 1
)

func Compare Uses

func Compare(x, y Value) (Comparison, error)

type Float Uses

type Float float64

type Int Uses

type Int int

type Object Uses

type Object struct {
    Fields               map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    XXX_NoUnkeyedLiteral struct{}          `json:"-"`
    XXX_unrecognized     []byte            `json:"-"`
    XXX_sizecache        int32             `json:"-"`
}

func (*Object) Descriptor Uses

func (*Object) Descriptor() ([]byte, []int)

func (*Object) GetFields Uses

func (m *Object) GetFields() map[string]*Value

func (*Object) ProtoMessage Uses

func (*Object) ProtoMessage()

func (*Object) Reset Uses

func (m *Object) Reset()

func (*Object) String Uses

func (m *Object) String() string

func (*Object) XXX_DiscardUnknown Uses

func (m *Object) XXX_DiscardUnknown()

func (*Object) XXX_Marshal Uses

func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Object) XXX_Merge Uses

func (m *Object) XXX_Merge(src proto.Message)

func (*Object) XXX_Size Uses

func (m *Object) XXX_Size() int

func (*Object) XXX_Unmarshal Uses

func (m *Object) XXX_Unmarshal(b []byte) error

type Phantom Uses

type Phantom struct{}

type Tuple Uses

type Tuple struct {
    Fields               []*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*Tuple) Descriptor Uses

func (*Tuple) Descriptor() ([]byte, []int)

func (*Tuple) GetFields Uses

func (m *Tuple) GetFields() []*Value

func (*Tuple) ProtoMessage Uses

func (*Tuple) ProtoMessage()

func (*Tuple) Reset Uses

func (m *Tuple) Reset()

func (*Tuple) String Uses

func (m *Tuple) String() string

func (*Tuple) XXX_DiscardUnknown Uses

func (m *Tuple) XXX_DiscardUnknown()

func (*Tuple) XXX_Marshal Uses

func (m *Tuple) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Tuple) XXX_Merge Uses

func (m *Tuple) XXX_Merge(src proto.Message)

func (*Tuple) XXX_Size Uses

func (m *Tuple) XXX_Size() int

func (*Tuple) XXX_Unmarshal Uses

func (m *Tuple) XXX_Unmarshal(b []byte) error

type Type Uses

type Type int
const (
    TypeZero Type = iota
    TypeNull
    TypePhantom
    TypeInt
    TypeFloat
    TypeBool
    TypeString
    TypeTime
    TypeDuration
    TypeTuple
    TypeObject
)

func (Type) String Uses

func (t Type) String() string

type Value Uses

type Value struct {
    // Types that are valid to be assigned to Value:
    //	*Value_Null
    //	*Value_Phantom
    //	*Value_Int
    //	*Value_Float
    //	*Value_Bool
    //	*Value_String_
    //	*Value_Time
    //	*Value_Duration
    //	*Value_Tuple
    //	*Value_Object
    Value                isValue_Value `protobuf_oneof:"value"`
    XXX_NoUnkeyedLiteral struct{}      `json:"-"`
    XXX_unrecognized     []byte        `json:"-"`
    XXX_sizecache        int32         `json:"-"`
}

func GetPointersFromValues Uses

func GetPointersFromValues(values []Value) []*Value

func GetValuesFromPointers Uses

func GetValuesFromPointers(values []*Value) []Value

func MakeBool Uses

func MakeBool(v bool) Value

func MakeDuration Uses

func MakeDuration(v time.Duration) Value

func MakeFloat Uses

func MakeFloat(v float64) Value

func MakeInt Uses

func MakeInt(v int) Value

func MakeNull Uses

func MakeNull() Value

func MakeObject Uses

func MakeObject(v map[string]Value) Value

func MakePhantom Uses

func MakePhantom() Value

func MakeString Uses

func MakeString(v string) Value

func MakeTime Uses

func MakeTime(v time.Time) Value

func MakeTuple Uses

func MakeTuple(v []Value) Value

func MonotonicUnmarshalTuple Uses

func MonotonicUnmarshalTuple(b []byte) ([]Value, error)

func NormalizeType Uses

func NormalizeType(value interface{}) Value

NormalizeType brings various primitive types into the type we want them to be. All types coming out of data sources have to be already normalized this way.

func ZeroBool Uses

func ZeroBool() Value

func ZeroDuration Uses

func ZeroDuration() Value

func ZeroFloat Uses

func ZeroFloat() Value

func ZeroInt Uses

func ZeroInt() Value

func ZeroNull Uses

func ZeroNull() Value

func ZeroObject Uses

func ZeroObject() Value

func ZeroPhantom Uses

func ZeroPhantom() Value

func ZeroString Uses

func ZeroString() Value

func ZeroTime Uses

func ZeroTime() Value

func ZeroTuple Uses

func ZeroTuple() Value

func ZeroValue Uses

func ZeroValue() Value

func (Value) AsBool Uses

func (v Value) AsBool() bool

func (Value) AsDuration Uses

func (v Value) AsDuration() time.Duration

func (Value) AsFloat Uses

func (v Value) AsFloat() float64

func (Value) AsInt Uses

func (v Value) AsInt() int

func (Value) AsMap Uses

func (v Value) AsMap() map[string]Value

func (Value) AsSlice Uses

func (v Value) AsSlice() []Value

func (Value) AsString Uses

func (v Value) AsString() string

func (Value) AsTime Uses

func (v Value) AsTime() time.Time

func (*Value) Descriptor Uses

func (*Value) Descriptor() ([]byte, []int)

func (Value) Document Uses

func (v Value) Document() docs.Documentation

func (*Value) GetBool Uses

func (m *Value) GetBool() bool

func (*Value) GetDuration Uses

func (m *Value) GetDuration() *duration.Duration

func (*Value) GetFloat Uses

func (m *Value) GetFloat() float64

func (*Value) GetInt Uses

func (m *Value) GetInt() int64

func (*Value) GetNull Uses

func (m *Value) GetNull() bool

func (*Value) GetObject Uses

func (m *Value) GetObject() *Object

func (*Value) GetPhantom Uses

func (m *Value) GetPhantom() bool

func (*Value) GetString_ Uses

func (m *Value) GetString_() string

func (*Value) GetTime Uses

func (m *Value) GetTime() *timestamp.Timestamp

func (*Value) GetTuple Uses

func (m *Value) GetTuple() *Tuple

func (Value) GetType Uses

func (v Value) GetType() Type

Można na tych Value pod spodem zdefiniowac GetType i użyć wirtualnych metod, a nie type switch

func (*Value) GetValue Uses

func (m *Value) GetValue() isValue_Value

func (*Value) MonotonicMarshal Uses

func (v *Value) MonotonicMarshal() []byte

func (*Value) MonotonicUnmarshal Uses

func (v *Value) MonotonicUnmarshal(bytes []byte) error

func (*Value) ProtoMessage Uses

func (*Value) ProtoMessage()

func (*Value) Reset Uses

func (m *Value) Reset()

func (*Value) ReversedMonotonicMarshal Uses

func (v *Value) ReversedMonotonicMarshal() []byte

monotonically decreasing version of MonotonicMarshal

func (Value) Show Uses

func (v Value) Show() string

func (*Value) String Uses

func (m *Value) String() string

func (Value) ToRawValue Uses

func (v Value) ToRawValue() interface{}

func (*Value) XXX_DiscardUnknown Uses

func (m *Value) XXX_DiscardUnknown()

func (*Value) XXX_Marshal Uses

func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Value) XXX_Merge Uses

func (m *Value) XXX_Merge(src proto.Message)

func (*Value) XXX_OneofWrappers Uses

func (*Value) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Value) XXX_Size Uses

func (m *Value) XXX_Size() int

func (*Value) XXX_Unmarshal Uses

func (m *Value) XXX_Unmarshal(b []byte) error

type Value_Bool Uses

type Value_Bool struct {
    Bool bool `protobuf:"varint,5,opt,name=bool,proto3,oneof"`
}

type Value_Duration Uses

type Value_Duration struct {
    Duration *duration.Duration `protobuf:"bytes,8,opt,name=duration,proto3,oneof"`
}

type Value_Float Uses

type Value_Float struct {
    Float float64 `protobuf:"fixed64,4,opt,name=float,proto3,oneof"`
}

type Value_Int Uses

type Value_Int struct {
    Int int64 `protobuf:"varint,3,opt,name=int,proto3,oneof"`
}

type Value_Null Uses

type Value_Null struct {
    Null bool `protobuf:"varint,1,opt,name=null,proto3,oneof"`
}

type Value_Object Uses

type Value_Object struct {
    Object *Object `protobuf:"bytes,10,opt,name=object,proto3,oneof"`
}

type Value_Phantom Uses

type Value_Phantom struct {
    Phantom bool `protobuf:"varint,2,opt,name=phantom,proto3,oneof"`
}

type Value_String_ Uses

type Value_String_ struct {
    String_ string `protobuf:"bytes,6,opt,name=string,proto3,oneof"`
}

type Value_Time Uses

type Value_Time struct {
    Time *timestamp.Timestamp `protobuf:"bytes,7,opt,name=time,proto3,oneof"`
}

type Value_Tuple Uses

type Value_Tuple struct {
    Tuple *Tuple `protobuf:"bytes,9,opt,name=tuple,proto3,oneof"`
}

type VariableName Uses

type VariableName string

func NewVariableName Uses

func NewVariableName(varname string) VariableName

func StringsToVariableNames Uses

func StringsToVariableNames(strings []string) []VariableName

func (VariableName) Empty Uses

func (vn VariableName) Empty() bool

func (VariableName) Equal Uses

func (vn VariableName) Equal(other VariableName) bool

func (VariableName) Name Uses

func (vn VariableName) Name() string

func (VariableName) Source Uses

func (vn VariableName) Source() string

func (VariableName) String Uses

func (vn VariableName) String() string

type Variables Uses

type Variables map[VariableName]Value

func NewVariables Uses

func NewVariables(variables map[VariableName]Value) Variables

func NoVariables Uses

func NoVariables() Variables

func (Variables) DeterministicOrder Uses

func (vs Variables) DeterministicOrder() []VariableName

func (Variables) Get Uses

func (vs Variables) Get(k VariableName) (Value, error)

func (Variables) MergeWith Uses

func (vs Variables) MergeWith(other Variables) (Variables, error)

Directories

PathSynopsis
app
cmd/octosql
config
datasources/csv
datasources/excel
datasources/json
datasources/kafka
datasources/parquet
datasources/redis
datasources/sql
datasources/sql/mysql
datasources/sql/postgres
docs
execution
execution/aggregates
execution/functions
execution/functions/docgen
execution/trigger
execution/tvf
execution/tvf/docgen
graph
logical
output
output/batch
output/batch/csv
output/batch/table
output/csv
output/streaming
output/streaming/json
parser
parser/sqlparser
parser/sqlparser/dependency/bytes2
parser/sqlparser/dependency/hackPackage hack gives you some efficient functionality at the cost of breaking some Go rules.
parser/sqlparser/dependency/queryPackage query is a generated protocol buffer package.
parser/sqlparser/dependency/sqltypesPackage sqltypes implements interfaces and types that represent SQL values.
physical
physical/matcher
physical/metadata
physical/optimizer
storage/sql
storage/sql/mysql
storage/sql/postgres

Package octosql imports 15 packages (graph) and is imported by 30 packages. Updated 2020-08-05. Refresh now. Tools for package owners.