Don’t store ‘trail’ information in store

This commit is contained in:
Tobie Morgan Hitchcock 2016-07-18 23:02:37 +01:00
parent 1933b3e712
commit 98c61b0d2c
5 changed files with 0 additions and 31 deletions

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -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

View file

@ -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 {