Mysqlx_Expr

package
v0.0.0-...-14e0149 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2017 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package Mysqlx_Expr is a generated protocol buffer package.

Expression syntax

expr is the fundamental structure in various places of the SQL language:

* “SELECT <expr> AS ...“ * “WHERE <expr>“

The structures can be used to:

* build an Item-tree in the MySQL Server * generate SQL from it * use as filter condition in CRUD's Find(), Update() and Delete() calls.

It is generated from these files:

github.com/pingcap/tipb/go-mysqlx/Expr/mysqlx_expr.proto

It has these top-level messages:

Expr
Identifier
DocumentPathItem
ColumnIdentifier
FunctionCall
Operator
Object
Array

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthMysqlxExpr = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMysqlxExpr   = fmt.Errorf("proto: integer overflow")
)
View Source
var DocumentPathItem_Type_name = map[int32]string{
	1: "MEMBER",
	2: "MEMBER_ASTERISK",
	3: "ARRAY_INDEX",
	4: "ARRAY_INDEX_ASTERISK",
	5: "DOUBLE_ASTERISK",
}
View Source
var DocumentPathItem_Type_value = map[string]int32{
	"MEMBER":               1,
	"MEMBER_ASTERISK":      2,
	"ARRAY_INDEX":          3,
	"ARRAY_INDEX_ASTERISK": 4,
	"DOUBLE_ASTERISK":      5,
}
View Source
var Expr_Type_name = map[int32]string{
	1: "IDENT",
	2: "LITERAL",
	3: "VARIABLE",
	4: "FUNC_CALL",
	5: "OPERATOR",
	6: "PLACEHOLDER",
	7: "OBJECT",
	8: "ARRAY",
}
View Source
var Expr_Type_value = map[string]int32{
	"IDENT":       1,
	"LITERAL":     2,
	"VARIABLE":    3,
	"FUNC_CALL":   4,
	"OPERATOR":    5,
	"PLACEHOLDER": 6,
	"OBJECT":      7,
	"ARRAY":       8,
}

Functions

This section is empty.

Types

type Array

type Array struct {
	Value            []*Expr `protobuf:"bytes,1,rep,name=value" json:"value,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

a Array of expressions

func (*Array) Descriptor

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

func (*Array) GetValue

func (m *Array) GetValue() []*Expr

func (*Array) Marshal

func (m *Array) Marshal() (dAtA []byte, err error)

func (*Array) MarshalTo

func (m *Array) MarshalTo(dAtA []byte) (int, error)

func (*Array) ProtoMessage

func (*Array) ProtoMessage()

func (*Array) Reset

func (m *Array) Reset()

func (*Array) Size

func (m *Array) Size() (n int)

func (*Array) String

func (m *Array) String() string

func (*Array) Unmarshal

func (m *Array) Unmarshal(dAtA []byte) error

type ColumnIdentifier

type ColumnIdentifier struct {
	DocumentPath     []*DocumentPathItem `protobuf:"bytes,1,rep,name=document_path,json=documentPath" json:"document_path,omitempty"`
	Name             *string             `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	TableName        *string             `protobuf:"bytes,3,opt,name=table_name,json=tableName" json:"table_name,omitempty"`
	SchemaName       *string             `protobuf:"bytes,4,opt,name=schema_name,json=schemaName" json:"schema_name,omitempty"`
	XXX_unrecognized []byte              `json:"-"`
}

col_identifier (table): col@doc_path, tbl.col@doc_path col, tbl.col, schema.tbl.col col_identifier (document): doc_path

.. productionlist::

col_identifier: string "." string "." string |
          : string "." string |
          : string |
          : string "." string "." string "@" document_path |
          : string "." string "@" document_path |
          : string "@" document_path |
          : document_path
 document_path: member | arrayLocation | doubleAsterisk
 member = "." string | "." "*"
 arrayLocation = "[" index "]" | "[" "*" "]"
 doubleAsterisk = "**"

func (*ColumnIdentifier) Descriptor

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

func (*ColumnIdentifier) GetDocumentPath

func (m *ColumnIdentifier) GetDocumentPath() []*DocumentPathItem

func (*ColumnIdentifier) GetName

func (m *ColumnIdentifier) GetName() string

func (*ColumnIdentifier) GetSchemaName

func (m *ColumnIdentifier) GetSchemaName() string

func (*ColumnIdentifier) GetTableName

func (m *ColumnIdentifier) GetTableName() string

func (*ColumnIdentifier) Marshal

func (m *ColumnIdentifier) Marshal() (dAtA []byte, err error)

func (*ColumnIdentifier) MarshalTo

func (m *ColumnIdentifier) MarshalTo(dAtA []byte) (int, error)

func (*ColumnIdentifier) ProtoMessage

func (*ColumnIdentifier) ProtoMessage()

func (*ColumnIdentifier) Reset

func (m *ColumnIdentifier) Reset()

func (*ColumnIdentifier) Size

func (m *ColumnIdentifier) Size() (n int)

func (*ColumnIdentifier) String

func (m *ColumnIdentifier) String() string

func (*ColumnIdentifier) Unmarshal

func (m *ColumnIdentifier) Unmarshal(dAtA []byte) error

type DocumentPathItem

type DocumentPathItem struct {
	Type             *DocumentPathItem_Type `protobuf:"varint,1,req,name=type,enum=Mysqlx.Expr.DocumentPathItem_Type" json:"type,omitempty"`
	Value            *string                `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
	Index            *uint32                `protobuf:"varint,3,opt,name=index" json:"index,omitempty"`
	XXX_unrecognized []byte                 `json:"-"`
}

DocumentPathItem

.. productionlist::

document_path: path_item | path_item document_path
path_item    : member | array_index | "**"
member       : "." string | "." "*"
array_index  : "[" number "]" | "[" "*" "]"

func (*DocumentPathItem) Descriptor

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

func (*DocumentPathItem) GetIndex

func (m *DocumentPathItem) GetIndex() uint32

func (*DocumentPathItem) GetType

func (*DocumentPathItem) GetValue

func (m *DocumentPathItem) GetValue() string

func (*DocumentPathItem) Marshal

func (m *DocumentPathItem) Marshal() (dAtA []byte, err error)

func (*DocumentPathItem) MarshalTo

func (m *DocumentPathItem) MarshalTo(dAtA []byte) (int, error)

func (*DocumentPathItem) ProtoMessage

func (*DocumentPathItem) ProtoMessage()

func (*DocumentPathItem) Reset

func (m *DocumentPathItem) Reset()

func (*DocumentPathItem) Size

func (m *DocumentPathItem) Size() (n int)

func (*DocumentPathItem) String

func (m *DocumentPathItem) String() string

func (*DocumentPathItem) Unmarshal

func (m *DocumentPathItem) Unmarshal(dAtA []byte) error

type DocumentPathItem_Type

type DocumentPathItem_Type int32
const (
	DocumentPathItem_MEMBER               DocumentPathItem_Type = 1
	DocumentPathItem_MEMBER_ASTERISK      DocumentPathItem_Type = 2
	DocumentPathItem_ARRAY_INDEX          DocumentPathItem_Type = 3
	DocumentPathItem_ARRAY_INDEX_ASTERISK DocumentPathItem_Type = 4
	DocumentPathItem_DOUBLE_ASTERISK      DocumentPathItem_Type = 5
)

func (DocumentPathItem_Type) Enum

func (DocumentPathItem_Type) EnumDescriptor

func (DocumentPathItem_Type) EnumDescriptor() ([]byte, []int)

func (DocumentPathItem_Type) String

func (x DocumentPathItem_Type) String() string

func (*DocumentPathItem_Type) UnmarshalJSON

func (x *DocumentPathItem_Type) UnmarshalJSON(data []byte) error

type Expr

type Expr struct {
	Type             *Expr_Type               `protobuf:"varint,1,req,name=type,enum=Mysqlx.Expr.Expr_Type" json:"type,omitempty"`
	Identifier       *ColumnIdentifier        `protobuf:"bytes,2,opt,name=identifier" json:"identifier,omitempty"`
	Variable         *string                  `protobuf:"bytes,3,opt,name=variable" json:"variable,omitempty"`
	Literal          *Mysqlx_Datatypes.Scalar `protobuf:"bytes,4,opt,name=literal" json:"literal,omitempty"`
	FunctionCall     *FunctionCall            `protobuf:"bytes,5,opt,name=function_call,json=functionCall" json:"function_call,omitempty"`
	Operator         *Operator                `protobuf:"bytes,6,opt,name=operator" json:"operator,omitempty"`
	Position         *uint32                  `protobuf:"varint,7,opt,name=position" json:"position,omitempty"`
	Object           *Object                  `protobuf:"bytes,8,opt,name=object" json:"object,omitempty"`
	Array            *Array                   `protobuf:"bytes,9,opt,name=array" json:"array,omitempty"`
	XXX_unrecognized []byte                   `json:"-"`
}

Expressions

the "root" of the expression tree

.. productionlist::

expr: `operator` |
    : `identifier` |
    : `function_call` |
    : variable |
    : `literal` |
    : placeholder

If expression type is PLACEHOLDER then it refers to the value of a parameter specified when executing a statement (see `args` field of `StmtExecute` command). Field `position` (which must be present for such an expression) gives 0-based position of the parameter in the parameter list.

func (*Expr) Descriptor

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

func (*Expr) GetArray

func (m *Expr) GetArray() *Array

func (*Expr) GetFunctionCall

func (m *Expr) GetFunctionCall() *FunctionCall

func (*Expr) GetIdentifier

func (m *Expr) GetIdentifier() *ColumnIdentifier

func (*Expr) GetLiteral

func (m *Expr) GetLiteral() *Mysqlx_Datatypes.Scalar

func (*Expr) GetObject

func (m *Expr) GetObject() *Object

func (*Expr) GetOperator

func (m *Expr) GetOperator() *Operator

func (*Expr) GetPosition

func (m *Expr) GetPosition() uint32

func (*Expr) GetType

func (m *Expr) GetType() Expr_Type

func (*Expr) GetVariable

func (m *Expr) GetVariable() string

func (*Expr) Marshal

func (m *Expr) Marshal() (dAtA []byte, err error)

func (*Expr) MarshalTo

func (m *Expr) MarshalTo(dAtA []byte) (int, error)

func (*Expr) ProtoMessage

func (*Expr) ProtoMessage()

func (*Expr) Reset

func (m *Expr) Reset()

func (*Expr) Size

func (m *Expr) Size() (n int)

func (*Expr) String

func (m *Expr) String() string

func (*Expr) Unmarshal

func (m *Expr) Unmarshal(dAtA []byte) error

type Expr_Type

type Expr_Type int32
const (
	Expr_IDENT       Expr_Type = 1
	Expr_LITERAL     Expr_Type = 2
	Expr_VARIABLE    Expr_Type = 3
	Expr_FUNC_CALL   Expr_Type = 4
	Expr_OPERATOR    Expr_Type = 5
	Expr_PLACEHOLDER Expr_Type = 6
	Expr_OBJECT      Expr_Type = 7
	Expr_ARRAY       Expr_Type = 8
)

func (Expr_Type) Enum

func (x Expr_Type) Enum() *Expr_Type

func (Expr_Type) EnumDescriptor

func (Expr_Type) EnumDescriptor() ([]byte, []int)

func (Expr_Type) String

func (x Expr_Type) String() string

func (*Expr_Type) UnmarshalJSON

func (x *Expr_Type) UnmarshalJSON(data []byte) error

type FunctionCall

type FunctionCall struct {
	Name             *Identifier `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	Param            []*Expr     `protobuf:"bytes,2,rep,name=param" json:"param,omitempty"`
	XXX_unrecognized []byte      `json:"-"`
}

function call: “func(a, b, "1", 3)“

.. productionlist::

function_call: `identifier` "(" [ `expr` ["," `expr` ]* ] ")"

func (*FunctionCall) Descriptor

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

func (*FunctionCall) GetName

func (m *FunctionCall) GetName() *Identifier

func (*FunctionCall) GetParam

func (m *FunctionCall) GetParam() []*Expr

func (*FunctionCall) Marshal

func (m *FunctionCall) Marshal() (dAtA []byte, err error)

func (*FunctionCall) MarshalTo

func (m *FunctionCall) MarshalTo(dAtA []byte) (int, error)

func (*FunctionCall) ProtoMessage

func (*FunctionCall) ProtoMessage()

func (*FunctionCall) Reset

func (m *FunctionCall) Reset()

func (*FunctionCall) Size

func (m *FunctionCall) Size() (n int)

func (*FunctionCall) String

func (m *FunctionCall) String() string

func (*FunctionCall) Unmarshal

func (m *FunctionCall) Unmarshal(dAtA []byte) error

type Identifier

type Identifier struct {
	Name             *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	SchemaName       *string `protobuf:"bytes,2,opt,name=schema_name,json=schemaName" json:"schema_name,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

identifier: name, schame.name

.. productionlist::

identifier: string "." string |
          : string

func (*Identifier) Descriptor

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

func (*Identifier) GetName

func (m *Identifier) GetName() string

func (*Identifier) GetSchemaName

func (m *Identifier) GetSchemaName() string

func (*Identifier) Marshal

func (m *Identifier) Marshal() (dAtA []byte, err error)

func (*Identifier) MarshalTo

func (m *Identifier) MarshalTo(dAtA []byte) (int, error)

func (*Identifier) ProtoMessage

func (*Identifier) ProtoMessage()

func (*Identifier) Reset

func (m *Identifier) Reset()

func (*Identifier) Size

func (m *Identifier) Size() (n int)

func (*Identifier) String

func (m *Identifier) String() string

func (*Identifier) Unmarshal

func (m *Identifier) Unmarshal(dAtA []byte) error

type Object

type Object struct {
	Fld              []*Object_ObjectField `protobuf:"bytes,1,rep,name=fld" json:"fld,omitempty"`
	XXX_unrecognized []byte                `json:"-"`
}

an object (with expression values)

func (*Object) Descriptor

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

func (*Object) GetFld

func (m *Object) GetFld() []*Object_ObjectField

func (*Object) Marshal

func (m *Object) Marshal() (dAtA []byte, err error)

func (*Object) MarshalTo

func (m *Object) MarshalTo(dAtA []byte) (int, error)

func (*Object) ProtoMessage

func (*Object) ProtoMessage()

func (*Object) Reset

func (m *Object) Reset()

func (*Object) Size

func (m *Object) Size() (n int)

func (*Object) String

func (m *Object) String() string

func (*Object) Unmarshal

func (m *Object) Unmarshal(dAtA []byte) error

type Object_ObjectField

type Object_ObjectField struct {
	Key              *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"`
	Value            *Expr   `protobuf:"bytes,2,req,name=value" json:"value,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*Object_ObjectField) Descriptor

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

func (*Object_ObjectField) GetKey

func (m *Object_ObjectField) GetKey() string

func (*Object_ObjectField) GetValue

func (m *Object_ObjectField) GetValue() *Expr

func (*Object_ObjectField) Marshal

func (m *Object_ObjectField) Marshal() (dAtA []byte, err error)

func (*Object_ObjectField) MarshalTo

func (m *Object_ObjectField) MarshalTo(dAtA []byte) (int, error)

func (*Object_ObjectField) ProtoMessage

func (*Object_ObjectField) ProtoMessage()

func (*Object_ObjectField) Reset

func (m *Object_ObjectField) Reset()

func (*Object_ObjectField) Size

func (m *Object_ObjectField) Size() (n int)

func (*Object_ObjectField) String

func (m *Object_ObjectField) String() string

func (*Object_ObjectField) Unmarshal

func (m *Object_ObjectField) Unmarshal(dAtA []byte) error

type Operator

type Operator struct {
	Name             *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	Param            []*Expr `protobuf:"bytes,2,rep,name=param" json:"param,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

operator: “<<(a, b)“

.. note::

Non-authoritative list of operators implemented (case sensitive):

Nullary
  * ``*``
  * ``default``

Unary
  * ``!``
  * ``sign_plus``
  * ``sign_minus``
  * ``~``

Binary
  * ``&&``
  * ``||``
  * ``xor``
  * ``==``
  * ``!=``
  * ``>``
  * ``>=``
  * ``<``
  * ``<=``
  * ``&``
  * ``|``
  * ``^``
  * ``<<``
  * ``>>``
  * ``+``
  * ``-``
  * ``*``
  * ``/``
  * ``div``
  * ``%``
  * ``is``
  * ``is_not``
  * ``regexp``
  * ``not_regexp``
  * ``like``
  * ``not_like``
  * ``cast``

Using special representation, with more than 2 params
  * ``in`` (param[0] IN (param[1], param[2], ...))
  * ``not_in`` (param[0] NOT IN (param[1], param[2], ...))

Ternary
  * ``between``
  * ``between_not``
  * ``date_add``
  * ``date_sub``

Units for date_add/date_sub
  * ``MICROSECOND``
  * ``SECOND``
  * ``MINUTE``
  * ``HOUR``
  * ``DAY``
  * ``WEEK``
  * ``MONTH``
  * ``QUARTER``
  * ``YEAR``
  * ``SECOND_MICROSECOND``
  * ``MINUTE_MICROSECOND``
  * ``MINUTE_SECOND``
  * ``HOUR_MICROSECOND``
  * ``HOUR_SECOND``
  * ``HOUR_MINUTE``
  * ``DAY_MICROSECOND``
  * ``DAY_SECOND``
  * ``DAY_MINUTE``
  * ``DAY_HOUR``

Types for cast
  * ``BINARY[(N)]``
  * ``CHAR[(N)]``
  * ``DATE``
  * ``DATETIME``
  * ``DECIMAL[(M[,D])]``
  * ``JSON``
  * ``SIGNED [INTEGER]``
  * ``TIME``
  * ``UNSIGNED [INTEGER]``

.. productionlist::

operator: `name` "(" [ `expr` ["," `expr` ]* ] ")"

func (*Operator) Descriptor

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

func (*Operator) GetName

func (m *Operator) GetName() string

func (*Operator) GetParam

func (m *Operator) GetParam() []*Expr

func (*Operator) Marshal

func (m *Operator) Marshal() (dAtA []byte, err error)

func (*Operator) MarshalTo

func (m *Operator) MarshalTo(dAtA []byte) (int, error)

func (*Operator) ProtoMessage

func (*Operator) ProtoMessage()

func (*Operator) Reset

func (m *Operator) Reset()

func (*Operator) Size

func (m *Operator) Size() (n int)

func (*Operator) String

func (m *Operator) String() string

func (*Operator) Unmarshal

func (m *Operator) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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