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
|
|
|
)
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func decode(src []byte, dst interface{}) {
|
|
|
|
pack.Decode(src, dst)
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func encode(src interface{}) (dst []byte) {
|
|
|
|
return pack.Encode(src)
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// ALL
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&All{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *All) ExtendCORK() byte {
|
|
|
|
return 0x01
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *All) MarshalCORK(w *cork.Writer) (err error) {
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *All) UnmarshalCORK(r *cork.Reader) (err error) {
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
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
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Any) MarshalCORK(w *cork.Writer) (err error) {
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Any) UnmarshalCORK(r *cork.Reader) (err error) {
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-12-12 01:09:08 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// NULL
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Null{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Null) ExtendCORK() byte {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x03
|
2017-12-12 01:09:08 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Null) MarshalCORK(w *cork.Writer) (err error) {
|
2017-12-12 01:09:08 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Null) UnmarshalCORK(r *cork.Reader) (err error) {
|
2017-12-12 01:09:08 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// VOID
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Void{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Void) ExtendCORK() byte {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x04
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Void) MarshalCORK(w *cork.Writer) (err error) {
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Void) UnmarshalCORK(r *cork.Reader) (err error) {
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// EMPTY
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Empty{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Empty) ExtendCORK() byte {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x05
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Empty) MarshalCORK(w *cork.Writer) (err error) {
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Empty) UnmarshalCORK(r *cork.Reader) (err error) {
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// FIELD
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Field{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Field) ExtendCORK() byte {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x06
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x07
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x08
|
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
|
|
|
|
}
|
|
|
|
|
2018-04-21 10:32:13 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// FETCH
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&Fetch{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Fetch) ExtendCORK() byte {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x09
|
2018-04-21 10:32:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Fetch) MarshalCORK(w *cork.Writer) (dst []byte, err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Fetch) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Param
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Param{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Param) ExtendCORK() byte {
|
|
|
|
return 0x10
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Param) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.VA)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Param) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.VA)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-03-18 21:01:29 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Ident
|
2018-03-18 21:01:29 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Ident{})
|
2018-03-18 21:01:29 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Ident) ExtendCORK() byte {
|
|
|
|
return 0x11
|
2018-03-18 21:01:29 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Ident) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.VA)
|
2018-03-18 21:01:29 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Ident) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.VA)
|
2018-03-18 21:01:29 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Value
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Value{})
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Value) ExtendCORK() byte {
|
|
|
|
return 0x12
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Value) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.VA)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Value) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.VA)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Regex
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Regex{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Regex) ExtendCORK() byte {
|
|
|
|
return 0x13
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Regex) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.VA)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Regex) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.VA)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Table
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Table{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Table) ExtendCORK() byte {
|
|
|
|
return 0x14
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Table) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.TB)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Table) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.TB)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Batch
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Batch{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Batch) ExtendCORK() byte {
|
|
|
|
return 0x15
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Batch) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.BA)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Batch) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.BA)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Model
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Model{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Model) ExtendCORK() byte {
|
|
|
|
return 0x16
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
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)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
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)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Thing
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Thing{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this Thing) Bytes() []byte {
|
|
|
|
return []byte(this.String())
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Thing) ExtendCORK() byte {
|
|
|
|
return 0x17
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Thing) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.TB)
|
|
|
|
w.EncodeAny(this.ID)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +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
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this Thing) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte(this.String()), err
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Point
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Point{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Point) ExtendCORK() byte {
|
|
|
|
return 0x18
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Point) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeFloat64(this.LA)
|
|
|
|
w.EncodeFloat64(this.LO)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Point) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeFloat64(&this.LA)
|
|
|
|
r.DecodeFloat64(&this.LO)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Circle
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Circle{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Circle) ExtendCORK() byte {
|
|
|
|
return 0x19
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Circle) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.CE)
|
|
|
|
w.EncodeFloat64(this.RA)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Circle) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.CE)
|
|
|
|
r.DecodeFloat64(&this.RA)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2017-03-02 10:47:10 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// Polygon
|
2017-03-02 10:47:10 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&Polygon{})
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Polygon) ExtendCORK() byte {
|
|
|
|
return 0x20
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Polygon) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.PS)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *Polygon) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.PS)
|
2017-03-02 10:47:10 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this Polygon) MarshalText() (data []byte, err error) {
|
|
|
|
return []byte(this.String()), err
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this Polygon) MarshalJSON() (data []byte, err error) {
|
|
|
|
return []byte(this.JSON()), err
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// SubExpression
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&SubExpression{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *SubExpression) ExtendCORK() byte {
|
|
|
|
return 0x21
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *SubExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *SubExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// MultExpression
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&MultExpression{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *MultExpression) ExtendCORK() byte {
|
|
|
|
return 0x22
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *MultExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *MultExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// IfelExpression
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&IfelExpression{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *IfelExpression) ExtendCORK() byte {
|
|
|
|
return 0x23
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *IfelExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Cond)
|
|
|
|
w.EncodeAny(this.Then)
|
|
|
|
w.EncodeAny(this.Else)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2017-11-27 11:16:29 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// FuncExpression
|
2017-11-27 11:16:29 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&FuncExpression{})
|
2017-11-27 11:16:29 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *FuncExpression) ExtendCORK() byte {
|
|
|
|
return 0x24
|
2017-11-27 11:16:29 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *FuncExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeString(this.Name)
|
|
|
|
w.EncodeAny(this.Args)
|
|
|
|
w.EncodeBool(this.Aggr)
|
2017-11-27 11:16:29 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *FuncExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeString(&this.Name)
|
|
|
|
r.DecodeAny(&this.Args)
|
|
|
|
r.DecodeBool(&this.Aggr)
|
2017-11-27 11:16:29 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// ItemExpression
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&ItemExpression{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *ItemExpression) ExtendCORK() byte {
|
|
|
|
return 0x25
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *ItemExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.LHS)
|
|
|
|
w.EncodeAny(this.Op)
|
|
|
|
w.EncodeAny(this.RHS)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +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
|
|
|
|
}
|
|
|
|
|
2018-04-14 20:56:29 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// BinaryExpression
|
2018-04-14 20:56:29 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&BinaryExpression{})
|
2018-04-14 20:56:29 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *BinaryExpression) ExtendCORK() byte {
|
|
|
|
return 0x26
|
2018-04-14 20:56:29 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *BinaryExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.LHS)
|
|
|
|
w.EncodeAny(this.Op)
|
|
|
|
w.EncodeAny(this.RHS)
|
2018-04-14 20:56:29 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *BinaryExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.LHS)
|
|
|
|
r.DecodeAny(&this.Op)
|
|
|
|
r.DecodeAny(&this.RHS)
|
2018-04-14 20:56:29 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// PathExpression
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&PathExpression{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *PathExpression) ExtendCORK() byte {
|
|
|
|
return 0x27
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *PathExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *PathExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
2017-03-02 10:47:10 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// PartExpression
|
2017-03-02 10:47:10 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&PartExpression{})
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *PartExpression) ExtendCORK() byte {
|
|
|
|
return 0x28
|
2017-03-02 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *PartExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Part)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *PartExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Part)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// JoinExpression
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&JoinExpression{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *JoinExpression) ExtendCORK() byte {
|
|
|
|
return 0x29
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *JoinExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Join)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *JoinExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Join)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// SubpExpression
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&SubpExpression{})
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *SubpExpression) ExtendCORK() byte {
|
|
|
|
return 0x30
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *SubpExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.What)
|
|
|
|
w.EncodeAny(this.Name)
|
|
|
|
w.EncodeAny(this.Cond)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *SubpExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.What)
|
|
|
|
r.DecodeAny(&this.Name)
|
|
|
|
r.DecodeAny(&this.Cond)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// PermExpression
|
2016-11-04 10:01:19 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&PermExpression{})
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *PermExpression) ExtendCORK() byte {
|
|
|
|
return 0x31
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +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)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
2016-11-04 10:01:19 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +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)
|
2016-11-04 10:01:19 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// DataExpression
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&DataExpression{})
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *DataExpression) ExtendCORK() byte {
|
|
|
|
return 0x32
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *DataExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Data)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *DataExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Data)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// DiffExpression
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&DiffExpression{})
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *DiffExpression) ExtendCORK() byte {
|
|
|
|
return 0x33
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *DiffExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
return
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *DiffExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Data)
|
|
|
|
return
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
2018-08-10 18:34:16 +00:00
|
|
|
// MergeExpression
|
2017-11-16 20:53:13 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
2018-08-10 18:34:16 +00:00
|
|
|
cork.Register(&MergeExpression{})
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *MergeExpression) ExtendCORK() byte {
|
|
|
|
return 0x34
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *MergeExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Data)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *MergeExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Data)
|
2017-11-16 20:53:13 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// ContentExpression
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&ContentExpression{})
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *ContentExpression) ExtendCORK() byte {
|
|
|
|
return 0x35
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *ContentExpression) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Data)
|
|
|
|
return
|
2017-11-16 20:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-08-10 18:34:16 +00:00
|
|
|
func (this *ContentExpression) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Data)
|
|
|
|
return
|
|
|
|
}
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x36
|
2017-11-24 12:47:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2018-04-14 16:55:05 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// RunStatement
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cork.Register(&RunStatement{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RunStatement) Decode(src []byte) {
|
|
|
|
pack.Decode(src, this)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RunStatement) Encode() (dst []byte) {
|
|
|
|
return pack.Encode(this)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RunStatement) ExtendCORK() byte {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x37
|
2018-04-14 16:55:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RunStatement) MarshalCORK(w *cork.Writer) (err error) {
|
|
|
|
w.EncodeAny(this.Expr)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *RunStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
|
|
|
r.DecodeAny(&this.Expr)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-11-24 12:47:59 +00:00
|
|
|
// --------------------------------------------------
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x38
|
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)
|
2018-04-24 22:57:23 +00:00
|
|
|
w.EncodeAny(this.Fetch)
|
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 *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)
|
2018-04-24 22:57:23 +00:00
|
|
|
r.DecodeAny(&this.Fetch)
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x39
|
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)
|
2018-04-24 22:57:23 +00:00
|
|
|
w.EncodeAny(this.Fetch)
|
2017-11-16 20:53:13 +00:00
|
|
|
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)
|
2018-04-24 22:57:23 +00:00
|
|
|
r.DecodeAny(&this.Fetch)
|
2017-11-16 20:53:13 +00:00
|
|
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x40
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x41
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x42
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x43
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x44
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x45
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x46
|
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
|
|
|
|
}
|
|
|
|
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x47
|
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
|
|
|
|
}
|
|
|
|
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x48
|
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
|
|
|
|
}
|
|
|
|
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x49
|
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)
|
2018-09-13 15:35:06 +00:00
|
|
|
w.EncodeAny(this.What)
|
2017-11-16 20:53:13 +00:00
|
|
|
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)
|
2018-09-13 15:35:06 +00:00
|
|
|
r.DecodeAny(&this.What)
|
2017-11-16 20:53:13 +00:00
|
|
|
r.DecodeAny(&this.Type)
|
|
|
|
r.DecodeBytes(&this.Code)
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x50
|
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)
|
2018-03-18 21:30:02 +00:00
|
|
|
w.EncodeAny(this.OnSignup)
|
|
|
|
w.EncodeAny(this.OnSignin)
|
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 *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)
|
2018-03-18 21:30:02 +00:00
|
|
|
r.DecodeAny(&this.OnSignup)
|
|
|
|
r.DecodeAny(&this.OnSignin)
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x51
|
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)
|
2018-08-10 18:34:16 +00:00
|
|
|
w.EncodeBool(this.Vers)
|
2017-11-16 20:53:13 +00:00
|
|
|
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)
|
2018-08-10 18:34:16 +00:00
|
|
|
r.DecodeBool(&this.Vers)
|
2017-11-16 20:53:13 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x52
|
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
|
|
|
// 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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x53
|
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)
|
2018-08-10 18:34:16 +00:00
|
|
|
w.EncodeAny(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)
|
2018-08-10 18:34:16 +00:00
|
|
|
r.DecodeAny(&this.Priority)
|
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 {
|
2018-08-10 18:34:16 +00:00
|
|
|
return 0x54
|
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
|
|
|
|
}
|