From bb6387c69b5dd320873d16605660e6c3b9e68680 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sat, 29 Oct 2016 12:46:22 +0100 Subject: [PATCH] Add invisible meta object on items --- util/item/blaze.go | 4 +++- util/item/merge.go | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/util/item/blaze.go b/util/item/blaze.go index c899dd7d..1055e552 100644 --- a/util/item/blaze.go +++ b/util/item/blaze.go @@ -25,11 +25,13 @@ func (this *Doc) Blaze(ast *sql.SelectStatement) (res interface{}) { for _, v := range ast.Expr { if _, ok := v.Expr.(*sql.All); ok { - doc = this.current + doc = data.Consume(this.current.Copy()) break } } + doc.Del("meta") + for _, v := range ast.Expr { switch e := v.Expr.(type) { default: diff --git a/util/item/merge.go b/util/item/merge.go index 114eb3ca..87e4322e 100644 --- a/util/item/merge.go +++ b/util/item/merge.go @@ -72,6 +72,8 @@ func (this *Doc) Merge(data []sql.Expr) (err error) { func (this *Doc) setFld() (err error) { this.current.Set(this.id, "id") + this.current.Set(this.key.ID, "meta.id") + this.current.Set(this.key.TB, "meta.tb") return