From 060e7dae14fa84780d0314f920157a516e001597 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sat, 10 Feb 2024 00:35:37 +0800 Subject: [PATCH 1/2] classApi; gop_autogen add generated header --- demo/classfile_blog/gop_autogen.go | 2 + demo/classfile_hello/gop_autogen.go | 2 + demo/classfile_static/gop_autogen.go | 2 + demo/classfile_statichttp/gop_autogen.go | 2 + ydb/class.go | 52 ++++---- ydb/classfile.go | 2 +- ydb/demo/foo/article_ydb.gox | 81 +++++++++++-- ydb/demo/foo/foo.gop | 4 + ydb/demo/foo/gop_autogen.go | 145 +++++++++++++++++++---- ydb/demo/foo/user_ydb.gox | 18 +-- ytest/demo/basic/gop_autogen.go | 2 + ytest/demo/basic/gop_autogen_test.go | 2 + ytest/demo/foo/gop_autogen.go | 2 + ytest/demo/foo/gop_autogen_test.go | 2 + ytest/demo/jwtdemo/gop_autogen.go | 2 + ytest/demo/jwtdemo/gop_autogen_test.go | 2 + 16 files changed, 256 insertions(+), 66 deletions(-) diff --git a/demo/classfile_blog/gop_autogen.go b/demo/classfile_blog/gop_autogen.go index 5a40696..a29569e 100644 --- a/demo/classfile_blog/gop_autogen.go +++ b/demo/classfile_blog/gop_autogen.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import "github.com/goplus/yap" diff --git a/demo/classfile_hello/gop_autogen.go b/demo/classfile_hello/gop_autogen.go index 3ab06df..863b42e 100644 --- a/demo/classfile_hello/gop_autogen.go +++ b/demo/classfile_hello/gop_autogen.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import "github.com/goplus/yap" diff --git a/demo/classfile_static/gop_autogen.go b/demo/classfile_static/gop_autogen.go index 9208ddd..052ea98 100644 --- a/demo/classfile_static/gop_autogen.go +++ b/demo/classfile_static/gop_autogen.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import "github.com/goplus/yap" diff --git a/demo/classfile_statichttp/gop_autogen.go b/demo/classfile_statichttp/gop_autogen.go index 5613e96..a690777 100644 --- a/demo/classfile_statichttp/gop_autogen.go +++ b/demo/classfile_statichttp/gop_autogen.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import ( diff --git a/ydb/class.go b/ydb/class.go index 6639008..3c4259c 100644 --- a/ydb/class.go +++ b/ydb/class.go @@ -52,7 +52,6 @@ type Class struct { query *query // query - api *api result []reflect.Value // result of an api call ret func(args ...any) error @@ -798,16 +797,33 @@ func (p *Class) Limit__2(n int, cond string, args ...any) error { // ----------------------------------------------------------------------------- +// Delete deltes rows by cond. +func (p *Class) Delete__0(src ast.Expr, cond string, args ...any) error { + panic("todo") +} + +// Delete deltes rows by cond. +func (p *Class) Delete__1(cond string, args ...any) error { + return p.Delete__0(nil, cond, args...) +} + +// ----------------------------------------------------------------------------- + +type classApi struct { + cls *Class + api *api +} + type api struct { name string spec any } // Api creates a new api by a spec. -func (p *Class) Api(name string, spec any, src ...ast.Expr) { +func (p *Class) Api(name string, spec any, src ...ast.Expr) func(args ...any) { api := &api{name: name, spec: spec} - p.api = api p.apis[name] = api + return classApi{p, api}.call } var ( @@ -822,13 +838,14 @@ func setRetErr(result []reflect.Value, errRet error) { } } -func (p *Class) doCall(args ...any) { +func (ca classApi) call(args ...any) { vArgs := make([]reflect.Value, len(args)) for i, arg := range args { vArgs[i] = reflect.ValueOf(arg) } - vFn := reflect.ValueOf(p.api.spec) + vFn := reflect.ValueOf(ca.api.spec) + var p = ca.cls var old = p.onErr var errRet error p.onErr = func(err error) { @@ -857,26 +874,6 @@ func (p *Class) doCall(args ...any) { p.result = vFn.Call(vArgs) } -// Call calls an api with specified args. -func (p *Class) Call__0(src ast.Expr, args ...any) { - if p.api == nil { - log.Panicln("please call `call` after an api definition") - } - if src == nil { - if len(args) == 0 { - p.doCall(nil) - return - } - args = append(make([]any, 1, len(args)+1), args...) - } - p.doCall(args...) -} - -// Call calls an api with specified args. -func (p *Class) Call__1(args ...any) { - p.doCall(args...) -} - func (p *Class) callRet(args ...any) error { t := p.t() result := p.result @@ -894,4 +891,9 @@ func (p *Class) callRet(args ...any) error { return nil } +// Out returns the ith reuslt. +func (p *Class) Out(i int) any { + return p.result[i].Interface() +} + // ----------------------------------------------------------------------------- diff --git a/ydb/classfile.go b/ydb/classfile.go index 7ee4a0d..e857c75 100644 --- a/ydb/classfile.go +++ b/ydb/classfile.go @@ -27,7 +27,7 @@ import ( ) const ( - GopPackage = true + GopPackage = "github.com/goplus/yap/test" ) // ----------------------------------------------------------------------------- diff --git a/ydb/demo/foo/article_ydb.gox b/ydb/demo/foo/article_ydb.gox index 01fcf3b..7956e85 100644 --- a/ydb/demo/foo/article_ydb.gox +++ b/ydb/demo/foo/article_ydb.gox @@ -30,15 +30,78 @@ table Tag, "v0.1.0" class "Articles", => { use "article" - api "add", func(doc *Article) error { + add := api("add", func(doc *Article) error { insert doc return nil - } + }) - api "tags", func(docId string, tags ...string) { - } + doc1 := &Article{} + doc1.Id, doc1.Author, doc1.Title = "123", "abc", "title1" + add doc1 + ret nil - api "listByTag", func(tag string) (result []ArticleEntry) { + add doc1 + ret ErrDuplicated + + doc2 := &Article{} + doc2.Id, doc2.Author, doc2.Title = "124", "efg", "title2" + add doc2 + ret nil + + doc3 := &Article{} + doc3.Id, doc3.Author, doc3.Title = "125", "efg", "title3" + add doc3 + ret nil + + doc4 := &Article{} + doc4.Id, doc4.Author, doc4.Title = "225", "abc", "title4" + add doc4 + ret nil + + doc5 := &Article{} + doc5.Id, doc5.Author, doc5.Title = "555", "abc", "title5" + add doc5 + ret nil + + get := api("get", func(docId string) (doc Article, err error) { + query "id=?", docId + ret &doc + return + }) + + get doc1.Id + ret doc1, nil + + get doc2.Id + ret doc2, nil + + // get "unknown" + // match out(1), ErrNoRows + + setTags := api("setTags", func(docId string, tags ...string) error { + var oldtags []string + query "tag.doc=?", docId + ret "tag.name", &oldtags + + tagsAdd, tagsDel := diff(tags, oldtags) + delete "tag.name=?", tagsDel + insert "doc", docId, "tag.name", tagsAdd + return nil + }) + + tags := api("tags", func(docId string) (tags []string, err error) { + query "tag.doc=?", docId + ret "tag.name", &tags + return + }) + + setTags doc1.Id, "tag1", "tag2" + ret nil + + // tags doc1.Id + // equalSet out(0), ["tag1", "tag2"] + + listByTag := api("listByTag", func(tag string) (result []ArticleEntry) { var ids []string query "tag.name=?", tag ret "tag.doc", &ids @@ -46,11 +109,13 @@ class "Articles", => { query "id=?", ids ret &result return - } + }) + _ = listByTag - api "listByAuthor", func(author string) (result []ArticleEntry) { + listByAuthor := api("listByAuthor", func(author string) (result []ArticleEntry) { query "author=?", author ret &result return - } + }) + _ = listByAuthor } diff --git a/ydb/demo/foo/foo.gop b/ydb/demo/foo/foo.gop index 92804dd..acbf2b3 100644 --- a/ydb/demo/foo/foo.gop +++ b/ydb/demo/foo/foo.gop @@ -24,3 +24,7 @@ func Hs256(pwd, salt string) string { b := hmac.new(sha256.New, []byte(salt)).sum([]byte(pwd)) return base64.RawURLEncoding.encodeToString(b) } + +func Diff(new, old []string) (add, del []string) { + return +} diff --git a/ydb/demo/foo/gop_autogen.go b/ydb/demo/foo/gop_autogen.go index 8bc54e7..add81bd 100644 --- a/ydb/demo/foo/gop_autogen.go +++ b/ydb/demo/foo/gop_autogen.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import ( @@ -48,7 +50,7 @@ type user struct { func main() { //line ydb/demo/foo/user_ydb.gox:23:1 - ydb.Gopt_AppGen_Main(new(ydb.AppGen), new(article), new(user)) + ydb.Gopt_AppGen_Main(new(ydb.AppGen), new(user), new(article)) } //line ydb/demo/foo/article_ydb.gox:20 func (this *article) Main() { @@ -66,39 +68,131 @@ func (this *article) Main() { //line ydb/demo/foo/article_ydb.gox:31:1 this.Use("article") //line ydb/demo/foo/article_ydb.gox:33:1 - this.Api("add", func(doc *Article) error { + add := this.Api("add", func(doc *Article) error { //line ydb/demo/foo/article_ydb.gox:34:1 this.Insert__1(doc) //line ydb/demo/foo/article_ydb.gox:35:1 return nil }) //line ydb/demo/foo/article_ydb.gox:38:1 - this.Api("tags", func(docId string, tags ...string) { - }) + doc1 := &Article{} +//line ydb/demo/foo/article_ydb.gox:39:1 + doc1.Id, doc1.Author, doc1.Title = "123", "abc", "title1" +//line ydb/demo/foo/article_ydb.gox:40:1 + add(doc1) //line ydb/demo/foo/article_ydb.gox:41:1 - this.Api("listByTag", func(tag string) (result []ArticleEntry) { -//line ydb/demo/foo/article_ydb.gox:42:1 - var ids []string + this.Ret__0(nil) //line ydb/demo/foo/article_ydb.gox:43:1 - this.Query__1("tag.name=?", tag) + add(doc1) //line ydb/demo/foo/article_ydb.gox:44:1 - this.Ret__1("tag.doc", &ids) + this.Ret__1(ydb.ErrDuplicated) //line ydb/demo/foo/article_ydb.gox:46:1 - this.Query__1("id=?", ids) + doc2 := &Article{} //line ydb/demo/foo/article_ydb.gox:47:1 - this.Ret__1(&result) + doc2.Id, doc2.Author, doc2.Title = "124", "efg", "title2" //line ydb/demo/foo/article_ydb.gox:48:1 - return - }) + add(doc2) +//line ydb/demo/foo/article_ydb.gox:49:1 + this.Ret__0(nil) //line ydb/demo/foo/article_ydb.gox:51:1 - this.Api("listByAuthor", func(author string) (result []ArticleEntry) { + doc3 := &Article{} //line ydb/demo/foo/article_ydb.gox:52:1 - this.Query__1("author=?", author) + doc3.Id, doc3.Author, doc3.Title = "125", "efg", "title3" //line ydb/demo/foo/article_ydb.gox:53:1 - this.Ret__1(&result) + add(doc3) //line ydb/demo/foo/article_ydb.gox:54:1 + this.Ret__0(nil) +//line ydb/demo/foo/article_ydb.gox:56:1 + doc4 := &Article{} +//line ydb/demo/foo/article_ydb.gox:57:1 + doc4.Id, doc4.Author, doc4.Title = "225", "abc", "title4" +//line ydb/demo/foo/article_ydb.gox:58:1 + add(doc4) +//line ydb/demo/foo/article_ydb.gox:59:1 + this.Ret__0(nil) +//line ydb/demo/foo/article_ydb.gox:61:1 + doc5 := &Article{} +//line ydb/demo/foo/article_ydb.gox:62:1 + doc5.Id, doc5.Author, doc5.Title = "555", "abc", "title5" +//line ydb/demo/foo/article_ydb.gox:63:1 + add(doc5) +//line ydb/demo/foo/article_ydb.gox:64:1 + this.Ret__0(nil) +//line ydb/demo/foo/article_ydb.gox:66:1 + get := this.Api("get", func(docId string) (doc Article, err error) { +//line ydb/demo/foo/article_ydb.gox:67:1 + this.Query__1("id=?", docId) +//line ydb/demo/foo/article_ydb.gox:68:1 + this.Ret__1(&doc) +//line ydb/demo/foo/article_ydb.gox:69:1 return }) +//line ydb/demo/foo/article_ydb.gox:72:1 + get(doc1.Id) +//line ydb/demo/foo/article_ydb.gox:73:1 + this.Ret__1(doc1, nil) +//line ydb/demo/foo/article_ydb.gox:75:1 + get(doc2.Id) +//line ydb/demo/foo/article_ydb.gox:76:1 + this.Ret__1(doc2, nil) +//line ydb/demo/foo/article_ydb.gox:81:1 + setTags := this.Api("setTags", func(docId string, tags ...string) error { +//line ydb/demo/foo/article_ydb.gox:82:1 + var oldtags []string +//line ydb/demo/foo/article_ydb.gox:83:1 + this.Query__1("tag.doc=?", docId) +//line ydb/demo/foo/article_ydb.gox:84:1 + this.Ret__1("tag.name", &oldtags) +//line ydb/demo/foo/article_ydb.gox:86:1 + tagsAdd, tagsDel := Diff(tags, oldtags) +//line ydb/demo/foo/article_ydb.gox:87:1 + this.Delete__1("tag.name=?", tagsDel) +//line ydb/demo/foo/article_ydb.gox:88:1 + this.Insert__1("doc", docId, "tag.name", tagsAdd) +//line ydb/demo/foo/article_ydb.gox:89:1 + return nil + }) +//line ydb/demo/foo/article_ydb.gox:92:1 + tags := this.Api("tags", func(docId string) (tags []string, err error) { +//line ydb/demo/foo/article_ydb.gox:93:1 + this.Query__1("tag.doc=?", docId) +//line ydb/demo/foo/article_ydb.gox:94:1 + this.Ret__1("tag.name", &tags) +//line ydb/demo/foo/article_ydb.gox:95:1 + return + }) +//line ydb/demo/foo/article_ydb.gox:98:1 + setTags(doc1.Id, "tag1", "tag2") +//line ydb/demo/foo/article_ydb.gox:99:1 + this.Ret__0(nil) +//line ydb/demo/foo/article_ydb.gox:104:1 + listByTag := this.Api("listByTag", func(tag string) (result []ArticleEntry) { +//line ydb/demo/foo/article_ydb.gox:105:1 + var ids []string +//line ydb/demo/foo/article_ydb.gox:106:1 + this.Query__1("tag.name=?", tag) +//line ydb/demo/foo/article_ydb.gox:107:1 + this.Ret__1("tag.doc", &ids) +//line ydb/demo/foo/article_ydb.gox:109:1 + this.Query__1("id=?", ids) +//line ydb/demo/foo/article_ydb.gox:110:1 + this.Ret__1(&result) +//line ydb/demo/foo/article_ydb.gox:111:1 + return + }) +//line ydb/demo/foo/article_ydb.gox:113:1 + _ = listByTag +//line ydb/demo/foo/article_ydb.gox:115:1 + listByAuthor := this.Api("listByAuthor", func(author string) (result []ArticleEntry) { +//line ydb/demo/foo/article_ydb.gox:116:1 + this.Query__1("author=?", author) +//line ydb/demo/foo/article_ydb.gox:117:1 + this.Ret__1(&result) +//line ydb/demo/foo/article_ydb.gox:118:1 + return + }) +//line ydb/demo/foo/article_ydb.gox:120:1 + _ = listByAuthor }) } @@ -116,6 +210,11 @@ func Hs256(pwd string, salt string) string { //line ydb/demo/foo/foo.gop:25:1 return base64.RawURLEncoding.EncodeToString(b) } +//line ydb/demo/foo/foo.gop:28:1 +func Diff(new []string, old []string) (add []string, del []string) { +//line ydb/demo/foo/foo.gop:29:1 + return +} //line ydb/demo/foo/user_ydb.gox:19 func (this *user) Main() { //line ydb/demo/foo/user_ydb.gox:19:1 @@ -127,7 +226,7 @@ func (this *user) Main() { //line ydb/demo/foo/user_ydb.gox:24:1 this.Use("user") //line ydb/demo/foo/user_ydb.gox:26:1 - this.Api("register", func(id string, pwd string, nickname string, email string, tel string, ctime time.Time) error { + register := this.Api("register", func(id string, pwd string, nickname string, email string, tel string, ctime time.Time) error { //line ydb/demo/foo/user_ydb.gox:27:1 if email == "" && tel == "" { //line ydb/demo/foo/user_ydb.gox:28:1 @@ -147,19 +246,19 @@ func (this *user) Main() { return nil }) //line ydb/demo/foo/user_ydb.gox:38:1 - this.Call__1("user", "pwd", "nickname", "", "", time.Now()) + register("user", "pwd", "nickname", "", "", time.Now()) //line ydb/demo/foo/user_ydb.gox:39:1 this.Ret__1(ErrNoEmailAndTel) //line ydb/demo/foo/user_ydb.gox:40:1 - this.Call__1("user", "pwd", "nickname", "user@foo.com", "", time.Now()) + register("user", "pwd", "nickname", "user@foo.com", "", time.Now()) //line ydb/demo/foo/user_ydb.gox:41:1 this.Ret__0(nil) //line ydb/demo/foo/user_ydb.gox:42:1 - this.Call__1("user", "pwd", "nickname", "user@foo.com", "13500000000", time.Now()) + register("user", "pwd", "nickname", "user@foo.com", "13500000000", time.Now()) //line ydb/demo/foo/user_ydb.gox:43:1 this.Ret__1(ydb.ErrDuplicated) //line ydb/demo/foo/user_ydb.gox:45:1 - this.Api("login", func(id string, pwd string) bool { + login := this.Api("login", func(id string, pwd string) bool { //line ydb/demo/foo/user_ydb.gox:46:1 var spwd, salt string //line ydb/demo/foo/user_ydb.gox:47:1 @@ -170,11 +269,11 @@ func (this *user) Main() { return Hs256(pwd, salt) == spwd }) //line ydb/demo/foo/user_ydb.gox:51:1 - this.Call__1("", "") + login("", "") //line ydb/demo/foo/user_ydb.gox:52:1 this.Ret__1(false) //line ydb/demo/foo/user_ydb.gox:53:1 - this.Call__1("user", "pwd") + login("user", "pwd") //line ydb/demo/foo/user_ydb.gox:54:1 this.Ret__1(true) }) diff --git a/ydb/demo/foo/user_ydb.gox b/ydb/demo/foo/user_ydb.gox index bb46798..1cb9d94 100644 --- a/ydb/demo/foo/user_ydb.gox +++ b/ydb/demo/foo/user_ydb.gox @@ -23,7 +23,7 @@ table User, "user v0.1.0" class "Users", => { use "user" - api "register", func(id, pwd, nickname, email, tel string, ctime time.Time) error { + register := api("register", func(id, pwd, nickname, email, tel string, ctime time.Time) error { if email == "" && tel == "" { return ErrNoEmailAndTel } @@ -34,22 +34,22 @@ class "Users", => { spwd := hs256(pwd, salt) insert &User{Id: id, Spwd: spwd, Salt: salt, Nickname: nickname, Email: email, Tel: tel, Ctime: ctime} return nil - } - call "user", "pwd", "nickname", "", "", time.now + }) + register "user", "pwd", "nickname", "", "", time.now ret ErrNoEmailAndTel - call "user", "pwd", "nickname", "user@foo.com", "", time.now + register "user", "pwd", "nickname", "user@foo.com", "", time.now ret nil - call "user", "pwd", "nickname", "user@foo.com", "13500000000", time.now + register "user", "pwd", "nickname", "user@foo.com", "13500000000", time.now ret ErrDuplicated - api "login", func(id, pwd string) bool { + login := api("login", func(id, pwd string) bool { var spwd, salt string query "id=?", id ret "salt", &salt, "spwd", &spwd return hs256(pwd, salt) == spwd - } - call "", "" + }) + login "", "" ret false - call "user", "pwd" + login "user", "pwd" ret true } diff --git a/ytest/demo/basic/gop_autogen.go b/ytest/demo/basic/gop_autogen.go index 678c43d..4389c09 100644 --- a/ytest/demo/basic/gop_autogen.go +++ b/ytest/demo/basic/gop_autogen.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import "github.com/goplus/yap" diff --git a/ytest/demo/basic/gop_autogen_test.go b/ytest/demo/basic/gop_autogen_test.go index fc47b22..ad1bb20 100644 --- a/ytest/demo/basic/gop_autogen_test.go +++ b/ytest/demo/basic/gop_autogen_test.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import ( diff --git a/ytest/demo/foo/gop_autogen.go b/ytest/demo/foo/gop_autogen.go index 3986bc2..cc44f3a 100644 --- a/ytest/demo/foo/gop_autogen.go +++ b/ytest/demo/foo/gop_autogen.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import "github.com/goplus/yap" diff --git a/ytest/demo/foo/gop_autogen_test.go b/ytest/demo/foo/gop_autogen_test.go index 61845d6..fcad812 100644 --- a/ytest/demo/foo/gop_autogen_test.go +++ b/ytest/demo/foo/gop_autogen_test.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import ( diff --git a/ytest/demo/jwtdemo/gop_autogen.go b/ytest/demo/jwtdemo/gop_autogen.go index 00eb2e6..ce82f0e 100644 --- a/ytest/demo/jwtdemo/gop_autogen.go +++ b/ytest/demo/jwtdemo/gop_autogen.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import "github.com/goplus/yap" diff --git a/ytest/demo/jwtdemo/gop_autogen_test.go b/ytest/demo/jwtdemo/gop_autogen_test.go index d80880f..7f47fec 100644 --- a/ytest/demo/jwtdemo/gop_autogen_test.go +++ b/ytest/demo/jwtdemo/gop_autogen_test.go @@ -1,3 +1,5 @@ +// Code generated by gop (Go+); DO NOT EDIT. + package main import ( From 37658ff7a240faee3d92c1c546319ee5ea22a791 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sat, 10 Feb 2024 00:42:11 +0800 Subject: [PATCH 2/2] x --- ydb/demo/foo/article_ydb.gox | 1 + ydb/demo/foo/gop_autogen.go | 32 +++++++++++++++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ydb/demo/foo/article_ydb.gox b/ydb/demo/foo/article_ydb.gox index 7956e85..b587af5 100644 --- a/ydb/demo/foo/article_ydb.gox +++ b/ydb/demo/foo/article_ydb.gox @@ -94,6 +94,7 @@ class "Articles", => { ret "tag.name", &tags return }) + _ = tags setTags doc1.Id, "tag1", "tag2" ret nil diff --git a/ydb/demo/foo/gop_autogen.go b/ydb/demo/foo/gop_autogen.go index add81bd..301ff18 100644 --- a/ydb/demo/foo/gop_autogen.go +++ b/ydb/demo/foo/gop_autogen.go @@ -161,37 +161,39 @@ func (this *article) Main() { //line ydb/demo/foo/article_ydb.gox:95:1 return }) -//line ydb/demo/foo/article_ydb.gox:98:1 - setTags(doc1.Id, "tag1", "tag2") +//line ydb/demo/foo/article_ydb.gox:97:1 + _ = tags //line ydb/demo/foo/article_ydb.gox:99:1 + setTags(doc1.Id, "tag1", "tag2") +//line ydb/demo/foo/article_ydb.gox:100:1 this.Ret__0(nil) -//line ydb/demo/foo/article_ydb.gox:104:1 - listByTag := this.Api("listByTag", func(tag string) (result []ArticleEntry) { //line ydb/demo/foo/article_ydb.gox:105:1 - var ids []string + listByTag := this.Api("listByTag", func(tag string) (result []ArticleEntry) { //line ydb/demo/foo/article_ydb.gox:106:1 - this.Query__1("tag.name=?", tag) + var ids []string //line ydb/demo/foo/article_ydb.gox:107:1 + this.Query__1("tag.name=?", tag) +//line ydb/demo/foo/article_ydb.gox:108:1 this.Ret__1("tag.doc", &ids) -//line ydb/demo/foo/article_ydb.gox:109:1 - this.Query__1("id=?", ids) //line ydb/demo/foo/article_ydb.gox:110:1 - this.Ret__1(&result) + this.Query__1("id=?", ids) //line ydb/demo/foo/article_ydb.gox:111:1 + this.Ret__1(&result) +//line ydb/demo/foo/article_ydb.gox:112:1 return }) -//line ydb/demo/foo/article_ydb.gox:113:1 +//line ydb/demo/foo/article_ydb.gox:114:1 _ = listByTag -//line ydb/demo/foo/article_ydb.gox:115:1 - listByAuthor := this.Api("listByAuthor", func(author string) (result []ArticleEntry) { //line ydb/demo/foo/article_ydb.gox:116:1 - this.Query__1("author=?", author) + listByAuthor := this.Api("listByAuthor", func(author string) (result []ArticleEntry) { //line ydb/demo/foo/article_ydb.gox:117:1 - this.Ret__1(&result) + this.Query__1("author=?", author) //line ydb/demo/foo/article_ydb.gox:118:1 + this.Ret__1(&result) +//line ydb/demo/foo/article_ydb.gox:119:1 return }) -//line ydb/demo/foo/article_ydb.gox:120:1 +//line ydb/demo/foo/article_ydb.gox:121:1 _ = listByAuthor }) }