Add invisible meta object on items

This commit is contained in:
Tobie Morgan Hitchcock 2016-10-29 12:46:22 +01:00
parent 8eaa4e6eda
commit bb6387c69b
2 changed files with 5 additions and 1 deletions

View file

@ -25,11 +25,13 @@ func (this *Doc) Blaze(ast *sql.SelectStatement) (res interface{}) {
for _, v := range ast.Expr { for _, v := range ast.Expr {
if _, ok := v.Expr.(*sql.All); ok { if _, ok := v.Expr.(*sql.All); ok {
doc = this.current doc = data.Consume(this.current.Copy())
break break
} }
} }
doc.Del("meta")
for _, v := range ast.Expr { for _, v := range ast.Expr {
switch e := v.Expr.(type) { switch e := v.Expr.(type) {
default: default:

View file

@ -72,6 +72,8 @@ func (this *Doc) Merge(data []sql.Expr) (err error) {
func (this *Doc) setFld() (err error) { func (this *Doc) setFld() (err error) {
this.current.Set(this.id, "id") this.current.Set(this.id, "id")
this.current.Set(this.key.ID, "meta.id")
this.current.Set(this.key.TB, "meta.tb")
return return