Switch SQL RULES and SQL TABLE order
This commit is contained in:
parent
ab30c6b85e
commit
3089b6460f
4 changed files with 13 additions and 13 deletions
10
db/db.go
10
db/db.go
|
@ -158,16 +158,16 @@ func execute(ctx *fibre.Context, ast *sql.Query, chn chan<- interface{}) {
|
|||
case *sql.RecordStatement:
|
||||
res, err = executeRecordStatement(txn, stm)
|
||||
|
||||
case *sql.DefineRulesStatement:
|
||||
res, err = executeDefineRulesStatement(txn, stm)
|
||||
case *sql.RemoveRulesStatement:
|
||||
res, err = executeRemoveRulesStatement(txn, stm)
|
||||
|
||||
case *sql.DefineTableStatement:
|
||||
res, err = executeDefineTableStatement(txn, stm)
|
||||
case *sql.RemoveTableStatement:
|
||||
res, err = executeRemoveTableStatement(txn, stm)
|
||||
|
||||
case *sql.DefineRulesStatement:
|
||||
res, err = executeDefineRulesStatement(txn, stm)
|
||||
case *sql.RemoveRulesStatement:
|
||||
res, err = executeRemoveRulesStatement(txn, stm)
|
||||
|
||||
case *sql.DefineFieldStatement:
|
||||
res, err = executeDefineFieldStatement(txn, stm)
|
||||
case *sql.RemoveFieldStatement:
|
||||
|
|
|
@ -17,13 +17,13 @@ package sql
|
|||
func (p *parser) parseDefineStatement(explain bool) (Statement, error) {
|
||||
|
||||
// Inspect the next token.
|
||||
tok, _, err := p.shouldBe(RULES, TABLE, FIELD, INDEX)
|
||||
tok, _, err := p.shouldBe(TABLE, RULES, FIELD, INDEX)
|
||||
|
||||
switch tok {
|
||||
case RULES:
|
||||
return p.parseDefineRulesStatement(explain)
|
||||
case TABLE:
|
||||
return p.parseDefineTableStatement(explain)
|
||||
case RULES:
|
||||
return p.parseDefineRulesStatement(explain)
|
||||
case FIELD:
|
||||
return p.parseDefineFieldStatement(explain)
|
||||
case INDEX:
|
||||
|
|
|
@ -17,13 +17,13 @@ package sql
|
|||
func (p *parser) parseRemoveStatement(explain bool) (Statement, error) {
|
||||
|
||||
// Inspect the next token.
|
||||
tok, _, err := p.shouldBe(RULES, TABLE, FIELD, INDEX)
|
||||
tok, _, err := p.shouldBe(TABLE, RULES, FIELD, INDEX)
|
||||
|
||||
switch tok {
|
||||
case RULES:
|
||||
return p.parseRemoveRulesStatement(explain)
|
||||
case TABLE:
|
||||
return p.parseRemoveTableStatement(explain)
|
||||
case RULES:
|
||||
return p.parseRemoveRulesStatement(explain)
|
||||
case FIELD:
|
||||
return p.parseRemoveFieldStatement(explain)
|
||||
case INDEX:
|
||||
|
|
|
@ -1313,7 +1313,7 @@ func Test_Parse_Queries_Define(t *testing.T) {
|
|||
var tests = []tester{
|
||||
{
|
||||
sql: `DEFINE`,
|
||||
err: "Found `` but expected `RULES, TABLE, FIELD, INDEX`",
|
||||
err: "Found `` but expected `TABLE, RULES, FIELD, INDEX`",
|
||||
},
|
||||
// ----------------------------------------------------------------------
|
||||
{
|
||||
|
@ -1853,7 +1853,7 @@ func Test_Parse_Queries_Remove(t *testing.T) {
|
|||
var tests = []tester{
|
||||
{
|
||||
sql: `REMOVE`,
|
||||
err: "Found `` but expected `RULES, TABLE, FIELD, INDEX`",
|
||||
err: "Found `` but expected `TABLE, RULES, FIELD, INDEX`",
|
||||
},
|
||||
// ----------------------------------------------------------------------
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue