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.
This commit is contained in:
parent
8de7424efb
commit
a569ad78d6
25 changed files with 2079 additions and 1635 deletions
3087
sql/ast.gen.go
3087
sql/ast.gen.go
File diff suppressed because it is too large
Load diff
27
sql/ast.go
27
sql/ast.go
|
@ -82,7 +82,6 @@ type UseStatement struct {
|
||||||
|
|
||||||
// InfoStatement represents an SQL INFO statement.
|
// InfoStatement represents an SQL INFO statement.
|
||||||
type InfoStatement struct {
|
type InfoStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -131,7 +130,6 @@ type ReturnStatement struct {
|
||||||
|
|
||||||
// LiveStatement represents a SQL LIVE statement.
|
// LiveStatement represents a SQL LIVE statement.
|
||||||
type LiveStatement struct {
|
type LiveStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
ID string `cork:"ID" codec:"ID"`
|
ID string `cork:"ID" codec:"ID"`
|
||||||
FB string `cork:"FB" codec:"FB"`
|
FB string `cork:"FB" codec:"FB"`
|
||||||
KV string `cork:"KV" codec:"KV"`
|
KV string `cork:"KV" codec:"KV"`
|
||||||
|
@ -145,7 +143,6 @@ type LiveStatement struct {
|
||||||
|
|
||||||
// KillStatement represents a SQL KILL statement.
|
// KillStatement represents a SQL KILL statement.
|
||||||
type KillStatement struct {
|
type KillStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
FB string `cork:"FB" codec:"FB"`
|
FB string `cork:"FB" codec:"FB"`
|
||||||
KV string `cork:"KV" codec:"KV"`
|
KV string `cork:"KV" codec:"KV"`
|
||||||
NS string `cork:"NS" codec:"NS"`
|
NS string `cork:"NS" codec:"NS"`
|
||||||
|
@ -173,7 +170,6 @@ type SelectStatement struct {
|
||||||
|
|
||||||
// CreateStatement represents a SQL CREATE statement.
|
// CreateStatement represents a SQL CREATE statement.
|
||||||
type CreateStatement struct {
|
type CreateStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"KV" codec:"KV"`
|
KV string `cork:"KV" codec:"KV"`
|
||||||
NS string `cork:"NS" codec:"NS"`
|
NS string `cork:"NS" codec:"NS"`
|
||||||
DB string `cork:"DB" codec:"DB"`
|
DB string `cork:"DB" codec:"DB"`
|
||||||
|
@ -186,7 +182,6 @@ type CreateStatement struct {
|
||||||
|
|
||||||
// UpdateStatement represents a SQL UPDATE statement.
|
// UpdateStatement represents a SQL UPDATE statement.
|
||||||
type UpdateStatement struct {
|
type UpdateStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"KV" codec:"KV"`
|
KV string `cork:"KV" codec:"KV"`
|
||||||
NS string `cork:"NS" codec:"NS"`
|
NS string `cork:"NS" codec:"NS"`
|
||||||
DB string `cork:"DB" codec:"DB"`
|
DB string `cork:"DB" codec:"DB"`
|
||||||
|
@ -200,7 +195,6 @@ type UpdateStatement struct {
|
||||||
|
|
||||||
// DeleteStatement represents a SQL DELETE statement.
|
// DeleteStatement represents a SQL DELETE statement.
|
||||||
type DeleteStatement struct {
|
type DeleteStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"KV" codec:"KV"`
|
KV string `cork:"KV" codec:"KV"`
|
||||||
NS string `cork:"NS" codec:"NS"`
|
NS string `cork:"NS" codec:"NS"`
|
||||||
DB string `cork:"DB" codec:"DB"`
|
DB string `cork:"DB" codec:"DB"`
|
||||||
|
@ -214,7 +208,6 @@ type DeleteStatement struct {
|
||||||
|
|
||||||
// RelateStatement represents a SQL RELATE statement.
|
// RelateStatement represents a SQL RELATE statement.
|
||||||
type RelateStatement struct {
|
type RelateStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"KV" codec:"KV"`
|
KV string `cork:"KV" codec:"KV"`
|
||||||
NS string `cork:"NS" codec:"NS"`
|
NS string `cork:"NS" codec:"NS"`
|
||||||
DB string `cork:"DB" codec:"DB"`
|
DB string `cork:"DB" codec:"DB"`
|
||||||
|
@ -230,7 +223,6 @@ type RelateStatement struct {
|
||||||
|
|
||||||
// InsertStatement represents a SQL INSERT statement.
|
// InsertStatement represents a SQL INSERT statement.
|
||||||
type InsertStatement struct {
|
type InsertStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"KV" codec:"KV"`
|
KV string `cork:"KV" codec:"KV"`
|
||||||
NS string `cork:"NS" codec:"NS"`
|
NS string `cork:"NS" codec:"NS"`
|
||||||
DB string `cork:"DB" codec:"DB"`
|
DB string `cork:"DB" codec:"DB"`
|
||||||
|
@ -243,7 +235,6 @@ type InsertStatement struct {
|
||||||
|
|
||||||
// UpsertStatement represents a SQL UPSERT statement.
|
// UpsertStatement represents a SQL UPSERT statement.
|
||||||
type UpsertStatement struct {
|
type UpsertStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"KV" codec:"KV"`
|
KV string `cork:"KV" codec:"KV"`
|
||||||
NS string `cork:"NS" codec:"NS"`
|
NS string `cork:"NS" codec:"NS"`
|
||||||
DB string `cork:"DB" codec:"DB"`
|
DB string `cork:"DB" codec:"DB"`
|
||||||
|
@ -259,7 +250,6 @@ type UpsertStatement struct {
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
type DefineNamespaceStatement struct {
|
type DefineNamespaceStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -267,7 +257,6 @@ type DefineNamespaceStatement struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type RemoveNamespaceStatement struct {
|
type RemoveNamespaceStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -279,7 +268,6 @@ type RemoveNamespaceStatement struct {
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
type DefineDatabaseStatement struct {
|
type DefineDatabaseStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -287,7 +275,6 @@ type DefineDatabaseStatement struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type RemoveDatabaseStatement struct {
|
type RemoveDatabaseStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -300,7 +287,6 @@ type RemoveDatabaseStatement struct {
|
||||||
|
|
||||||
// DefineLoginStatement represents an SQL DEFINE LOGIN statement.
|
// DefineLoginStatement represents an SQL DEFINE LOGIN statement.
|
||||||
type DefineLoginStatement struct {
|
type DefineLoginStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -312,7 +298,6 @@ type DefineLoginStatement struct {
|
||||||
|
|
||||||
// RemoveLoginStatement represents an SQL REMOVE LOGIN statement.
|
// RemoveLoginStatement represents an SQL REMOVE LOGIN statement.
|
||||||
type RemoveLoginStatement struct {
|
type RemoveLoginStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -326,7 +311,6 @@ type RemoveLoginStatement struct {
|
||||||
|
|
||||||
// DefineTokenStatement represents an SQL DEFINE TOKEN statement.
|
// DefineTokenStatement represents an SQL DEFINE TOKEN statement.
|
||||||
type DefineTokenStatement struct {
|
type DefineTokenStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -338,7 +322,6 @@ type DefineTokenStatement struct {
|
||||||
|
|
||||||
// RemoveTokenStatement represents an SQL REMOVE TOKEN statement.
|
// RemoveTokenStatement represents an SQL REMOVE TOKEN statement.
|
||||||
type RemoveTokenStatement struct {
|
type RemoveTokenStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -352,7 +335,6 @@ type RemoveTokenStatement struct {
|
||||||
|
|
||||||
// DefineScopeStatement represents an SQL DEFINE SCOPE statement.
|
// DefineScopeStatement represents an SQL DEFINE SCOPE statement.
|
||||||
type DefineScopeStatement struct {
|
type DefineScopeStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -366,7 +348,6 @@ type DefineScopeStatement struct {
|
||||||
|
|
||||||
// RemoveScopeStatement represents an SQL REMOVE SCOPE statement.
|
// RemoveScopeStatement represents an SQL REMOVE SCOPE statement.
|
||||||
type RemoveScopeStatement struct {
|
type RemoveScopeStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -379,7 +360,6 @@ type RemoveScopeStatement struct {
|
||||||
|
|
||||||
// DefineTableStatement represents an SQL DEFINE TABLE statement.
|
// DefineTableStatement represents an SQL DEFINE TABLE statement.
|
||||||
type DefineTableStatement struct {
|
type DefineTableStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -397,7 +377,6 @@ type DefineTableStatement struct {
|
||||||
|
|
||||||
// RemoveTableStatement represents an SQL REMOVE TABLE statement.
|
// RemoveTableStatement represents an SQL REMOVE TABLE statement.
|
||||||
type RemoveTableStatement struct {
|
type RemoveTableStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -410,7 +389,6 @@ type RemoveTableStatement struct {
|
||||||
|
|
||||||
// DefineEventStatement represents an SQL DEFINE EVENT statement.
|
// DefineEventStatement represents an SQL DEFINE EVENT statement.
|
||||||
type DefineEventStatement struct {
|
type DefineEventStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -422,7 +400,6 @@ type DefineEventStatement struct {
|
||||||
|
|
||||||
// RemoveEventStatement represents an SQL REMOVE EVENT statement.
|
// RemoveEventStatement represents an SQL REMOVE EVENT statement.
|
||||||
type RemoveEventStatement struct {
|
type RemoveEventStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -436,7 +413,6 @@ type RemoveEventStatement struct {
|
||||||
|
|
||||||
// DefineFieldStatement represents an SQL DEFINE FIELD statement.
|
// DefineFieldStatement represents an SQL DEFINE FIELD statement.
|
||||||
type DefineFieldStatement struct {
|
type DefineFieldStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -451,7 +427,6 @@ type DefineFieldStatement struct {
|
||||||
|
|
||||||
// RemoveFieldStatement represents an SQL REMOVE FIELD statement.
|
// RemoveFieldStatement represents an SQL REMOVE FIELD statement.
|
||||||
type RemoveFieldStatement struct {
|
type RemoveFieldStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -465,7 +440,6 @@ type RemoveFieldStatement struct {
|
||||||
|
|
||||||
// DefineIndexStatement represents an SQL DEFINE INDEX statement.
|
// DefineIndexStatement represents an SQL DEFINE INDEX statement.
|
||||||
type DefineIndexStatement struct {
|
type DefineIndexStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
@ -477,7 +451,6 @@ type DefineIndexStatement struct {
|
||||||
|
|
||||||
// RemoveIndexStatement represents an SQL REMOVE INDEX statement.
|
// RemoveIndexStatement represents an SQL REMOVE INDEX statement.
|
||||||
type RemoveIndexStatement struct {
|
type RemoveIndexStatement struct {
|
||||||
RW bool `cork:"-" codec:"-"`
|
|
||||||
KV string `cork:"-" codec:"-"`
|
KV string `cork:"-" codec:"-"`
|
||||||
NS string `cork:"-" codec:"-"`
|
NS string `cork:"-" codec:"-"`
|
||||||
DB string `cork:"-" codec:"-"`
|
DB string `cork:"-" codec:"-"`
|
||||||
|
|
54
sql/cork.go
54
sql/cork.go
|
@ -869,7 +869,7 @@ func (this *LiveStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *LiveStatement) ExtendCORK() byte {
|
func (this *LiveStatement) ExtendCORK() byte {
|
||||||
return 0x71
|
return 0x72
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *LiveStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *LiveStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -909,10 +909,11 @@ func (this *SelectStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *SelectStatement) ExtendCORK() byte {
|
func (this *SelectStatement) ExtendCORK() byte {
|
||||||
return 0x72
|
return 0x73
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *SelectStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *SelectStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
w.EncodeBool(this.RW)
|
||||||
w.EncodeString(this.KV)
|
w.EncodeString(this.KV)
|
||||||
w.EncodeString(this.NS)
|
w.EncodeString(this.NS)
|
||||||
w.EncodeString(this.DB)
|
w.EncodeString(this.DB)
|
||||||
|
@ -929,6 +930,7 @@ func (this *SelectStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *SelectStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
func (this *SelectStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
||||||
|
r.DecodeBool(&this.RW)
|
||||||
r.DecodeString(&this.KV)
|
r.DecodeString(&this.KV)
|
||||||
r.DecodeString(&this.NS)
|
r.DecodeString(&this.NS)
|
||||||
r.DecodeString(&this.DB)
|
r.DecodeString(&this.DB)
|
||||||
|
@ -961,7 +963,7 @@ func (this *CreateStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CreateStatement) ExtendCORK() byte {
|
func (this *CreateStatement) ExtendCORK() byte {
|
||||||
return 0x73
|
return 0x74
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CreateStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *CreateStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1003,7 +1005,7 @@ func (this *UpdateStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *UpdateStatement) ExtendCORK() byte {
|
func (this *UpdateStatement) ExtendCORK() byte {
|
||||||
return 0x74
|
return 0x75
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *UpdateStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *UpdateStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1047,7 +1049,7 @@ func (this *DeleteStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DeleteStatement) ExtendCORK() byte {
|
func (this *DeleteStatement) ExtendCORK() byte {
|
||||||
return 0x75
|
return 0x76
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DeleteStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *DeleteStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1091,7 +1093,7 @@ func (this *RelateStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RelateStatement) ExtendCORK() byte {
|
func (this *RelateStatement) ExtendCORK() byte {
|
||||||
return 0x76
|
return 0x77
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RelateStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *RelateStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1139,7 +1141,7 @@ func (this *InsertStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *InsertStatement) ExtendCORK() byte {
|
func (this *InsertStatement) ExtendCORK() byte {
|
||||||
return 0x77
|
return 0x78
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *InsertStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *InsertStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1181,7 +1183,7 @@ func (this *UpsertStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *UpsertStatement) ExtendCORK() byte {
|
func (this *UpsertStatement) ExtendCORK() byte {
|
||||||
return 0x78
|
return 0x79
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *UpsertStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *UpsertStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1223,7 +1225,7 @@ func (this *DefineNamespaceStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineNamespaceStatement) ExtendCORK() byte {
|
func (this *DefineNamespaceStatement) ExtendCORK() byte {
|
||||||
return 0x79
|
return 0x80
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineNamespaceStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *DefineNamespaceStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1253,7 +1255,7 @@ func (this *RemoveNamespaceStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveNamespaceStatement) ExtendCORK() byte {
|
func (this *RemoveNamespaceStatement) ExtendCORK() byte {
|
||||||
return 0x80
|
return 0x81
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveNamespaceStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *RemoveNamespaceStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1283,7 +1285,7 @@ func (this *DefineDatabaseStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineDatabaseStatement) ExtendCORK() byte {
|
func (this *DefineDatabaseStatement) ExtendCORK() byte {
|
||||||
return 0x81
|
return 0x82
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineDatabaseStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *DefineDatabaseStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1313,7 +1315,7 @@ func (this *RemoveDatabaseStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveDatabaseStatement) ExtendCORK() byte {
|
func (this *RemoveDatabaseStatement) ExtendCORK() byte {
|
||||||
return 0x82
|
return 0x83
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveDatabaseStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *RemoveDatabaseStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1343,7 +1345,7 @@ func (this *DefineLoginStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineLoginStatement) ExtendCORK() byte {
|
func (this *DefineLoginStatement) ExtendCORK() byte {
|
||||||
return 0x83
|
return 0x84
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineLoginStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *DefineLoginStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1379,7 +1381,7 @@ func (this *RemoveLoginStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveLoginStatement) ExtendCORK() byte {
|
func (this *RemoveLoginStatement) ExtendCORK() byte {
|
||||||
return 0x84
|
return 0x85
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveLoginStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *RemoveLoginStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1411,7 +1413,7 @@ func (this *DefineTokenStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineTokenStatement) ExtendCORK() byte {
|
func (this *DefineTokenStatement) ExtendCORK() byte {
|
||||||
return 0x85
|
return 0x86
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineTokenStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *DefineTokenStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1447,7 +1449,7 @@ func (this *RemoveTokenStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveTokenStatement) ExtendCORK() byte {
|
func (this *RemoveTokenStatement) ExtendCORK() byte {
|
||||||
return 0x86
|
return 0x87
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveTokenStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *RemoveTokenStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1479,7 +1481,7 @@ func (this *DefineScopeStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineScopeStatement) ExtendCORK() byte {
|
func (this *DefineScopeStatement) ExtendCORK() byte {
|
||||||
return 0x87
|
return 0x88
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineScopeStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *DefineScopeStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1519,7 +1521,7 @@ func (this *RemoveScopeStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveScopeStatement) ExtendCORK() byte {
|
func (this *RemoveScopeStatement) ExtendCORK() byte {
|
||||||
return 0x88
|
return 0x89
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveScopeStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *RemoveScopeStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1549,7 +1551,7 @@ func (this *DefineTableStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineTableStatement) ExtendCORK() byte {
|
func (this *DefineTableStatement) ExtendCORK() byte {
|
||||||
return 0x89
|
return 0x90
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineTableStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *DefineTableStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1595,7 +1597,7 @@ func (this *RemoveTableStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveTableStatement) ExtendCORK() byte {
|
func (this *RemoveTableStatement) ExtendCORK() byte {
|
||||||
return 0x90
|
return 0x91
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveTableStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *RemoveTableStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1625,7 +1627,7 @@ func (this *DefineEventStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineEventStatement) ExtendCORK() byte {
|
func (this *DefineEventStatement) ExtendCORK() byte {
|
||||||
return 0x91
|
return 0x92
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineEventStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *DefineEventStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1661,7 +1663,7 @@ func (this *RemoveEventStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveEventStatement) ExtendCORK() byte {
|
func (this *RemoveEventStatement) ExtendCORK() byte {
|
||||||
return 0x92
|
return 0x93
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveEventStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *RemoveEventStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1693,7 +1695,7 @@ func (this *DefineFieldStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineFieldStatement) ExtendCORK() byte {
|
func (this *DefineFieldStatement) ExtendCORK() byte {
|
||||||
return 0x93
|
return 0x94
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineFieldStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *DefineFieldStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1735,7 +1737,7 @@ func (this *RemoveFieldStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveFieldStatement) ExtendCORK() byte {
|
func (this *RemoveFieldStatement) ExtendCORK() byte {
|
||||||
return 0x94
|
return 0x95
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveFieldStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *RemoveFieldStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1767,7 +1769,7 @@ func (this *DefineIndexStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineIndexStatement) ExtendCORK() byte {
|
func (this *DefineIndexStatement) ExtendCORK() byte {
|
||||||
return 0x95
|
return 0x96
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *DefineIndexStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *DefineIndexStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
@ -1803,7 +1805,7 @@ func (this *RemoveIndexStatement) Encode() (dst []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveIndexStatement) ExtendCORK() byte {
|
func (this *RemoveIndexStatement) ExtendCORK() byte {
|
||||||
return 0x96
|
return 0x97
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *RemoveIndexStatement) MarshalCORK(w *cork.Writer) (err error) {
|
func (this *RemoveIndexStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseCreateStatement() (stmt *CreateStatement, err error) {
|
func (p *parser) parseCreateStatement() (stmt *CreateStatement, err error) {
|
||||||
|
|
||||||
stmt = &CreateStatement{RW: true}
|
stmt = &CreateStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseDefineDatabaseStatement() (stmt *DefineDatabaseStatement, err error) {
|
func (p *parser) parseDefineDatabaseStatement() (stmt *DefineDatabaseStatement, err error) {
|
||||||
|
|
||||||
stmt = &DefineDatabaseStatement{RW: true}
|
stmt = &DefineDatabaseStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNS); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNS); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -32,7 +32,7 @@ func (p *parser) parseDefineDatabaseStatement() (stmt *DefineDatabaseStatement,
|
||||||
|
|
||||||
func (p *parser) parseRemoveDatabaseStatement() (stmt *RemoveDatabaseStatement, err error) {
|
func (p *parser) parseRemoveDatabaseStatement() (stmt *RemoveDatabaseStatement, err error) {
|
||||||
|
|
||||||
stmt = &RemoveDatabaseStatement{RW: true}
|
stmt = &RemoveDatabaseStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNS); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNS); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseDeleteStatement() (stmt *DeleteStatement, err error) {
|
func (p *parser) parseDeleteStatement() (stmt *DeleteStatement, err error) {
|
||||||
|
|
||||||
stmt = &DeleteStatement{RW: true}
|
stmt = &DeleteStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseDefineEventStatement() (stmt *DefineEventStatement, err error) {
|
func (p *parser) parseDefineEventStatement() (stmt *DefineEventStatement, err error) {
|
||||||
|
|
||||||
stmt = &DefineEventStatement{RW: true}
|
stmt = &DefineEventStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -56,7 +56,7 @@ func (p *parser) parseDefineEventStatement() (stmt *DefineEventStatement, err er
|
||||||
|
|
||||||
func (p *parser) parseRemoveEventStatement() (stmt *RemoveEventStatement, err error) {
|
func (p *parser) parseRemoveEventStatement() (stmt *RemoveEventStatement, err error) {
|
||||||
|
|
||||||
stmt = &RemoveEventStatement{RW: true}
|
stmt = &RemoveEventStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseDefineFieldStatement() (stmt *DefineFieldStatement, err error) {
|
func (p *parser) parseDefineFieldStatement() (stmt *DefineFieldStatement, err error) {
|
||||||
|
|
||||||
stmt = &DefineFieldStatement{RW: true}
|
stmt = &DefineFieldStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -73,7 +73,7 @@ func (p *parser) parseDefineFieldStatement() (stmt *DefineFieldStatement, err er
|
||||||
|
|
||||||
func (p *parser) parseRemoveFieldStatement() (stmt *RemoveFieldStatement, err error) {
|
func (p *parser) parseRemoveFieldStatement() (stmt *RemoveFieldStatement, err error) {
|
||||||
|
|
||||||
stmt = &RemoveFieldStatement{RW: true}
|
stmt = &RemoveFieldStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseDefineIndexStatement() (stmt *DefineIndexStatement, err error) {
|
func (p *parser) parseDefineIndexStatement() (stmt *DefineIndexStatement, err error) {
|
||||||
|
|
||||||
stmt = &DefineIndexStatement{RW: true}
|
stmt = &DefineIndexStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -50,7 +50,7 @@ func (p *parser) parseDefineIndexStatement() (stmt *DefineIndexStatement, err er
|
||||||
|
|
||||||
func (p *parser) parseRemoveIndexStatement() (stmt *RemoveIndexStatement, err error) {
|
func (p *parser) parseRemoveIndexStatement() (stmt *RemoveIndexStatement, err error) {
|
||||||
|
|
||||||
stmt = &RemoveIndexStatement{RW: true}
|
stmt = &RemoveIndexStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseInfoStatement() (stmt *InfoStatement, err error) {
|
func (p *parser) parseInfoStatement() (stmt *InfoStatement, err error) {
|
||||||
|
|
||||||
stmt = &InfoStatement{RW: false}
|
stmt = &InfoStatement{}
|
||||||
|
|
||||||
if _, _, err = p.shouldBe(FOR); err != nil {
|
if _, _, err = p.shouldBe(FOR); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseInsertStatement() (stmt *InsertStatement, err error) {
|
func (p *parser) parseInsertStatement() (stmt *InsertStatement, err error) {
|
||||||
|
|
||||||
stmt = &InsertStatement{RW: true}
|
stmt = &InsertStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseLiveStatement() (stmt *LiveStatement, err error) {
|
func (p *parser) parseLiveStatement() (stmt *LiveStatement, err error) {
|
||||||
|
|
||||||
stmt = &LiveStatement{RW: true}
|
stmt = &LiveStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthSC); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthSC); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -56,7 +56,7 @@ func (p *parser) parseLiveStatement() (stmt *LiveStatement, err error) {
|
||||||
|
|
||||||
func (p *parser) parseKillStatement() (stmt *KillStatement, err error) {
|
func (p *parser) parseKillStatement() (stmt *KillStatement, err error) {
|
||||||
|
|
||||||
stmt = &KillStatement{RW: true}
|
stmt = &KillStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthSC); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthSC); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseDefineLoginStatement() (stmt *DefineLoginStatement, err error) {
|
func (p *parser) parseDefineLoginStatement() (stmt *DefineLoginStatement, err error) {
|
||||||
|
|
||||||
stmt = &DefineLoginStatement{RW: true}
|
stmt = &DefineLoginStatement{}
|
||||||
|
|
||||||
if stmt.User, err = p.parseIdent(); err != nil {
|
if stmt.User, err = p.parseIdent(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -56,7 +56,7 @@ func (p *parser) parseDefineLoginStatement() (stmt *DefineLoginStatement, err er
|
||||||
|
|
||||||
func (p *parser) parseRemoveLoginStatement() (stmt *RemoveLoginStatement, err error) {
|
func (p *parser) parseRemoveLoginStatement() (stmt *RemoveLoginStatement, err error) {
|
||||||
|
|
||||||
stmt = &RemoveLoginStatement{RW: true}
|
stmt = &RemoveLoginStatement{}
|
||||||
|
|
||||||
if stmt.User, err = p.parseIdent(); err != nil {
|
if stmt.User, err = p.parseIdent(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseDefineNamespaceStatement() (stmt *DefineNamespaceStatement, err error) {
|
func (p *parser) parseDefineNamespaceStatement() (stmt *DefineNamespaceStatement, err error) {
|
||||||
|
|
||||||
stmt = &DefineNamespaceStatement{RW: true}
|
stmt = &DefineNamespaceStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthKV); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthKV); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -32,7 +32,7 @@ func (p *parser) parseDefineNamespaceStatement() (stmt *DefineNamespaceStatement
|
||||||
|
|
||||||
func (p *parser) parseRemoveNamespaceStatement() (stmt *RemoveNamespaceStatement, err error) {
|
func (p *parser) parseRemoveNamespaceStatement() (stmt *RemoveNamespaceStatement, err error) {
|
||||||
|
|
||||||
stmt = &RemoveNamespaceStatement{RW: true}
|
stmt = &RemoveNamespaceStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthKV); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthKV); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
package sql
|
package sql
|
||||||
|
|
||||||
func (s *InfoStatement) Writeable() bool {
|
func (s *InfoStatement) Writeable() bool {
|
||||||
return s.RW
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *IfStatement) Writeable() bool {
|
func (s *IfStatement) Writeable() bool {
|
||||||
|
@ -35,11 +35,11 @@ func (s *ReturnStatement) Writeable() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *LiveStatement) Writeable() bool {
|
func (s *LiveStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *KillStatement) Writeable() bool {
|
func (s *KillStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SelectStatement) Writeable() bool {
|
func (s *SelectStatement) Writeable() bool {
|
||||||
|
@ -47,97 +47,97 @@ func (s *SelectStatement) Writeable() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *CreateStatement) Writeable() bool {
|
func (s *CreateStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *UpdateStatement) Writeable() bool {
|
func (s *UpdateStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DeleteStatement) Writeable() bool {
|
func (s *DeleteStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RelateStatement) Writeable() bool {
|
func (s *RelateStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *InsertStatement) Writeable() bool {
|
func (s *InsertStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *UpsertStatement) Writeable() bool {
|
func (s *UpsertStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DefineNamespaceStatement) Writeable() bool {
|
func (s *DefineNamespaceStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RemoveNamespaceStatement) Writeable() bool {
|
func (s *RemoveNamespaceStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DefineDatabaseStatement) Writeable() bool {
|
func (s *DefineDatabaseStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RemoveDatabaseStatement) Writeable() bool {
|
func (s *RemoveDatabaseStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DefineLoginStatement) Writeable() bool {
|
func (s *DefineLoginStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RemoveLoginStatement) Writeable() bool {
|
func (s *RemoveLoginStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DefineTokenStatement) Writeable() bool {
|
func (s *DefineTokenStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RemoveTokenStatement) Writeable() bool {
|
func (s *RemoveTokenStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DefineScopeStatement) Writeable() bool {
|
func (s *DefineScopeStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RemoveScopeStatement) Writeable() bool {
|
func (s *RemoveScopeStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DefineTableStatement) Writeable() bool {
|
func (s *DefineTableStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RemoveTableStatement) Writeable() bool {
|
func (s *RemoveTableStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DefineEventStatement) Writeable() bool {
|
func (s *DefineEventStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RemoveEventStatement) Writeable() bool {
|
func (s *RemoveEventStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DefineFieldStatement) Writeable() bool {
|
func (s *DefineFieldStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RemoveFieldStatement) Writeable() bool {
|
func (s *RemoveFieldStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DefineIndexStatement) Writeable() bool {
|
func (s *DefineIndexStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RemoveIndexStatement) Writeable() bool {
|
func (s *RemoveIndexStatement) Writeable() bool {
|
||||||
return s.RW
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ package sql
|
||||||
{{with $types := .}}{{range $k := $types}}
|
{{with $types := .}}{{range $k := $types}}
|
||||||
|
|
||||||
func (s *{{$k.name}}Statement) Writeable() bool {
|
func (s *{{$k.name}}Statement) Writeable() bool {
|
||||||
return s.RW
|
return {{if $k.a}}s.RW{{else}}{{if $k.y}}true{{else}}false{{end}}{{end}}
|
||||||
}
|
}
|
||||||
|
|
||||||
{{end}}{{end}}
|
{{end}}{{end}}
|
||||||
|
|
|
@ -1,36 +1,36 @@
|
||||||
[
|
[
|
||||||
{ "name": "Info" },
|
{ "n": true, "name": "Info" },
|
||||||
|
|
||||||
{ "name": "If" },
|
{ "a": true, "name": "If" },
|
||||||
{ "name": "Let" },
|
{ "a": true, "name": "Let" },
|
||||||
{ "name": "Return" },
|
{ "a": true, "name": "Return" },
|
||||||
|
|
||||||
{ "name": "Live" },
|
{ "y": true, "name": "Live" },
|
||||||
{ "name": "Kill" },
|
{ "y": true, "name": "Kill" },
|
||||||
{ "name": "Select" },
|
{ "a": true, "name": "Select" },
|
||||||
{ "name": "Create" },
|
{ "y": true, "name": "Create" },
|
||||||
{ "name": "Update" },
|
{ "y": true, "name": "Update" },
|
||||||
{ "name": "Delete" },
|
{ "y": true, "name": "Delete" },
|
||||||
{ "name": "Relate" },
|
{ "y": true, "name": "Relate" },
|
||||||
{ "name": "Insert" },
|
{ "y": true, "name": "Insert" },
|
||||||
{ "name": "Upsert" },
|
{ "y": true, "name": "Upsert" },
|
||||||
|
|
||||||
{ "name": "DefineNamespace" },
|
{ "y": true, "name": "DefineNamespace" },
|
||||||
{ "name": "RemoveNamespace" },
|
{ "y": true, "name": "RemoveNamespace" },
|
||||||
{ "name": "DefineDatabase" },
|
{ "y": true, "name": "DefineDatabase" },
|
||||||
{ "name": "RemoveDatabase" },
|
{ "y": true, "name": "RemoveDatabase" },
|
||||||
{ "name": "DefineLogin" },
|
{ "y": true, "name": "DefineLogin" },
|
||||||
{ "name": "RemoveLogin" },
|
{ "y": true, "name": "RemoveLogin" },
|
||||||
{ "name": "DefineToken" },
|
{ "y": true, "name": "DefineToken" },
|
||||||
{ "name": "RemoveToken" },
|
{ "y": true, "name": "RemoveToken" },
|
||||||
{ "name": "DefineScope" },
|
{ "y": true, "name": "DefineScope" },
|
||||||
{ "name": "RemoveScope" },
|
{ "y": true, "name": "RemoveScope" },
|
||||||
{ "name": "DefineTable" },
|
{ "y": true, "name": "DefineTable" },
|
||||||
{ "name": "RemoveTable" },
|
{ "y": true, "name": "RemoveTable" },
|
||||||
{ "name": "DefineEvent" },
|
{ "y": true, "name": "DefineEvent" },
|
||||||
{ "name": "RemoveEvent" },
|
{ "y": true, "name": "RemoveEvent" },
|
||||||
{ "name": "DefineField" },
|
{ "y": true, "name": "DefineField" },
|
||||||
{ "name": "RemoveField" },
|
{ "y": true, "name": "RemoveField" },
|
||||||
{ "name": "DefineIndex" },
|
{ "y": true, "name": "DefineIndex" },
|
||||||
{ "name": "RemoveIndex" }
|
{ "y": true, "name": "RemoveIndex" }
|
||||||
]
|
]
|
||||||
|
|
118
sql/rdwr_test.go
118
sql/rdwr_test.go
|
@ -26,188 +26,188 @@ import (
|
||||||
|
|
||||||
func TestRdwr(t *testing.T) {
|
func TestRdwr(t *testing.T) {
|
||||||
|
|
||||||
Convey("InfoStatement should auth correctly", t, func() {
|
Convey("InfoStatement should rdwr correctly", t, func() {
|
||||||
s := &InfoStatement{RW: true}
|
s := &InfoStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, false)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("IfStatement should auth correctly", t, func() {
|
Convey("IfStatement should rdwr correctly", t, func() {
|
||||||
s := &IfStatement{RW: true}
|
s := &IfStatement{RW: true}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("LetStatement should auth correctly", t, func() {
|
Convey("LetStatement should rdwr correctly", t, func() {
|
||||||
s := &LetStatement{RW: true}
|
s := &LetStatement{RW: true}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("ReturnStatement should auth correctly", t, func() {
|
Convey("ReturnStatement should rdwr correctly", t, func() {
|
||||||
s := &ReturnStatement{RW: true}
|
s := &ReturnStatement{RW: true}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("LiveStatement should auth correctly", t, func() {
|
Convey("LiveStatement should rdwr correctly", t, func() {
|
||||||
s := &LiveStatement{RW: true}
|
s := &LiveStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("KillStatement should auth correctly", t, func() {
|
Convey("KillStatement should rdwr correctly", t, func() {
|
||||||
s := &KillStatement{RW: true}
|
s := &KillStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("SelectStatement should auth correctly", t, func() {
|
Convey("SelectStatement should rdwr correctly", t, func() {
|
||||||
s := &SelectStatement{RW: true}
|
s := &SelectStatement{RW: true}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("CreateStatement should auth correctly", t, func() {
|
Convey("CreateStatement should rdwr correctly", t, func() {
|
||||||
s := &CreateStatement{RW: true}
|
s := &CreateStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("UpdateStatement should auth correctly", t, func() {
|
Convey("UpdateStatement should rdwr correctly", t, func() {
|
||||||
s := &UpdateStatement{RW: true}
|
s := &UpdateStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("DeleteStatement should auth correctly", t, func() {
|
Convey("DeleteStatement should rdwr correctly", t, func() {
|
||||||
s := &DeleteStatement{RW: true}
|
s := &DeleteStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("RelateStatement should auth correctly", t, func() {
|
Convey("RelateStatement should rdwr correctly", t, func() {
|
||||||
s := &RelateStatement{RW: true}
|
s := &RelateStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("InsertStatement should auth correctly", t, func() {
|
Convey("InsertStatement should rdwr correctly", t, func() {
|
||||||
s := &InsertStatement{RW: true}
|
s := &InsertStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("UpsertStatement should auth correctly", t, func() {
|
Convey("UpsertStatement should rdwr correctly", t, func() {
|
||||||
s := &UpsertStatement{RW: true}
|
s := &UpsertStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("DefineNamespaceStatement should auth correctly", t, func() {
|
Convey("DefineNamespaceStatement should rdwr correctly", t, func() {
|
||||||
s := &DefineNamespaceStatement{RW: true}
|
s := &DefineNamespaceStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("RemoveNamespaceStatement should auth correctly", t, func() {
|
Convey("RemoveNamespaceStatement should rdwr correctly", t, func() {
|
||||||
s := &RemoveNamespaceStatement{RW: true}
|
s := &RemoveNamespaceStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("DefineDatabaseStatement should auth correctly", t, func() {
|
Convey("DefineDatabaseStatement should rdwr correctly", t, func() {
|
||||||
s := &DefineDatabaseStatement{RW: true}
|
s := &DefineDatabaseStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("RemoveDatabaseStatement should auth correctly", t, func() {
|
Convey("RemoveDatabaseStatement should rdwr correctly", t, func() {
|
||||||
s := &RemoveDatabaseStatement{RW: true}
|
s := &RemoveDatabaseStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("DefineLoginStatement should auth correctly", t, func() {
|
Convey("DefineLoginStatement should rdwr correctly", t, func() {
|
||||||
s := &DefineLoginStatement{RW: true}
|
s := &DefineLoginStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("RemoveLoginStatement should auth correctly", t, func() {
|
Convey("RemoveLoginStatement should rdwr correctly", t, func() {
|
||||||
s := &RemoveLoginStatement{RW: true}
|
s := &RemoveLoginStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("DefineTokenStatement should auth correctly", t, func() {
|
Convey("DefineTokenStatement should rdwr correctly", t, func() {
|
||||||
s := &DefineTokenStatement{RW: true}
|
s := &DefineTokenStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("RemoveTokenStatement should auth correctly", t, func() {
|
Convey("RemoveTokenStatement should rdwr correctly", t, func() {
|
||||||
s := &RemoveTokenStatement{RW: true}
|
s := &RemoveTokenStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("DefineScopeStatement should auth correctly", t, func() {
|
Convey("DefineScopeStatement should rdwr correctly", t, func() {
|
||||||
s := &DefineScopeStatement{RW: true}
|
s := &DefineScopeStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("RemoveScopeStatement should auth correctly", t, func() {
|
Convey("RemoveScopeStatement should rdwr correctly", t, func() {
|
||||||
s := &RemoveScopeStatement{RW: true}
|
s := &RemoveScopeStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("DefineTableStatement should auth correctly", t, func() {
|
Convey("DefineTableStatement should rdwr correctly", t, func() {
|
||||||
s := &DefineTableStatement{RW: true}
|
s := &DefineTableStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("RemoveTableStatement should auth correctly", t, func() {
|
Convey("RemoveTableStatement should rdwr correctly", t, func() {
|
||||||
s := &RemoveTableStatement{RW: true}
|
s := &RemoveTableStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("DefineEventStatement should auth correctly", t, func() {
|
Convey("DefineEventStatement should rdwr correctly", t, func() {
|
||||||
s := &DefineEventStatement{RW: true}
|
s := &DefineEventStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("RemoveEventStatement should auth correctly", t, func() {
|
Convey("RemoveEventStatement should rdwr correctly", t, func() {
|
||||||
s := &RemoveEventStatement{RW: true}
|
s := &RemoveEventStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("DefineFieldStatement should auth correctly", t, func() {
|
Convey("DefineFieldStatement should rdwr correctly", t, func() {
|
||||||
s := &DefineFieldStatement{RW: true}
|
s := &DefineFieldStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("RemoveFieldStatement should auth correctly", t, func() {
|
Convey("RemoveFieldStatement should rdwr correctly", t, func() {
|
||||||
s := &RemoveFieldStatement{RW: true}
|
s := &RemoveFieldStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("DefineIndexStatement should auth correctly", t, func() {
|
Convey("DefineIndexStatement should rdwr correctly", t, func() {
|
||||||
s := &DefineIndexStatement{RW: true}
|
s := &DefineIndexStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("RemoveIndexStatement should auth correctly", t, func() {
|
Convey("RemoveIndexStatement should rdwr correctly", t, func() {
|
||||||
s := &RemoveIndexStatement{RW: true}
|
s := &RemoveIndexStatement{}
|
||||||
w := s.Writeable()
|
w := s.Writeable()
|
||||||
So(w, ShouldEqual, true)
|
So(w, ShouldEqual, true)
|
||||||
})
|
})
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseRelateStatement() (stmt *RelateStatement, err error) {
|
func (p *parser) parseRelateStatement() (stmt *RelateStatement, err error) {
|
||||||
|
|
||||||
stmt = &RelateStatement{RW: true}
|
stmt = &RelateStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseDefineScopeStatement() (stmt *DefineScopeStatement, err error) {
|
func (p *parser) parseDefineScopeStatement() (stmt *DefineScopeStatement, err error) {
|
||||||
|
|
||||||
stmt = &DefineScopeStatement{RW: true}
|
stmt = &DefineScopeStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -68,7 +68,7 @@ func (p *parser) parseDefineScopeStatement() (stmt *DefineScopeStatement, err er
|
||||||
|
|
||||||
func (p *parser) parseRemoveScopeStatement() (stmt *RemoveScopeStatement, err error) {
|
func (p *parser) parseRemoveScopeStatement() (stmt *RemoveScopeStatement, err error) {
|
||||||
|
|
||||||
stmt = &RemoveScopeStatement{RW: true}
|
stmt = &RemoveScopeStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
256
sql/sql_test.go
256
sql/sql_test.go
File diff suppressed because it is too large
Load diff
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseDefineTableStatement() (stmt *DefineTableStatement, err error) {
|
func (p *parser) parseDefineTableStatement() (stmt *DefineTableStatement, err error) {
|
||||||
|
|
||||||
stmt = &DefineTableStatement{RW: true}
|
stmt = &DefineTableStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -99,7 +99,7 @@ func (p *parser) parseDefineTableStatement() (stmt *DefineTableStatement, err er
|
||||||
|
|
||||||
func (p *parser) parseRemoveTableStatement() (stmt *RemoveTableStatement, err error) {
|
func (p *parser) parseRemoveTableStatement() (stmt *RemoveTableStatement, err error) {
|
||||||
|
|
||||||
stmt = &RemoveTableStatement{RW: true}
|
stmt = &RemoveTableStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthDB); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseDefineTokenStatement() (stmt *DefineTokenStatement, err error) {
|
func (p *parser) parseDefineTokenStatement() (stmt *DefineTokenStatement, err error) {
|
||||||
|
|
||||||
stmt = &DefineTokenStatement{RW: true}
|
stmt = &DefineTokenStatement{}
|
||||||
|
|
||||||
if stmt.Name, err = p.parseIdent(); err != nil {
|
if stmt.Name, err = p.parseIdent(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -83,7 +83,7 @@ func (p *parser) parseDefineTokenStatement() (stmt *DefineTokenStatement, err er
|
||||||
|
|
||||||
func (p *parser) parseRemoveTokenStatement() (stmt *RemoveTokenStatement, err error) {
|
func (p *parser) parseRemoveTokenStatement() (stmt *RemoveTokenStatement, err error) {
|
||||||
|
|
||||||
stmt = &RemoveTokenStatement{RW: true}
|
stmt = &RemoveTokenStatement{}
|
||||||
|
|
||||||
if stmt.Name, err = p.parseIdent(); err != nil {
|
if stmt.Name, err = p.parseIdent(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseUpdateStatement() (stmt *UpdateStatement, err error) {
|
func (p *parser) parseUpdateStatement() (stmt *UpdateStatement, err error) {
|
||||||
|
|
||||||
stmt = &UpdateStatement{RW: true}
|
stmt = &UpdateStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -16,7 +16,7 @@ package sql
|
||||||
|
|
||||||
func (p *parser) parseUpsertStatement() (stmt *UpsertStatement, err error) {
|
func (p *parser) parseUpsertStatement() (stmt *UpsertStatement, err error) {
|
||||||
|
|
||||||
stmt = &UpsertStatement{RW: true}
|
stmt = &UpsertStatement{}
|
||||||
|
|
||||||
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
if stmt.KV, stmt.NS, stmt.DB, err = p.o.get(AuthNO); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue