diff --git a/db/document.go b/db/document.go index 656c915f..04756be1 100644 --- a/db/document.go +++ b/db/document.go @@ -18,11 +18,11 @@ import ( "fmt" "context" + "reflect" "github.com/abcum/surreal/kvs" "github.com/abcum/surreal/sql" "github.com/abcum/surreal/util/data" - "github.com/abcum/surreal/util/diff" "github.com/abcum/surreal/util/indx" "github.com/abcum/surreal/util/keys" ) @@ -207,10 +207,7 @@ func (d *document) forced(ctx context.Context) bool { } func (d *document) hasChanged(ctx context.Context) bool { - a, _ := d.initial.Data().(map[string]interface{}) - b, _ := d.current.Data().(map[string]interface{}) - c := diff.Diff(a, b) - return len(c) > 0 + return reflect.DeepEqual(d.initial, d.current) == false } func (d *document) shouldDrop(ctx context.Context) (bool, error) { diff --git a/db/yield.go b/db/yield.go index 716e7502..1bc3151a 100644 --- a/db/yield.go +++ b/db/yield.go @@ -106,6 +106,7 @@ func (d *document) yield(ctx context.Context, stm sql.Statement, output sql.Toke switch output { default: return nil, nil + case sql.DIFF: old, err := d.cold(ctx)