diff --git a/db/create.go b/db/create.go index ca296d42..6d7b5ff8 100644 --- a/db/create.go +++ b/db/create.go @@ -128,7 +128,7 @@ func (d *document) runCreate(ctx context.Context, stm *sql.CreateStatement) (int return nil, err } - if err = d.startThing(); err != nil { + if err = d.storeThing(); err != nil { return nil, err } diff --git a/db/document.go b/db/document.go index df65791a..858ecb0d 100644 --- a/db/document.go +++ b/db/document.go @@ -306,31 +306,6 @@ func (d *document) shouldDrop() (bool, error) { } -func (d *document) startThing() (err error) { - - // Check that the table should - // drop data being written. - - if ok, err := d.shouldDrop(); ok { - return err - } - - // Check that the rcord has been - // changed, and if not, return. - - if ok := d.changed(); !ok { - return - } - - // Write the value to the data - // layer and return any errors. - - _, err = d.i.e.dbo.PutC(d.now, d.key.Encode(), d.current.Encode(), nil) - - return - -} - func (d *document) storeThing() (err error) { // Check that the table should diff --git a/db/insert.go b/db/insert.go index 93216538..5aec28d9 100644 --- a/db/insert.go +++ b/db/insert.go @@ -106,7 +106,7 @@ func (d *document) runInsert(ctx context.Context, stm *sql.InsertStatement) (int return nil, err } - if err = d.startThing(); err != nil { + if err = d.storeThing(); err != nil { return nil, err } diff --git a/db/relate.go b/db/relate.go index 81fcd7ab..47fa4b63 100644 --- a/db/relate.go +++ b/db/relate.go @@ -120,7 +120,7 @@ func (d *document) runRelate(ctx context.Context, stm *sql.RelateStatement) (int return nil, err } - if err = d.startThing(); err != nil { + if err = d.storeThing(); err != nil { return nil, err }