From dd79f3c4406440b7634a5299ba5f4ad16075c49e Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 7 Oct 2016 14:21:01 +0100 Subject: [PATCH] Remove SQL RECORD statement --- db/db.go | 2 -- db/record.go | 24 ------------------------ sql/ast.go | 11 ----------- sql/parser.go | 2 -- sql/record.go | 27 --------------------------- util/pack/pack.go | 1 - 6 files changed, 67 deletions(-) delete mode 100644 db/record.go delete mode 100644 sql/record.go diff --git a/db/db.go b/db/db.go index 3acd413a..efff8df3 100644 --- a/db/db.go +++ b/db/db.go @@ -155,8 +155,6 @@ func execute(ctx *fibre.Context, ast *sql.Query, chn chan<- interface{}) { res, err = executeDeleteStatement(txn, stm) case *sql.RelateStatement: res, err = executeRelateStatement(txn, stm) - case *sql.RecordStatement: - res, err = executeRecordStatement(txn, stm) case *sql.DefineTableStatement: res, err = executeDefineTableStatement(txn, stm) diff --git a/db/record.go b/db/record.go deleted file mode 100644 index 71e310c4..00000000 --- a/db/record.go +++ /dev/null @@ -1,24 +0,0 @@ -// 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 db - -import ( - "github.com/abcum/surreal/kvs" - "github.com/abcum/surreal/sql" -) - -func executeRecordStatement(txn kvs.TX, ast *sql.RecordStatement) ([]interface{}, error) { - return nil, nil -} diff --git a/sql/ast.go b/sql/ast.go index 8689b0ac..dfcf4cef 100644 --- a/sql/ast.go +++ b/sql/ast.go @@ -145,17 +145,6 @@ type RelateStatement struct { Echo Token `cork:"echo" codec:"echo"` } -// RecordStatement represents a SQL RECORD statement. -type RecordStatement struct { - KV string `cork:"-" codec:"-"` - NS string `cork:"-" codec:"-"` - DB string `cork:"-" codec:"-"` - Type []Expr `cork:"type" codec:"type"` - When Expr `cork:"when" codec:"when"` - Data []Expr `cork:"data" codec:"data"` - Echo Token `cork:"echo" codec:"echo"` -} - // -------------------------------------------------- // Table // -------------------------------------------------- diff --git a/sql/parser.go b/sql/parser.go index 8ef83b7a..2a4b6078 100644 --- a/sql/parser.go +++ b/sql/parser.go @@ -144,8 +144,6 @@ func (p *parser) parseSingle() (Statement, error) { return p.parseDeleteStatement() case RELATE: return p.parseRelateStatement() - case RECORD: - return p.parseRecordStatement() case DEFINE: return p.parseDefineStatement() diff --git a/sql/record.go b/sql/record.go deleted file mode 100644 index ca7dbd2f..00000000 --- a/sql/record.go +++ /dev/null @@ -1,27 +0,0 @@ -// 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 - -func (p *parser) parseRecordStatement() (stmt *RecordStatement, err error) { - - stmt = &RecordStatement{} - - stmt.KV = p.c.Get("KV").(string) - stmt.NS = p.c.Get("NS").(string) - stmt.DB = p.c.Get("DB").(string) - - return - -} diff --git a/util/pack/pack.go b/util/pack/pack.go index 6fc67728..775ee52b 100644 --- a/util/pack/pack.go +++ b/util/pack/pack.go @@ -41,7 +41,6 @@ func init() { gob.Register(sql.ModifyStatement{}) gob.Register(sql.DeleteStatement{}) gob.Register(sql.RelateStatement{}) - gob.Register(sql.RecordStatement{}) gob.Register(sql.DefineViewStatement{}) gob.Register(sql.DefineTableStatement{}) gob.Register(sql.DefineRulesStatement{})