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 ¶
- Variables
- type Array
- func (*Array) Descriptor() ([]byte, []int)
- func (m *Array) GetValue() []*Expr
- func (m *Array) Marshal() (dAtA []byte, err error)
- func (m *Array) MarshalTo(dAtA []byte) (int, error)
- func (*Array) ProtoMessage()
- func (m *Array) Reset()
- func (m *Array) Size() (n int)
- func (m *Array) String() string
- func (m *Array) Unmarshal(dAtA []byte) error
- type ColumnIdentifier
- func (*ColumnIdentifier) Descriptor() ([]byte, []int)
- func (m *ColumnIdentifier) GetDocumentPath() []*DocumentPathItem
- func (m *ColumnIdentifier) GetName() string
- func (m *ColumnIdentifier) GetSchemaName() string
- func (m *ColumnIdentifier) GetTableName() string
- func (m *ColumnIdentifier) Marshal() (dAtA []byte, err error)
- func (m *ColumnIdentifier) MarshalTo(dAtA []byte) (int, error)
- func (*ColumnIdentifier) ProtoMessage()
- func (m *ColumnIdentifier) Reset()
- func (m *ColumnIdentifier) Size() (n int)
- func (m *ColumnIdentifier) String() string
- func (m *ColumnIdentifier) Unmarshal(dAtA []byte) error
- type DocumentPathItem
- func (*DocumentPathItem) Descriptor() ([]byte, []int)
- func (m *DocumentPathItem) GetIndex() uint32
- func (m *DocumentPathItem) GetType() DocumentPathItem_Type
- func (m *DocumentPathItem) GetValue() string
- func (m *DocumentPathItem) Marshal() (dAtA []byte, err error)
- func (m *DocumentPathItem) MarshalTo(dAtA []byte) (int, error)
- func (*DocumentPathItem) ProtoMessage()
- func (m *DocumentPathItem) Reset()
- func (m *DocumentPathItem) Size() (n int)
- func (m *DocumentPathItem) String() string
- func (m *DocumentPathItem) Unmarshal(dAtA []byte) error
- type DocumentPathItem_Type
- type Expr
- func (*Expr) Descriptor() ([]byte, []int)
- func (m *Expr) GetArray() *Array
- func (m *Expr) GetFunctionCall() *FunctionCall
- func (m *Expr) GetIdentifier() *ColumnIdentifier
- func (m *Expr) GetLiteral() *Mysqlx_Datatypes.Scalar
- func (m *Expr) GetObject() *Object
- func (m *Expr) GetOperator() *Operator
- func (m *Expr) GetPosition() uint32
- func (m *Expr) GetType() Expr_Type
- func (m *Expr) GetVariable() string
- func (m *Expr) Marshal() (dAtA []byte, err error)
- func (m *Expr) MarshalTo(dAtA []byte) (int, error)
- func (*Expr) ProtoMessage()
- func (m *Expr) Reset()
- func (m *Expr) Size() (n int)
- func (m *Expr) String() string
- func (m *Expr) Unmarshal(dAtA []byte) error
- type Expr_Type
- type FunctionCall
- func (*FunctionCall) Descriptor() ([]byte, []int)
- func (m *FunctionCall) GetName() *Identifier
- func (m *FunctionCall) GetParam() []*Expr
- func (m *FunctionCall) Marshal() (dAtA []byte, err error)
- func (m *FunctionCall) MarshalTo(dAtA []byte) (int, error)
- func (*FunctionCall) ProtoMessage()
- func (m *FunctionCall) Reset()
- func (m *FunctionCall) Size() (n int)
- func (m *FunctionCall) String() string
- func (m *FunctionCall) Unmarshal(dAtA []byte) error
- type Identifier
- func (*Identifier) Descriptor() ([]byte, []int)
- func (m *Identifier) GetName() string
- func (m *Identifier) GetSchemaName() string
- func (m *Identifier) Marshal() (dAtA []byte, err error)
- func (m *Identifier) MarshalTo(dAtA []byte) (int, error)
- func (*Identifier) ProtoMessage()
- func (m *Identifier) Reset()
- func (m *Identifier) Size() (n int)
- func (m *Identifier) String() string
- func (m *Identifier) Unmarshal(dAtA []byte) error
- type Object
- func (*Object) Descriptor() ([]byte, []int)
- func (m *Object) GetFld() []*Object_ObjectField
- func (m *Object) Marshal() (dAtA []byte, err error)
- func (m *Object) MarshalTo(dAtA []byte) (int, error)
- func (*Object) ProtoMessage()
- func (m *Object) Reset()
- func (m *Object) Size() (n int)
- func (m *Object) String() string
- func (m *Object) Unmarshal(dAtA []byte) error
- type Object_ObjectField
- func (*Object_ObjectField) Descriptor() ([]byte, []int)
- func (m *Object_ObjectField) GetKey() string
- func (m *Object_ObjectField) GetValue() *Expr
- func (m *Object_ObjectField) Marshal() (dAtA []byte, err error)
- func (m *Object_ObjectField) MarshalTo(dAtA []byte) (int, error)
- func (*Object_ObjectField) ProtoMessage()
- func (m *Object_ObjectField) Reset()
- func (m *Object_ObjectField) Size() (n int)
- func (m *Object_ObjectField) String() string
- func (m *Object_ObjectField) Unmarshal(dAtA []byte) error
- type Operator
- func (*Operator) Descriptor() ([]byte, []int)
- func (m *Operator) GetName() string
- func (m *Operator) GetParam() []*Expr
- func (m *Operator) Marshal() (dAtA []byte, err error)
- func (m *Operator) MarshalTo(dAtA []byte) (int, error)
- func (*Operator) ProtoMessage()
- func (m *Operator) Reset()
- func (m *Operator) Size() (n int)
- func (m *Operator) String() string
- func (m *Operator) Unmarshal(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthMysqlxExpr = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMysqlxExpr = fmt.Errorf("proto: integer overflow") )
var DocumentPathItem_Type_name = map[int32]string{
1: "MEMBER",
2: "MEMBER_ASTERISK",
3: "ARRAY_INDEX",
4: "ARRAY_INDEX_ASTERISK",
5: "DOUBLE_ASTERISK",
}
var DocumentPathItem_Type_value = map[string]int32{
"MEMBER": 1,
"MEMBER_ASTERISK": 2,
"ARRAY_INDEX": 3,
"ARRAY_INDEX_ASTERISK": 4,
"DOUBLE_ASTERISK": 5,
}
var Expr_Type_name = map[int32]string{
1: "IDENT",
2: "LITERAL",
3: "VARIABLE",
4: "FUNC_CALL",
5: "OPERATOR",
6: "PLACEHOLDER",
7: "OBJECT",
8: "ARRAY",
}
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) ProtoMessage ¶
func (*Array) ProtoMessage()
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) 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 (m *DocumentPathItem) GetType() DocumentPathItem_Type
func (*DocumentPathItem) GetValue ¶
func (m *DocumentPathItem) GetValue() string
func (*DocumentPathItem) Marshal ¶
func (m *DocumentPathItem) Marshal() (dAtA []byte, err 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 (x DocumentPathItem_Type) Enum() *DocumentPathItem_Type
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) 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) GetOperator ¶
func (*Expr) GetPosition ¶
func (*Expr) GetVariable ¶
func (*Expr) ProtoMessage ¶
func (*Expr) ProtoMessage()
type Expr_Type ¶
type Expr_Type int32
func (Expr_Type) EnumDescriptor ¶
func (*Expr_Type) UnmarshalJSON ¶
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) 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) 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) GetFld ¶
func (m *Object) GetFld() []*Object_ObjectField
func (*Object) ProtoMessage ¶
func (*Object) ProtoMessage()
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) ProtoMessage ¶
func (*Operator) ProtoMessage()