2016-11-04 10:01:19 +00:00
|
|
|
// Copyright © 2016 Abcum Ltd
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package sql
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/abcum/cork"
|
2017-02-09 20:44:54 +00:00
|
|
|
"github.com/abcum/surreal/util/pack"
|
2016-11-04 10:01:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// Token
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func (this Token) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte(this.String()), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Token) MarshalBinary() (data []byte, err error) {
|
|
|
|
return []byte(this.String()), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Token) UnmarshalBinary(data []byte) (err error) {
|
|
|
|
*this = newToken(string(data))
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// ALL
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&All{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *All) ExtendCORK() byte {
|
|
|
|
return 0x01
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *All) MarshalCORK() (dst []byte, err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *All) UnmarshalCORK(src []byte) (err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this All) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte("*"), err
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2016-11-04 11:34:48 +00:00
|
|
|
// ANY
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Any{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Any) ExtendCORK() byte {
|
|
|
|
return 0x02
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Any) MarshalCORK() (dst []byte, err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Any) UnmarshalCORK(src []byte) (err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Any) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte("?"), err
|
|
|
|
}
|
|
|
|
|
2017-12-12 01:09:08 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// NULL
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Null{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Null) ExtendCORK() byte {
|
|
|
|
return 0x05
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Null) MarshalCORK() (dst []byte, err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Null) UnmarshalCORK(src []byte) (err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Null) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte("null"), err
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// VOID
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Void{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Void) ExtendCORK() byte {
|
2017-12-12 01:09:08 +00:00
|
|
|
return 0x06
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Void) MarshalCORK() (dst []byte, err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Void) UnmarshalCORK(src []byte) (err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Void) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte("~VOID~"), err
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// EMPTY
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Empty{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Empty) ExtendCORK() byte {
|
2017-12-12 01:09:08 +00:00
|
|
|
return 0x07
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Empty) MarshalCORK() (dst []byte, err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Empty) UnmarshalCORK(src []byte) (err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Empty) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte("~EMPTY~"), err
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// FIELD
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Field{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Field) ExtendCORK() byte {
|
2017-12-12 01:09:08 +00:00
|
|
|
return 0x08
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Field) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
w.EncodeString(this.Field)
|
|
|
|
w.EncodeString(this.Alias)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Field) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
|
|
|
r.DecodeString(&this.Field)
|
|
|
|
r.DecodeString(&this.Alias)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// GROUP
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Group{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Group) ExtendCORK() byte {
|
2017-12-12 01:09:08 +00:00
|
|
|
return 0x09
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Group) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Group) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// ORDER
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Order{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Order) ExtendCORK() byte {
|
2017-12-12 01:09:08 +00:00
|
|
|
return 0x10
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Order) MarshalCORK(w *cork.Writer) (dst []byte, err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
w.EncodeAny(this.Dir)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Order) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
|
|
|
r.DecodeAny(&this.Dir)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// SubExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&SubExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *SubExpression) ExtendCORK() byte {
|
|
|
|
return 0x21
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *SubExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *SubExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-03-18 21:01:29 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// MultExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&MultExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *MultExpression) ExtendCORK() byte {
|
|
|
|
return 0x22
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *MultExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *MultExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// IfelExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&IfelExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *IfelExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x23
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *IfelExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Cond)
|
|
|
|
w.EncodeAny(this.Then)
|
|
|
|
w.EncodeAny(this.Else)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *IfelExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Cond)
|
|
|
|
r.DecodeAny(&this.Then)
|
|
|
|
r.DecodeAny(&this.Else)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// FuncExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&FuncExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *FuncExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x24
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *FuncExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.Name)
|
|
|
|
w.EncodeAny(this.Args)
|
|
|
|
w.EncodeBool(this.Aggr)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *FuncExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.Name)
|
|
|
|
r.DecodeAny(&this.Args)
|
|
|
|
r.DecodeBool(&this.Aggr)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2017-03-02 10:47:10 +00:00
|
|
|
// ItemExpression
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2017-03-02 10:47:10 +00:00
|
|
|
cork.Register(&ItemExpression{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-03-02 10:47:10 +00:00
|
|
|
func (this *ItemExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x25
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *ItemExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.LHS)
|
|
|
|
w.EncodeAny(this.Op)
|
|
|
|
w.EncodeAny(this.RHS)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *ItemExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.LHS)
|
|
|
|
r.DecodeAny(&this.Op)
|
|
|
|
r.DecodeAny(&this.RHS)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// BinaryExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&BinaryExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *BinaryExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x26
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *BinaryExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.LHS)
|
|
|
|
w.EncodeAny(this.Op)
|
|
|
|
w.EncodeAny(this.RHS)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *BinaryExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.LHS)
|
|
|
|
r.DecodeAny(&this.Op)
|
|
|
|
r.DecodeAny(&this.RHS)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// PathExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&PathExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *PathExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x27
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *PathExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *PathExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// PartExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&PartExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *PartExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x28
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *PartExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Part)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *PartExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Part)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// JoinExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&JoinExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *JoinExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x29
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *JoinExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Join)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *JoinExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Join)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// SubpExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&SubpExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *SubpExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x30
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *SubpExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeAny(this.Cond)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *SubpExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.What)
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeAny(&this.Cond)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-03-02 10:47:10 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// PermExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&PermExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *PermExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x31
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *PermExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Select)
|
|
|
|
w.EncodeAny(this.Create)
|
|
|
|
w.EncodeAny(this.Update)
|
|
|
|
w.EncodeAny(this.Delete)
|
|
|
|
return
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *PermExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Select)
|
|
|
|
r.DecodeAny(&this.Create)
|
|
|
|
r.DecodeAny(&this.Update)
|
|
|
|
r.DecodeAny(&this.Delete)
|
2017-03-02 10:47:10 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// DataExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&DataExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *DataExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x32
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DataExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
return
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DataExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Data)
|
2017-03-02 10:47:10 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// DiffExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&DiffExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *DiffExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x33
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DiffExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DiffExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Data)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// MergeExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&MergeExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *MergeExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x34
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *MergeExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *MergeExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Data)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// ContentExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&ContentExpression{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *ContentExpression) ExtendCORK() byte {
|
2018-03-18 21:01:29 +00:00
|
|
|
return 0x35
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *ContentExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *ContentExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Data)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
|
2017-11-27 11:16:29 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// Model
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Model{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Model) ExtendCORK() byte {
|
|
|
|
return 0x51
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Model) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.TB)
|
|
|
|
w.EncodeFloat64(this.MIN)
|
|
|
|
w.EncodeFloat64(this.INC)
|
|
|
|
w.EncodeFloat64(this.MAX)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Model) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.TB)
|
|
|
|
r.DecodeFloat64(&this.MIN)
|
|
|
|
r.DecodeFloat64(&this.INC)
|
|
|
|
r.DecodeFloat64(&this.MAX)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Model) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte(this.String()), err
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
2017-03-02 10:47:10 +00:00
|
|
|
// Param
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2017-03-02 10:47:10 +00:00
|
|
|
cork.Register(&Param{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-03-02 10:47:10 +00:00
|
|
|
func (this *Param) ExtendCORK() byte {
|
2017-11-27 11:16:29 +00:00
|
|
|
return 0x52
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Param) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.ID)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Param) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.ID)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-03-02 10:47:10 +00:00
|
|
|
func (this Param) MarshalText() (data []byte, err error) {
|
2016-11-04 10:01:19 +00:00
|
|
|
return []byte("ID:" + this.ID), err
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2017-03-02 10:47:10 +00:00
|
|
|
// Value
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2017-03-02 10:47:10 +00:00
|
|
|
cork.Register(&Value{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-03-02 10:47:10 +00:00
|
|
|
func (this *Value) ExtendCORK() byte {
|
2017-11-27 11:16:29 +00:00
|
|
|
return 0x53
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Value) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.ID)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Value) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.ID)
|
2017-03-02 10:47:10 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Value) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte(this.ID), err
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// Ident
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Ident{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Ident) ExtendCORK() byte {
|
2017-11-27 11:16:29 +00:00
|
|
|
return 0x54
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Ident) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.ID)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Ident) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.ID)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-03-02 10:47:10 +00:00
|
|
|
func (this Ident) MarshalText() (data []byte, err error) {
|
2016-11-04 10:01:19 +00:00
|
|
|
return []byte("ID:" + this.ID), err
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// Table
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Table{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Table) ExtendCORK() byte {
|
2017-11-27 11:16:29 +00:00
|
|
|
return 0x55
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Table) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.TB)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Table) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.TB)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Table) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte("TB:" + this.TB), err
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// Batch
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Batch{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Batch) ExtendCORK() byte {
|
2017-11-27 11:16:29 +00:00
|
|
|
return 0x56
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Batch) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.BA)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Batch) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.BA)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Batch) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte(this.String()), err
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// Thing
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Thing{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Thing) Bytes() []byte {
|
|
|
|
return []byte(this.String())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Thing) ExtendCORK() byte {
|
2017-11-27 11:16:29 +00:00
|
|
|
return 0x57
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Thing) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.TB)
|
|
|
|
w.EncodeAny(this.ID)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *Thing) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.TB)
|
|
|
|
r.DecodeAny(&this.ID)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Thing) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte(this.String()), err
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// Point
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Point{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Point) ExtendCORK() byte {
|
2017-11-27 11:16:29 +00:00
|
|
|
return 0x58
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Point) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeFloat64(this.LA)
|
|
|
|
w.EncodeFloat64(this.LO)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Point) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeFloat64(&this.LA)
|
|
|
|
r.DecodeFloat64(&this.LO)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Point) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte(this.String()), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Point) MarshalJSON() (data []byte, err error) {
|
|
|
|
return []byte(this.JSON()), err
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// Circle
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Circle{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Circle) ExtendCORK() byte {
|
2017-11-27 11:16:29 +00:00
|
|
|
return 0x59
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Circle) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.CE)
|
|
|
|
w.EncodeFloat64(this.RA)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Circle) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.CE)
|
|
|
|
r.DecodeFloat64(&this.RA)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Circle) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte(this.String()), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Circle) MarshalJSON() (data []byte, err error) {
|
|
|
|
return []byte(this.JSON()), err
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// Polygon
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Polygon{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Polygon) ExtendCORK() byte {
|
2017-11-27 11:16:29 +00:00
|
|
|
return 0x60
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Polygon) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.PS)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Polygon) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.PS)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Polygon) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte(this.String()), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this Polygon) MarshalJSON() (data []byte, err error) {
|
|
|
|
return []byte(this.JSON()), err
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
// ##################################################
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2017-11-24 12:47:59 +00:00
|
|
|
// IfStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&IfStatement{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *IfStatement) Decode(src []byte) {
|
|
|
|
pack.Decode(src, this)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *IfStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *IfStatement) ExtendCORK() byte {
|
|
|
|
return 0x71
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *IfStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Cond)
|
|
|
|
w.EncodeAny(this.Then)
|
|
|
|
w.EncodeAny(this.Else)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *IfStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Cond)
|
|
|
|
r.DecodeAny(&this.Then)
|
|
|
|
r.DecodeAny(&this.Else)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2016-11-04 10:01:19 +00:00
|
|
|
// LiveStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&LiveStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *LiveStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *LiveStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
func (this *LiveStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x72
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *LiveStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.FB)
|
|
|
|
w.EncodeString(this.ID)
|
|
|
|
w.EncodeBool(this.Diff)
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
w.EncodeAny(this.Cond)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *LiveStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.FB)
|
|
|
|
r.DecodeString(&this.ID)
|
|
|
|
r.DecodeBool(&this.Diff)
|
|
|
|
r.DecodeAny(&this.Expr)
|
|
|
|
r.DecodeAny(&this.What)
|
|
|
|
r.DecodeAny(&this.Cond)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// SelectStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&SelectStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *SelectStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *SelectStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
func (this *SelectStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x73
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *SelectStatement) MarshalCORK(w *cork.Writer) (err error) {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
w.EncodeBool(this.RW)
|
2017-11-16 20:53:13 +00:00
|
|
|
w.EncodeString(this.KV)
|
|
|
|
w.EncodeString(this.NS)
|
|
|
|
w.EncodeString(this.DB)
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
w.EncodeAny(this.Cond)
|
|
|
|
w.EncodeAny(this.Group)
|
|
|
|
w.EncodeAny(this.Order)
|
|
|
|
w.EncodeAny(this.Limit)
|
|
|
|
w.EncodeAny(this.Start)
|
|
|
|
w.EncodeAny(this.Version)
|
|
|
|
w.EncodeAny(this.Timeout)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *SelectStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
r.DecodeBool(&this.RW)
|
2017-11-16 20:53:13 +00:00
|
|
|
r.DecodeString(&this.KV)
|
|
|
|
r.DecodeString(&this.NS)
|
|
|
|
r.DecodeString(&this.DB)
|
|
|
|
r.DecodeAny(&this.Expr)
|
|
|
|
r.DecodeAny(&this.What)
|
|
|
|
r.DecodeAny(&this.Cond)
|
|
|
|
r.DecodeAny(&this.Group)
|
|
|
|
r.DecodeAny(&this.Order)
|
|
|
|
r.DecodeAny(&this.Limit)
|
|
|
|
r.DecodeAny(&this.Start)
|
|
|
|
r.DecodeAny(&this.Version)
|
|
|
|
r.DecodeAny(&this.Timeout)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// CreateStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&CreateStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *CreateStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *CreateStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
func (this *CreateStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x74
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *CreateStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.KV)
|
|
|
|
w.EncodeString(this.NS)
|
|
|
|
w.EncodeString(this.DB)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
w.EncodeAny(this.Echo)
|
|
|
|
w.EncodeAny(this.Timeout)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *CreateStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.KV)
|
|
|
|
r.DecodeString(&this.NS)
|
|
|
|
r.DecodeString(&this.DB)
|
|
|
|
r.DecodeAny(&this.What)
|
|
|
|
r.DecodeAny(&this.Data)
|
|
|
|
r.DecodeAny(&this.Echo)
|
|
|
|
r.DecodeAny(&this.Timeout)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// UpdateStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&UpdateStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *UpdateStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *UpdateStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
func (this *UpdateStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x75
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *UpdateStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.KV)
|
|
|
|
w.EncodeString(this.NS)
|
|
|
|
w.EncodeString(this.DB)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
w.EncodeAny(this.Cond)
|
|
|
|
w.EncodeAny(this.Echo)
|
|
|
|
w.EncodeAny(this.Timeout)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *UpdateStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.KV)
|
|
|
|
r.DecodeString(&this.NS)
|
|
|
|
r.DecodeString(&this.DB)
|
|
|
|
r.DecodeAny(&this.What)
|
|
|
|
r.DecodeAny(&this.Data)
|
|
|
|
r.DecodeAny(&this.Cond)
|
|
|
|
r.DecodeAny(&this.Echo)
|
|
|
|
r.DecodeAny(&this.Timeout)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// DeleteStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&DeleteStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *DeleteStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *DeleteStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
func (this *DeleteStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x76
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DeleteStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.KV)
|
|
|
|
w.EncodeString(this.NS)
|
|
|
|
w.EncodeString(this.DB)
|
|
|
|
w.EncodeBool(this.Hard)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
w.EncodeAny(this.Cond)
|
|
|
|
w.EncodeAny(this.Echo)
|
|
|
|
w.EncodeAny(this.Timeout)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DeleteStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.KV)
|
|
|
|
r.DecodeString(&this.NS)
|
|
|
|
r.DecodeString(&this.DB)
|
|
|
|
r.DecodeBool(&this.Hard)
|
|
|
|
r.DecodeAny(&this.What)
|
|
|
|
r.DecodeAny(&this.Cond)
|
|
|
|
r.DecodeAny(&this.Echo)
|
|
|
|
r.DecodeAny(&this.Timeout)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// RelateStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&RelateStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *RelateStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RelateStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
func (this *RelateStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x77
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RelateStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.KV)
|
|
|
|
w.EncodeString(this.NS)
|
|
|
|
w.EncodeString(this.DB)
|
|
|
|
w.EncodeAny(this.Type)
|
|
|
|
w.EncodeAny(this.From)
|
|
|
|
w.EncodeAny(this.With)
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
w.EncodeBool(this.Uniq)
|
|
|
|
w.EncodeAny(this.Echo)
|
|
|
|
w.EncodeAny(this.Timeout)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RelateStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.KV)
|
|
|
|
r.DecodeString(&this.NS)
|
|
|
|
r.DecodeString(&this.DB)
|
|
|
|
r.DecodeAny(&this.Type)
|
|
|
|
r.DecodeAny(&this.From)
|
|
|
|
r.DecodeAny(&this.With)
|
|
|
|
r.DecodeAny(&this.Data)
|
|
|
|
r.DecodeBool(&this.Uniq)
|
|
|
|
r.DecodeAny(&this.Echo)
|
|
|
|
r.DecodeAny(&this.Timeout)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// InsertStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&InsertStatement{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *InsertStatement) Decode(src []byte) {
|
|
|
|
pack.Decode(src, this)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *InsertStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *InsertStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x78
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *InsertStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.KV)
|
|
|
|
w.EncodeString(this.NS)
|
|
|
|
w.EncodeString(this.DB)
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
w.EncodeAny(this.Into)
|
|
|
|
w.EncodeAny(this.Echo)
|
|
|
|
w.EncodeAny(this.Timeout)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *InsertStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.KV)
|
|
|
|
r.DecodeString(&this.NS)
|
|
|
|
r.DecodeString(&this.DB)
|
|
|
|
r.DecodeAny(&this.Data)
|
|
|
|
r.DecodeAny(&this.Into)
|
|
|
|
r.DecodeAny(&this.Echo)
|
|
|
|
r.DecodeAny(&this.Timeout)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// UpsertStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&UpsertStatement{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *UpsertStatement) Decode(src []byte) {
|
|
|
|
pack.Decode(src, this)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *UpsertStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *UpsertStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x79
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *UpsertStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.KV)
|
|
|
|
w.EncodeString(this.NS)
|
|
|
|
w.EncodeString(this.DB)
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
w.EncodeAny(this.Into)
|
|
|
|
w.EncodeAny(this.Echo)
|
|
|
|
w.EncodeAny(this.Timeout)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *UpsertStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.KV)
|
|
|
|
r.DecodeString(&this.NS)
|
|
|
|
r.DecodeString(&this.DB)
|
|
|
|
r.DecodeAny(&this.Data)
|
|
|
|
r.DecodeAny(&this.Into)
|
|
|
|
r.DecodeAny(&this.Echo)
|
|
|
|
r.DecodeAny(&this.Timeout)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-04 11:29:08 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// DefineNamespaceStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&DefineNamespaceStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *DefineNamespaceStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *DefineNamespaceStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 11:29:08 +00:00
|
|
|
func (this *DefineNamespaceStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x80
|
2016-11-04 11:29:08 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineNamespaceStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
return
|
2016-11-04 11:29:08 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineNamespaceStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
2016-11-04 11:29:08 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// RemoveNamespaceStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&RemoveNamespaceStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *RemoveNamespaceStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RemoveNamespaceStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 11:29:08 +00:00
|
|
|
func (this *RemoveNamespaceStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x81
|
2016-11-04 11:29:08 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveNamespaceStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
return
|
2016-11-04 11:29:08 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveNamespaceStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
2016-11-04 11:29:08 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-04 11:34:37 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// DefineDatabaseStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&DefineDatabaseStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *DefineDatabaseStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *DefineDatabaseStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 11:34:37 +00:00
|
|
|
func (this *DefineDatabaseStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x82
|
2016-11-04 11:34:37 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineDatabaseStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
return
|
2016-11-04 11:34:37 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineDatabaseStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
2016-11-04 11:34:37 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// RemoveDatabaseStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&RemoveDatabaseStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *RemoveDatabaseStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RemoveDatabaseStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 11:34:37 +00:00
|
|
|
func (this *RemoveDatabaseStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x83
|
2016-11-04 11:34:37 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveDatabaseStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
return
|
2016-11-04 11:34:37 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveDatabaseStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
2016-11-04 11:34:37 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-16 22:43:36 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// DefineLoginStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&DefineLoginStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *DefineLoginStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *DefineLoginStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-16 22:43:36 +00:00
|
|
|
func (this *DefineLoginStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x84
|
2016-11-16 22:43:36 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineLoginStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Kind)
|
|
|
|
w.EncodeAny(this.User)
|
|
|
|
w.EncodeBytes(this.Pass)
|
|
|
|
w.EncodeBytes(this.Code)
|
|
|
|
return
|
2016-11-16 22:43:36 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineLoginStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Kind)
|
|
|
|
r.DecodeAny(&this.User)
|
|
|
|
r.DecodeBytes(&this.Pass)
|
|
|
|
r.DecodeBytes(&this.Code)
|
2016-11-16 22:43:36 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// RemoveLoginStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&RemoveLoginStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *RemoveLoginStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RemoveLoginStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-16 22:43:36 +00:00
|
|
|
func (this *RemoveLoginStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x85
|
2016-11-16 22:43:36 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveLoginStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Kind)
|
|
|
|
w.EncodeAny(this.User)
|
|
|
|
return
|
2016-11-16 22:43:36 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveLoginStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Kind)
|
|
|
|
r.DecodeAny(&this.User)
|
2016-11-16 22:43:36 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-16 22:47:23 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// DefineTokenStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&DefineTokenStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *DefineTokenStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *DefineTokenStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-16 22:47:23 +00:00
|
|
|
func (this *DefineTokenStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x86
|
2016-11-16 22:47:23 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineTokenStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Kind)
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeAny(this.Type)
|
|
|
|
w.EncodeBytes(this.Code)
|
|
|
|
return
|
2016-11-16 22:47:23 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineTokenStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Kind)
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeAny(&this.Type)
|
|
|
|
r.DecodeBytes(&this.Code)
|
2016-11-16 22:47:23 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// RemoveTokenStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&RemoveTokenStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *RemoveTokenStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RemoveTokenStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-16 22:47:23 +00:00
|
|
|
func (this *RemoveTokenStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x87
|
2016-11-16 22:47:23 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveTokenStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Kind)
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
return
|
2016-11-16 22:47:23 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveTokenStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Kind)
|
|
|
|
r.DecodeAny(&this.Name)
|
2016-11-16 22:47:23 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// DefineScopeStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&DefineScopeStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *DefineScopeStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *DefineScopeStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
func (this *DefineScopeStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x88
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineScopeStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeAny(this.Time)
|
|
|
|
w.EncodeBytes(this.Code)
|
|
|
|
w.EncodeAny(this.Signup)
|
|
|
|
w.EncodeAny(this.Signin)
|
|
|
|
w.EncodeAny(this.Connect)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineScopeStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeAny(&this.Time)
|
|
|
|
r.DecodeBytes(&this.Code)
|
|
|
|
r.DecodeAny(&this.Signup)
|
|
|
|
r.DecodeAny(&this.Signin)
|
|
|
|
r.DecodeAny(&this.Connect)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// RemoveScopeStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&RemoveScopeStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *RemoveScopeStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RemoveScopeStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
func (this *RemoveScopeStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x89
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveScopeStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveScopeStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// DefineTableStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&DefineTableStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *DefineTableStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *DefineTableStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
func (this *DefineTableStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x90
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineTableStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeBool(this.Full)
|
|
|
|
w.EncodeBool(this.Drop)
|
|
|
|
w.EncodeBool(this.Lock)
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
w.EncodeAny(this.From)
|
|
|
|
w.EncodeAny(this.Cond)
|
|
|
|
w.EncodeAny(this.Group)
|
|
|
|
w.EncodeAny(this.Perms)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineTableStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeBool(&this.Full)
|
|
|
|
r.DecodeBool(&this.Drop)
|
|
|
|
r.DecodeBool(&this.Lock)
|
|
|
|
r.DecodeAny(&this.Expr)
|
|
|
|
r.DecodeAny(&this.From)
|
|
|
|
r.DecodeAny(&this.Cond)
|
|
|
|
r.DecodeAny(&this.Group)
|
|
|
|
r.DecodeAny(&this.Perms)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// RemoveTableStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&RemoveTableStatement{})
|
|
|
|
}
|
|
|
|
|
2017-02-09 20:44:54 +00:00
|
|
|
func (this *RemoveTableStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RemoveTableStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
func (this *RemoveTableStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x91
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveTableStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveTableStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.What)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2017-11-16 20:53:13 +00:00
|
|
|
// DefineEventStatement
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2017-11-16 20:53:13 +00:00
|
|
|
cork.Register(&DefineEventStatement{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineEventStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineEventStatement) Encode() (dst []byte) {
|
2017-02-09 20:44:54 +00:00
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineEventStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x92
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineEventStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
w.EncodeAny(this.When)
|
|
|
|
w.EncodeAny(this.Then)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *DefineEventStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeAny(&this.What)
|
|
|
|
r.DecodeAny(&this.When)
|
|
|
|
r.DecodeAny(&this.Then)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2017-11-16 20:53:13 +00:00
|
|
|
// RemoveEventStatement
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2017-11-16 20:53:13 +00:00
|
|
|
cork.Register(&RemoveEventStatement{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveEventStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveEventStatement) Encode() (dst []byte) {
|
2017-02-09 20:44:54 +00:00
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveEventStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x93
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveEventStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveEventStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeAny(&this.What)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2017-11-16 20:53:13 +00:00
|
|
|
// DefineFieldStatement
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2017-11-16 20:53:13 +00:00
|
|
|
cork.Register(&DefineFieldStatement{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineFieldStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineFieldStatement) Encode() (dst []byte) {
|
2017-02-09 20:44:54 +00:00
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineFieldStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x94
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineFieldStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
w.EncodeString(this.Type)
|
|
|
|
w.EncodeString(this.Kind)
|
|
|
|
w.EncodeAny(this.Perms)
|
|
|
|
w.EncodeAny(this.Value)
|
|
|
|
w.EncodeAny(this.Assert)
|
2017-12-05 01:56:33 +00:00
|
|
|
w.EncodeFloat64(this.Priority)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineFieldStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeAny(&this.What)
|
|
|
|
r.DecodeString(&this.Type)
|
|
|
|
r.DecodeString(&this.Kind)
|
|
|
|
r.DecodeAny(&this.Perms)
|
|
|
|
r.DecodeAny(&this.Value)
|
|
|
|
r.DecodeAny(&this.Assert)
|
2017-12-05 01:56:33 +00:00
|
|
|
r.DecodeFloat64(&this.Priority)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2017-11-16 20:53:13 +00:00
|
|
|
// RemoveFieldStatement
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2017-11-16 20:53:13 +00:00
|
|
|
cork.Register(&RemoveFieldStatement{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveFieldStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveFieldStatement) Encode() (dst []byte) {
|
2017-02-09 20:44:54 +00:00
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveFieldStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x95
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveFieldStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveFieldStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeAny(&this.What)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2017-11-16 20:53:13 +00:00
|
|
|
// DefineIndexStatement
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2017-11-16 20:53:13 +00:00
|
|
|
cork.Register(&DefineIndexStatement{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineIndexStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineIndexStatement) Encode() (dst []byte) {
|
2017-02-09 20:44:54 +00:00
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineIndexStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x96
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineIndexStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
w.EncodeAny(this.Cols)
|
|
|
|
w.EncodeBool(this.Uniq)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *DefineIndexStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeAny(&this.What)
|
|
|
|
r.DecodeAny(&this.Cols)
|
|
|
|
r.DecodeBool(&this.Uniq)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2017-11-16 20:53:13 +00:00
|
|
|
// RemoveIndexStatement
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2017-11-16 20:53:13 +00:00
|
|
|
cork.Register(&RemoveIndexStatement{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveIndexStatement) Decode(src []byte) {
|
2017-02-10 19:28:02 +00:00
|
|
|
pack.Decode(src, this)
|
2017-02-09 20:44:54 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveIndexStatement) Encode() (dst []byte) {
|
2017-02-09 20:44:54 +00:00
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveIndexStatement) ExtendCORK() byte {
|
Improve statement read/write status detection
Only store read-write statement status in the database for statements which can be either read or write. For those statements which are always write statements (Live, Kill, Create, Update, Delete, Relate, Insert, Upsert, Define, Remove….), then hardcode this on the statement itself.
2017-11-24 12:50:31 +00:00
|
|
|
return 0x97
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveIndexStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
func (this *RemoveIndexStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeAny(&this.What)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|