From 98c61b0d2cb6cfdb6dba6f45f3346f5b87f701d7 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 18 Jul 2016 23:02:37 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20store=20=E2=80=98trail=E2=80=99?= =?UTF-8?q?=20information=20in=20store?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/create.go | 4 ---- db/delete.go | 4 ---- db/modify.go | 4 ---- db/update.go | 4 ---- util/item/item.go | 15 --------------- 5 files changed, 31 deletions(-) diff --git a/db/create.go b/db/create.go index e1a518de..1622fb48 100644 --- a/db/create.go +++ b/db/create.go @@ -81,10 +81,6 @@ func create(txn kvs.TX, doc *item.Doc, ast *sql.CreateStatement) (out interface{ return nil, err } - if err = doc.StoreTrail(txn); err != nil { - return nil, err - } - out = doc.Yield(ast.Echo, sql.AFTER) return diff --git a/db/delete.go b/db/delete.go index 0fa23910..d35c0bf3 100644 --- a/db/delete.go +++ b/db/delete.go @@ -75,10 +75,6 @@ func delete(txn kvs.TX, doc *item.Doc, ast *sql.DeleteStatement) (out interface{ return nil, err } - if err = doc.StoreTrail(txn); err != nil { - return nil, err - } - if err = doc.PurgeIndex(txn); err != nil { return nil, err } diff --git a/db/modify.go b/db/modify.go index 8ef84033..97d7d01c 100644 --- a/db/modify.go +++ b/db/modify.go @@ -73,10 +73,6 @@ func modify(txn kvs.TX, doc *item.Doc, ast *sql.ModifyStatement) (out interface{ return nil, err } - if err = doc.StoreTrail(txn); err != nil { - return nil, err - } - out = doc.Yield(ast.Echo, sql.DIFF) return diff --git a/db/update.go b/db/update.go index 5cab2e5f..c1d1e152 100644 --- a/db/update.go +++ b/db/update.go @@ -87,10 +87,6 @@ func update(txn kvs.TX, doc *item.Doc, ast *sql.UpdateStatement) (out interface{ return nil, err } - if err = doc.StoreTrail(txn); err != nil { - return nil, err - } - out = doc.Yield(ast.Echo, sql.AFTER) return diff --git a/util/item/item.go b/util/item/item.go index 01a639d2..ebd216a3 100644 --- a/util/item/item.go +++ b/util/item/item.go @@ -214,21 +214,6 @@ func (this *Doc) StorePatch(txn kvs.TX) (err error) { } -func (this *Doc) PurgeTrail(txn kvs.TX) (err error) { - - beg := &keys.Trail{KV: this.key.KV, NS: this.key.NS, DB: this.key.DB, AT: keys.StartOfTime} - end := &keys.Trail{KV: this.key.KV, NS: this.key.NS, DB: this.key.DB, AT: keys.EndOfTime} - return txn.RDel(beg.Encode(), end.Encode(), 0) - -} - -func (this *Doc) StoreTrail(txn kvs.TX) (err error) { - - key := &keys.Trail{KV: this.key.KV, NS: this.key.NS, DB: this.key.DB} - return txn.CPut(key.Encode(), this.diff(), nil) - -} - func (this *Doc) PurgeIndex(txn kvs.TX) (err error) { for _, index := range this.indexes {