2017-11-16 20:53:13 +00:00
|
|
|
// Code generated by https://github.com/abcum/tmpl
|
|
|
|
// Source file: auth.gen.go.tmpl
|
|
|
|
// DO NOT EDIT!
|
|
|
|
|
|
|
|
// 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 (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestRdwr(t *testing.T) {
|
|
|
|
|
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
|
|
|
Convey("InfoStatement should rdwr correctly", t, func() {
|
|
|
|
s := &InfoStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
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
|
|
|
So(w, ShouldEqual, false)
|
2017-11-16 20:53:13 +00:00
|
|
|
})
|
|
|
|
|
2019-01-31 10:03:50 +00:00
|
|
|
Convey("LetStatement should rdwr correctly", t, func() {
|
|
|
|
s := &LetStatement{RW: true}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
2019-01-31 10:03:50 +00:00
|
|
|
Convey("LiveStatement should rdwr correctly", t, func() {
|
|
|
|
s := &LiveStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
2019-01-31 10:03:50 +00:00
|
|
|
Convey("KillStatement should rdwr correctly", t, func() {
|
|
|
|
s := &KillStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
2019-01-31 10:03:50 +00:00
|
|
|
Convey("ReturnStatement should rdwr correctly", t, func() {
|
|
|
|
s := &ReturnStatement{RW: true}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
2019-01-31 10:03:50 +00:00
|
|
|
Convey("IfelseStatement should rdwr correctly", t, func() {
|
|
|
|
s := &IfelseStatement{RW: true}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("SelectStatement should rdwr correctly", t, func() {
|
2017-11-16 20:53:13 +00:00
|
|
|
s := &SelectStatement{RW: true}
|
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("CreateStatement should rdwr correctly", t, func() {
|
|
|
|
s := &CreateStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("UpdateStatement should rdwr correctly", t, func() {
|
|
|
|
s := &UpdateStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("DeleteStatement should rdwr correctly", t, func() {
|
|
|
|
s := &DeleteStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("RelateStatement should rdwr correctly", t, func() {
|
|
|
|
s := &RelateStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("InsertStatement should rdwr correctly", t, func() {
|
|
|
|
s := &InsertStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("UpsertStatement should rdwr correctly", t, func() {
|
|
|
|
s := &UpsertStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("DefineNamespaceStatement should rdwr correctly", t, func() {
|
|
|
|
s := &DefineNamespaceStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("RemoveNamespaceStatement should rdwr correctly", t, func() {
|
|
|
|
s := &RemoveNamespaceStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("DefineDatabaseStatement should rdwr correctly", t, func() {
|
|
|
|
s := &DefineDatabaseStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("RemoveDatabaseStatement should rdwr correctly", t, func() {
|
|
|
|
s := &RemoveDatabaseStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("DefineLoginStatement should rdwr correctly", t, func() {
|
|
|
|
s := &DefineLoginStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("RemoveLoginStatement should rdwr correctly", t, func() {
|
|
|
|
s := &RemoveLoginStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("DefineTokenStatement should rdwr correctly", t, func() {
|
|
|
|
s := &DefineTokenStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("RemoveTokenStatement should rdwr correctly", t, func() {
|
|
|
|
s := &RemoveTokenStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("DefineScopeStatement should rdwr correctly", t, func() {
|
|
|
|
s := &DefineScopeStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("RemoveScopeStatement should rdwr correctly", t, func() {
|
|
|
|
s := &RemoveScopeStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("DefineTableStatement should rdwr correctly", t, func() {
|
|
|
|
s := &DefineTableStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("RemoveTableStatement should rdwr correctly", t, func() {
|
|
|
|
s := &RemoveTableStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("DefineEventStatement should rdwr correctly", t, func() {
|
|
|
|
s := &DefineEventStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("RemoveEventStatement should rdwr correctly", t, func() {
|
|
|
|
s := &RemoveEventStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("DefineFieldStatement should rdwr correctly", t, func() {
|
|
|
|
s := &DefineFieldStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("RemoveFieldStatement should rdwr correctly", t, func() {
|
|
|
|
s := &RemoveFieldStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("DefineIndexStatement should rdwr correctly", t, func() {
|
|
|
|
s := &DefineIndexStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
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
|
|
|
Convey("RemoveIndexStatement should rdwr correctly", t, func() {
|
|
|
|
s := &RemoveIndexStatement{}
|
2017-11-16 20:53:13 +00:00
|
|
|
w := s.Writeable()
|
|
|
|
So(w, ShouldEqual, true)
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|