From 37ae2b744ec8176877f37320fbaa4ecc5f37f4c8 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Wed, 26 Jun 2019 01:15:58 -0700 Subject: [PATCH] add offset step to query builder (#1049) Summary: Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1049 Useful for real paging Reviewed By: noamsch Differential Revision: D16003607 fbshipit-source-id: 6a85d0e3d71a2582bc3cd8f1d66748dda4f2a10e --- entc/gen/bindata.go | 81 +++++++++----------- entc/gen/template/builder/query.tmpl | 15 +++- entc/gen/template/dialect/gremlin/query.tmpl | 7 +- entc/gen/template/dialect/sql/query.tmpl | 5 ++ entc/gen/template/import.tmpl | 1 + entc/integration/ent/card_query.go | 20 ++++- entc/integration/ent/comment_query.go | 20 ++++- entc/integration/ent/file_query.go | 20 ++++- entc/integration/ent/group_query.go | 20 ++++- entc/integration/ent/groupinfo_query.go | 20 ++++- entc/integration/ent/node_query.go | 20 ++++- entc/integration/ent/pet_query.go | 20 ++++- entc/integration/ent/user_query.go | 20 ++++- entc/integration/integration_test.go | 25 ++++++ 14 files changed, 235 insertions(+), 59 deletions(-) diff --git a/entc/gen/bindata.go b/entc/gen/bindata.go index 21e21f6fc..eb7f933fe 100644 --- a/entc/gen/bindata.go +++ b/entc/gen/bindata.go @@ -1,4 +1,4 @@ -// Package gen Code generated by go-bindata. (@generated) DO NOT EDIT. +// Code generated by go-bindata. (@generated) DO NOT EDIT. // sources: // template/base.tmpl // template/builder/create.tmpl @@ -44,7 +44,7 @@ import ( func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) + return nil, fmt.Errorf("Read %q: %v", name, err) } var buf bytes.Buffer @@ -52,7 +52,7 @@ func bindataRead(data []byte, name string) ([]byte, error) { clErr := gz.Close() if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) + return nil, fmt.Errorf("Read %q: %v", name, err) } if clErr != nil { return nil, err @@ -73,32 +73,21 @@ type bindataFileInfo struct { modTime time.Time } -// Name return file name func (fi bindataFileInfo) Name() string { return fi.name } - -// Size return file size func (fi bindataFileInfo) Size() int64 { return fi.size } - -// Mode return file mode func (fi bindataFileInfo) Mode() os.FileMode { return fi.mode } - -// Mode return file modify time func (fi bindataFileInfo) ModTime() time.Time { return fi.modTime } - -// IsDir return file whether a directory func (fi bindataFileInfo) IsDir() bool { - return fi.mode&os.ModeDir != 0 + return false } - -// Sys return file is sys mode func (fi bindataFileInfo) Sys() interface{} { return nil } @@ -118,7 +107,7 @@ func templateBaseTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/base.tmpl", size: 7583, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/base.tmpl", size: 7583, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -138,7 +127,7 @@ func templateBuilderCreateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/create.tmpl", size: 2706, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/builder/create.tmpl", size: 2706, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -158,12 +147,12 @@ func templateBuilderDeleteTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/delete.tmpl", size: 1903, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/builder/delete.tmpl", size: 1903, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateBuilderQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x5a\x6f\x6f\xdb\x38\xd2\x7f\x6d\x7f\x8a\x59\xc3\x4f\x20\x05\xae\xdc\x64\xf7\x55\x1e\xe4\x80\x6c\xd3\x16\xbe\x6b\x9b\xdd\xa6\xb8\x5b\x20\x08\x76\x15\x69\x64\xb3\xa5\x29\x47\xa4\x9c\x18\x5e\x7f\xf7\x03\x87\xd4\x5f\x4b\x8e\xec\xf5\x5d\xaf\x40\x50\x53\x1a\x0e\x39\x33\x3f\xfe\x38\x22\x67\xbd\x86\x10\x23\x26\x10\x06\x8f\x29\x26\xab\x01\x6c\x36\xfd\xf5\x1a\x86\x8b\x6f\x53\xb8\xb8\x84\x07\x5f\x22\x0c\xbd\x37\xb1\x88\xd8\xd4\xfb\xc5\x0f\xbe\xf9\x53\xb4\x32\x0a\xe7\x0b\xee\x2b\x84\xc1\x0c\xfd\x10\x93\x81\xe9\xb5\xd9\xf4\xab\x6f\xd9\x7c\x11\x27\x6a\x00\xc3\xec\xd5\xf0\x21\x65\x3c\xc4\x44\x0f\xb0\x48\x98\x50\xe0\x2c\x7c\x19\xf8\x1c\x86\xde\x27\x7f\x8e\x2e\x0c\x7e\xad\x4c\x26\xc1\x00\xd9\xd2\x74\xc8\x7f\xe7\x5a\xb4\xd6\xf1\x18\xca\x8a\x37\x1b\x60\x12\xd4\x0c\x21\x7b\x12\xc5\x09\x90\x85\x4c\x4c\xb5\x68\x65\x40\x2d\x8f\x42\x31\xc5\x50\x7a\x7d\xb5\x5a\x60\x5d\x9b\x54\x49\x1a\x28\x58\xf7\x7b\x01\xb9\xa2\xdf\xe3\x6c\xce\x14\x9c\x32\xa1\xfa\xbd\x38\xd1\x62\x70\x77\x7f\xa3\x7f\xf4\x7b\xa9\x60\x8f\x29\xc2\xdd\xbd\x54\x09\x13\xd3\x7e\x6f\x91\x60\xc8\x02\x5f\xa1\x84\xbb\x7b\x14\xca\xfb\x25\x7b\xd0\xef\x8d\xc7\xc0\x84\xc2\x64\x8e\x21\xd3\xfe\xd2\xb3\xa4\x79\xf4\xe4\x23\x07\xfd\xef\x54\x3e\x72\xef\x16\x39\x06\x2a\x4e\xfa\xbd\x69\x82\x73\xce\x04\x9c\x86\x92\x7b\x5f\x12\x7f\x89\x89\xf4\x79\xdf\x78\xe1\x5f\x33\x4c\x10\xfc\x30\x94\xe0\x83\xc0\x27\xc8\x87\x26\x17\x94\x5c\xe2\xf5\xa3\x54\x04\xe0\x54\x1c\xbc\xd9\xc0\x69\xd5\x74\xd7\xa8\x74\x16\x12\x3c\xcf\xab\xcc\xdd\xad\xcb\x6a\xff\x94\xd5\x6d\x36\x5e\xc9\xf2\x4b\xf0\x17\x0b\x14\x61\x7d\xc4\x92\xcc\x08\x16\xd2\xf3\x3c\xb7\xdf\x4b\x50\xa5\x89\x80\x9a\xa8\x35\xf2\x03\xf9\xde\x1a\x69\x02\x21\x15\x2e\x40\xc5\x64\x20\xc5\xb9\xb3\x79\xa4\xcc\x31\x5a\x98\x50\x2f\x1a\xa5\x67\x6c\xa4\x2f\xe1\x84\x7e\xbc\x30\x5b\x02\x85\x9d\xad\x00\x83\x95\xc3\xa7\x4b\xda\x9c\x58\x07\x83\x7e\x76\x9a\xaf\x19\xb4\x35\x00\xf4\x7a\x04\xf1\x4b\xae\x5f\xaf\xc7\xa7\xa0\x66\x4c\x42\x10\x87\x08\x33\x5f\x82\x64\x73\xc6\xfd\x84\xa9\x15\x3c\x31\x35\x03\x0c\xa7\x39\x84\x81\x09\x08\x38\xd3\x98\x51\xf3\x05\x87\xd3\xb1\x59\xcf\x89\x2f\xa6\x08\xc3\xdf\x47\x30\x44\xbd\xa4\x87\xde\xdb\x70\x8a\x52\x0f\x42\x33\xd7\x3a\x7e\x6f\xe7\x08\xf4\xbe\xac\x16\xb8\xcd\x14\x7a\x25\x51\xab\xb4\xbc\x31\x5f\xdf\xc1\xcc\x67\xc2\x70\x42\x90\x26\x09\x0a\x65\x1c\x0f\xb1\xa0\x87\x34\x70\xc1\x06\xe1\x14\xbd\x7e\xaf\x63\x4c\x5a\x47\x75\x6c\x74\x2a\x16\x99\x10\xf5\xcc\xe8\x17\x97\x70\xd2\x20\xb1\x36\x34\x73\x51\x8f\x82\x67\x9e\x6f\xfa\xbd\x9e\x7c\x62\x2a\x98\x6d\x09\x84\x89\xfe\xe5\x5d\x33\x5f\xf3\x85\xe3\xd2\x58\x81\xa6\xf1\xd0\x3c\xf2\x3e\xae\x6e\x7f\xfd\x30\xca\x9b\xb7\xbf\x7e\x60\x0a\x2f\xfa\xbd\x5e\x6f\xbd\x7e\x05\x2c\xd2\xf3\xff\x78\xfe\x11\xc8\xa7\xf4\x14\x86\x4c\x4f\xf4\x4c\x4f\x6c\x0d\xc3\xaf\xba\xf1\x9a\x1a\x99\xfc\x44\x4e\x84\xe6\x21\xb4\x22\x0c\x32\x09\x2d\x9e\x77\x45\x11\xc2\x2b\xab\x56\x9d\x69\x35\x9a\xda\xbe\xf8\x0f\x1c\x1d\x13\x00\x0a\x6d\xb1\xcf\x98\x77\xae\xe9\x70\xae\x3b\xd4\xed\x95\x8f\x9c\xdc\xef\x64\x42\x96\x29\x1d\x75\xee\xbd\x21\xa5\x65\x75\xd4\x9e\x5c\xeb\x0d\x4d\x2a\x5f\x28\x1d\x3e\xdb\xf1\xc7\xed\xe9\xd4\x7b\xa2\x79\x57\xee\x6c\xfa\xfe\x94\xf5\xcd\xc6\xfe\xb1\x65\x6c\xf4\x7e\xf9\x47\xa9\xfb\x9d\xf1\xd5\x66\x73\xef\xba\x1e\xa9\xea\xf5\xde\x25\xf1\xdc\x51\x3f\xe6\xed\xbf\xc7\x4c\x38\xea\x3c\x6f\xdf\x88\xfd\xd4\x7f\x25\xf5\x23\xd8\xd3\x1f\x86\x95\xf4\x16\x54\xb1\x2c\x9b\x86\x99\xe5\x59\xd6\x34\x93\xfc\x29\x6b\xea\x39\x9e\xd9\xe1\xb6\x63\x5a\x7a\x5a\x1b\x7a\x04\xea\xa7\xfd\x3d\x97\x41\x17\xb9\x44\x8d\xc7\x38\x31\x10\xbe\x01\xc7\x17\xa1\xfe\x7d\x73\x7e\x53\x41\xa9\x4b\x70\x1c\x9f\x82\x16\xfa\xf3\x4f\x70\xb4\x00\xf1\x17\xb3\x30\xd6\xeb\xd1\x35\x8c\xf5\x5d\xc1\x8a\xde\x9b\x98\xa7\x73\xd1\x39\x40\xda\xef\xd4\x43\xb6\x4c\xd2\xbe\xd5\x5c\x4f\x7f\x3b\xe2\x79\x7e\x84\x78\xee\x6d\x58\x1e\x49\x1b\xa2\x9b\xf3\x8f\xd5\x10\xf9\x52\xc6\xc1\xff\x4c\x80\x8e\xb7\x7a\x1a\xbd\xdd\xc5\x6d\xfb\xae\x6d\xf2\xb0\x08\x0d\xbf\x57\xb6\x86\x4f\xb8\x50\xa9\x30\x9b\x41\x96\x66\x36\x78\xc9\xbe\x2a\x79\xaa\xd8\x09\x6e\x91\x47\x9f\x31\xca\x36\x0f\xe3\x88\x4c\xd7\x25\xd8\x5f\xde\xcf\xb1\x9a\xb5\x1a\x58\xa5\xd7\xf2\xd2\xae\x6d\x35\x3b\x87\x98\x88\xb7\x3b\x01\x5b\x1e\xc7\xbb\x49\xd5\x3f\x9d\x3a\xfe\x76\xaa\xbf\x49\xd5\xdb\x0e\x16\x78\x13\x51\x56\x9c\xb9\x5d\xff\xd9\x44\x8b\x06\xe8\xf7\x28\x35\xb2\xef\x29\x6f\x7c\x8f\x0a\x8c\x88\x4e\x73\x69\xa4\xca\xc7\xca\x0a\x1e\x56\xc0\x94\x04\x16\x76\xce\x1e\xdf\xa3\x72\x02\xf5\x0c\x41\x2c\x14\x3e\x2b\x3d\x53\xfd\xff\x08\x58\x08\x19\x5e\xb4\xb7\x48\xd8\x39\x2d\x0f\x3a\x02\x4c\x92\x38\xa1\x84\xa2\x39\x45\xf4\xcc\x97\x42\xdd\x27\x93\x6b\x87\x85\xae\xeb\xdd\x08\xbe\xd2\x83\xbb\x36\x2f\x7e\x8f\xea\x37\xfd\x99\xc6\xd9\x37\xd4\x8d\x11\x3c\xa4\x0a\x16\xbe\x60\x81\xd4\xb1\xf6\x85\x19\x11\xe2\x20\x48\x13\xb9\x8f\x8d\xbf\x75\x37\xb2\x62\x63\x96\x3b\x7b\x9f\x8b\x01\xc8\xee\xa6\x55\x60\x7d\xa9\xd5\xba\xfd\x1e\x8b\x48\xee\x87\x4b\x10\x8c\x53\xd2\x45\x96\x38\x98\x24\xae\x0e\x6e\xd9\x67\x65\xf5\xd6\x19\xef\x58\x22\x8b\x70\xeb\x84\x34\xa2\x27\x4d\x61\x67\xa2\xf4\xdd\x00\x9f\x6d\x9f\xd3\xb7\x49\xf2\x29\x56\xef\xe2\x54\x84\xf0\x34\x43\x01\x22\xd6\xdd\x79\xfc\xa4\xbf\x96\x73\x25\x4f\xbe\x84\x48\x0b\x75\x76\x28\xcd\xad\xc9\xa3\xbb\x20\xa2\xd3\x61\x9e\x26\xf4\x8d\xdd\xc5\x9b\xe6\x33\xec\xcc\xf5\xae\x38\x37\x28\x69\x70\xa9\xf5\xa1\x60\x9c\xf4\x90\x5f\x59\x04\x1c\x85\xd3\x32\x9e\x0b\x97\x3a\x13\xad\x77\x3e\x29\x39\x6b\x0d\x75\xc4\x7e\xf0\x1f\x90\x6f\x6a\x51\x6b\xd2\x7e\xf7\xfa\x7e\xa4\x15\x96\x83\x58\x60\x9a\x9a\xc7\x42\xb5\xd1\xdd\x1c\x85\xc3\x31\x9c\x87\x76\xcb\xdd\x27\x27\xf0\xc3\x44\x66\x3e\x22\x18\x1f\x88\xea\xc9\xf5\x4b\xb8\x66\xe1\x3e\x98\x66\xe1\xa1\x18\x9e\x5c\xb7\xa0\x78\x9b\x18\x8c\xc7\x0a\x38\x2f\xfd\x04\x58\x28\xe1\xee\xbe\x26\x48\x7e\x63\xa1\x34\x1d\x76\xe0\x7a\x72\x2d\xc9\xd1\xff\xdf\x0c\xea\x32\x96\x59\x28\x4b\xb8\x35\x7a\xbb\x21\xb6\xac\xcc\x86\x86\x85\xb2\x11\xa6\x93\xeb\x2a\x50\x27\xd7\xc7\x85\x6a\x9b\xb3\x6b\xfe\xd3\x26\xb2\x70\x37\x40\x8d\xaa\xbf\x08\x51\x16\x66\xe7\x31\x82\xaf\x2a\x88\x8c\xf5\x83\x97\x88\x76\x54\xec\xc5\x99\x5b\x58\x04\x22\x56\x80\xcf\x7e\xa0\xf8\x0a\x62\x81\x59\x47\x8d\x4f\x23\x8e\xdd\x21\x9a\xed\x8f\xff\x79\x96\x3d\xdf\x9f\x65\xed\x69\xc3\x4e\xa6\x5d\xf7\x4d\x36\x79\x76\x51\x28\x79\x89\x38\x4d\x8f\xd7\x17\x07\xf1\x73\x88\x91\x9f\x72\xd5\xd2\xf9\x96\x89\x69\xca\xfd\x64\x17\xbf\x17\x88\x28\x68\x5b\xb7\x8e\xb5\x14\x48\xf3\xb1\x49\xbb\x48\xa4\xfe\x6a\xd6\xa1\x35\xd5\xe8\x79\x7b\x31\xd4\xd8\xb9\xdb\x42\xb0\x24\x7d\xd0\x22\xf8\x7e\x34\x7d\xde\x8d\xa6\x4b\x8b\x81\xa8\xba\x02\x7c\x16\xc2\xa5\x25\xdd\x32\xba\xf7\x61\xf1\x12\xae\x2b\xdd\xba\x20\x3a\x9b\x67\x09\xd9\x25\xa6\x37\xee\x3d\x2a\xba\x8f\xc3\xf3\x45\xdc\xf7\x40\x75\x4e\xe9\x57\x9c\x03\x3e\x63\x90\x2a\x94\x05\x52\xc1\x17\x61\xe9\x0b\x8a\x33\xa9\x20\x8e\x2a\x94\x64\x31\xde\xd9\x62\x4b\x9b\x0d\xd8\xbc\xbb\x6f\x25\xe9\x3d\x4e\x6a\xbb\x1d\xd4\xb6\x7c\x7e\xc9\x47\x5e\xd0\x7a\xdb\x77\x7d\x4b\x5f\xfb\x55\x5b\xf4\x6f\xe1\x56\xb2\x4a\x7a\x9f\xf0\xc9\x19\xac\xd7\xd9\x8d\xdf\x05\xa4\x42\xa6\x8b\x45\x9c\x28\x0c\xb3\x51\x07\x6e\xc1\xb0\x57\x9c\x17\x04\x7b\xc5\xf9\xb1\x10\xa8\xf5\x36\x07\xa4\x16\x8f\x43\x36\xcb\x5d\x7b\x64\x2b\xcd\x36\x8d\x60\x9d\x30\xb9\x96\x7b\xa1\xb4\x4c\xc1\xdd\x5d\x62\x09\xac\x11\xa2\x4d\xec\xf9\xdf\x07\x69\x46\xb1\x87\x82\xb4\xe8\x7f\x5c\x90\x4e\xae\x65\x01\xd2\xc9\xb5\x3c\x16\x48\xb5\xde\x36\x90\x36\xb2\xa4\x6c\x85\x64\x61\x7a\x77\x8e\x94\xd6\xbc\x37\x71\x2a\xaa\x47\x0c\x01\x3d\x89\x23\x6a\x4c\xd9\x12\xc5\x9e\x97\x91\xa4\xb2\x6d\xb3\x16\xea\x3b\xe1\x2b\x9f\xd5\xc1\x08\x2b\x6b\xd8\xc6\xd8\xeb\x83\x11\x46\x7a\x0b\x8c\x51\xf3\x58\x28\x33\xba\x9b\x83\xc1\x84\xad\x5d\x48\x6d\x50\x9a\xb0\x55\x36\xba\x2b\xba\x48\xa3\x35\xee\xed\x33\x2b\x1f\x61\x25\x29\x9d\xd8\x16\x3c\x37\xf3\x25\x20\xc7\x39\x0a\x25\xb3\x8c\x72\x9a\xf8\x8b\x59\x67\x13\x69\x84\x16\xb8\x3d\xc4\x31\xff\x4e\x78\xcb\xa7\x75\x30\xde\xca\x1a\xb6\xf1\x16\xf9\x5c\xe2\xc1\x98\x23\xdd\x05\xe6\xa8\x79\x2c\xcc\x19\xdd\xcd\x11\xd1\x01\xd1\xde\x45\x33\x60\x0b\xe8\xca\x96\x77\x05\x1d\x69\xec\xdb\x5a\xa2\x69\x12\xa7\x8b\x9f\x4b\xc5\x02\x95\xc2\x9e\x3f\x4d\xf1\x40\x04\x83\xff\x93\xef\x49\xd2\xd4\x0a\xd0\xf9\xb3\x69\x43\x2a\x31\x04\x15\x03\x69\x82\x25\x26\x8a\x05\x28\xe1\xc1\x7c\xc8\xc4\x09\xcc\xe3\x04\x21\x62\xc8\x43\x39\x0e\xec\xed\x19\xed\x17\x4a\x7b\x35\x8e\x14\x0a\xa3\xc4\x5c\x4f\x4d\xa7\x09\x4e\xa9\xe0\x26\x15\x81\x62\xb1\x90\x23\x72\x3d\x5d\xe6\x7f\x8d\x99\x00\xe7\x1b\xae\x64\x21\xe8\xc2\x60\x04\x03\x4a\x43\xd7\xeb\x57\x46\x0b\x47\x01\x43\xef\x1d\x0d\x6a\xca\xa0\x5e\xc1\x30\xd2\x06\x32\x11\xe2\x73\xf1\xee\xb5\x7e\x3b\x1e\x9b\x48\xfb\xf3\x05\xc7\x0b\xd3\xa4\x6f\xa1\xa5\x29\x42\x32\xb5\x4b\xe3\x31\x5d\xe6\x67\x1e\x8a\x8a\xdc\x68\xad\x5b\xd9\x16\xf4\x87\x69\xde\x52\xb7\x2f\xbe\x06\xd9\x1f\xd4\xd7\x6c\x20\x9a\x4b\xfe\xf8\x2a\x63\x71\x31\x30\x7c\x12\xcf\x99\xc2\xf9\x42\xad\x06\x24\x66\x67\xd3\xb3\x95\x1f\x0d\xb5\x56\x9e\xbd\x38\xf2\x48\xab\x0d\x43\xe3\x55\x4a\x54\xbd\x4a\x21\xf9\xab\xcc\x6d\x4e\xb1\x08\x2c\x77\xb9\x56\xe4\x36\xf0\x85\x39\x9a\x3f\x59\xba\x7a\x3a\xa5\xab\x97\xae\x97\x08\x76\x56\x14\x76\x30\x75\x5c\x23\x0b\x02\xf0\x3c\xcf\x3c\xb1\x5f\xf1\x15\x0c\x9a\x4d\xdc\x80\x29\xab\xee\xa8\x09\xbc\x5c\xdd\x41\x1d\x3c\x3b\x5c\x5e\xb7\x93\x15\x94\xad\xe9\xc5\x26\x9b\x8f\x29\xdb\x39\x3a\xe1\x99\x39\x98\x3b\xcc\x06\xd6\xcb\x6f\xff\xda\x28\xcf\xf4\x2f\x2e\xce\x5e\xba\x45\x2c\x16\x38\xf5\xd4\x0b\x5c\xaf\x70\x53\x56\xf4\xac\x74\xfc\x86\x30\xb0\x5e\x1c\x14\xe1\x1a\x58\xd0\x14\xf5\x87\xbd\x4a\xfd\xa1\x9d\xda\x58\x3e\xf2\xb1\x2d\x72\xf4\x6c\x65\x61\x76\xdd\xd6\x65\x98\x56\xbd\xd6\x8e\x36\xdd\x05\x4b\x7d\x6e\x2c\x63\xac\x61\xa3\x63\x2d\x23\xf5\x7a\xf5\xb0\xea\x5a\xcb\x58\x87\xe8\x76\x41\xa3\x05\x5b\x51\xb4\x18\x09\x09\x00\x70\x77\x9f\xaf\xb8\x2e\xc5\x8a\x7b\x55\x2b\xe6\x9a\x4d\x79\x5c\x91\x86\x66\xdc\xc8\x62\x51\xd0\x68\x56\x30\x97\xdb\xbe\x95\xac\x56\xdd\x9c\xad\xeb\x9a\xed\x6e\x31\xac\xa3\x6d\xf4\x3c\xef\xaa\xa0\xe2\xb6\x05\xdd\xa4\xde\xd3\xdd\x2b\x55\x75\x4d\x12\x23\x88\xc4\x76\x55\x63\x5d\xd2\x7a\x44\x53\x97\x56\xc8\x99\xfd\x46\xac\x1a\x4b\x1f\x8b\x52\xcb\xe8\x77\x09\xca\x94\x13\x23\xc7\x25\xdf\x2d\x7d\x9e\xe2\x01\x5e\xc9\x58\x73\xfb\xde\x74\x69\x82\x1e\xf9\x01\xae\x37\xae\x4d\x15\xaa\x39\xd6\x96\xe1\x47\x49\xb4\xb6\xb4\xca\x47\x5e\x90\xfb\xb2\x5b\xbe\xb5\xa5\xc4\x42\xb2\xaa\x68\x3b\xed\xaa\xe7\x5b\x75\x3d\x2f\x66\x5e\x7a\x80\x22\xf1\xd2\xad\x3d\xf2\xae\x3d\x82\xd6\x72\xdb\x5d\x8b\xda\x3a\x4f\xb0\x6c\x1a\xb6\xe5\x97\xb2\x43\xb6\x8e\x3f\xab\xa9\x98\xe1\xcc\x52\x21\xa7\xb2\x85\x9a\x73\xa6\xd8\xb2\x54\xcb\x19\x95\x73\x32\xa5\xf3\x31\x73\x3e\x62\xeb\x35\x8d\xc8\x66\x93\x7f\x36\x34\x1c\xd2\xe9\xbd\x1f\xa2\x24\x9e\xe7\x6b\xc1\xcb\x52\x2f\xc1\x57\xe0\x73\x1e\x3f\xa1\xbd\x1e\xcc\x4b\xbc\xf3\x65\x43\xbc\xae\x13\x39\xe2\xb7\x4a\x4d\x67\x47\x17\x67\x73\xdc\x79\xaa\xa2\x6a\xc7\x29\xa5\x6b\xe9\x06\x52\x20\xaa\x75\xe1\x6f\x70\x46\xb2\x9d\x0e\x2f\x1a\xe6\xe6\xe5\xee\x63\x92\x4e\xe0\xfd\x60\xc6\x70\xe9\x3f\x70\x34\xee\x20\x79\xed\x0e\x4a\x61\xd5\xcc\x17\x70\x66\x1c\xa1\x71\x4a\x45\x28\x59\x96\x98\x19\x61\xa6\xde\x0d\x26\x27\x0d\x38\xd9\xbe\x3d\x2a\xd7\xba\x2c\xed\xad\xcf\xa6\x5f\x09\x7f\xb1\x4a\xb2\x27\x2f\xae\x94\xc3\xe3\xb8\xf3\x2c\x46\x65\xe5\xb9\xcb\xd1\x4e\x27\x94\x41\xe1\x16\x3e\x2b\x3b\xa2\xbc\x62\x2a\x3e\xa8\xd5\xfa\xec\x4a\x3e\xea\xc9\x41\x7b\x66\x43\x92\xfb\x65\x36\xdd\x94\x67\xe9\x4d\xfb\x00\xf6\xe7\xbf\x03\x00\x00\xff\xff\x53\x3d\x5d\x54\x4c\x32\x00\x00") +var _templateBuilderQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x5a\x6f\x6f\xdb\x38\xd2\x7f\x2d\x7f\x8a\x59\xc3\x4f\x60\x05\xae\xdc\x64\xf7\x55\x1e\xe4\x80\x6e\xd3\x16\xbe\x6b\x9b\xdd\xa6\xb8\x5b\x20\x08\x76\x15\x69\x64\xb3\xa5\x29\x47\xa4\x9c\x18\xae\xbf\xfb\x81\x43\xea\xaf\x25\x47\x76\x7d\xd7\x2b\x10\xd4\x94\x86\xc3\xe1\xcc\x8f\x3f\x8e\xc8\x59\xaf\x21\xc4\x88\x09\x84\xfe\x43\x8a\xc9\xaa\x0f\x9b\x4d\x6f\xbd\x86\xc1\xe2\xeb\x14\x2e\x2e\xe1\xde\x97\x08\x03\xef\x75\x2c\x22\x36\xf5\x7e\xf3\x83\xaf\xfe\x14\xad\x8c\xc2\xf9\x82\xfb\x0a\xa1\x3f\x43\x3f\xc4\xa4\x6f\x7a\x6d\x36\xbd\xea\x5b\x36\x5f\xc4\x89\xea\xc3\x20\x7b\x35\xb8\x4f\x19\x0f\x31\xd1\x03\x2c\x12\x26\x14\x0c\x17\xbe\x0c\x7c\x0e\x03\xef\xa3\x3f\x47\x17\xfa\xbf\x57\x8c\x49\x30\x40\xb6\x34\x1d\xf2\xdf\xb9\x16\xad\x75\x3c\x86\xb2\xe2\xcd\x06\x98\x04\x35\x43\xc8\x9e\x44\x71\x02\x34\x43\x26\xa6\x5a\xb4\x32\xa0\x96\x47\xa1\x98\x62\x28\xbd\x9e\x5a\x2d\xb0\xae\x4d\xaa\x24\x0d\x14\xac\x7b\x4e\x40\xae\xe8\x39\x9c\xcd\x99\x72\x9c\x53\x26\x54\xcf\x89\xa3\x48\x62\xd1\x4a\x42\x4c\x1c\xe7\xf6\xee\x5a\xff\xe8\x39\xa9\x60\x0f\x29\xea\x07\x52\x25\x4c\x4c\x7b\xce\x22\xc1\x90\x05\xbe\x42\x09\xce\xed\x1d\x0a\xe5\xfd\x96\x3d\xe9\x39\xe3\x31\x30\xa1\x30\x99\x63\xc8\xb4\x03\xb5\xd9\x64\x98\x23\x1f\x38\xe8\x7f\xa7\xf2\x81\x7b\x37\xc8\x31\x50\x71\xd2\x73\xa6\x09\xce\x39\x13\x70\x1a\x4a\xee\x7d\x4e\xfc\x25\x26\xd2\xe7\x3d\xe3\x96\x7f\xcd\x30\x41\xf0\xc3\x50\x82\x0f\x02\x1f\x21\x1f\x9b\x7c\x52\xf2\x91\xd7\x8b\x52\x11\xc0\xb0\xe2\xf1\xcd\x06\x4e\xab\xbe\x70\x8d\xca\xe1\x42\x82\xe7\x79\x15\xdb\xdd\xba\xac\x76\x58\x59\xdd\x66\xe3\x95\xa6\x7e\x09\xfe\x62\x81\x22\xac\x8f\x58\x92\x19\xc1\x42\x7a\x9e\xe7\xf6\x9c\x04\x55\x9a\x08\xa8\x89\xda\x49\xbe\xd7\xc1\xc8\x26\x49\x91\x01\xa9\x70\x01\x2a\xa6\x09\x52\xe0\x3b\x4f\x8f\x94\x0d\x8d\x16\x26\xd4\xb3\x93\xd2\x16\x1b\xe9\x4b\x38\xa1\x1f\xcf\x58\x7b\x4d\x68\xb1\xe6\x0a\x30\xe0\xf9\x0e\x83\x8d\xbe\xa1\xd5\xd3\xd5\x64\x2b\x7e\x09\x27\xe6\xd7\x73\x46\x6b\x2c\x17\x36\x53\xeb\x3b\x4c\xd6\xfd\x87\xb1\x46\x10\xfd\xec\x66\x31\x0d\xda\x8a\x1a\x7a\x3d\x82\xf8\x39\xbc\xac\xd7\xe3\x53\x50\x33\x26\x21\x88\x43\x84\x99\x2f\x41\xb2\x39\xe3\x7e\xc2\xd4\x0a\x1e\x99\x9a\x01\x86\xd3\x7c\xdd\x01\x13\x10\x70\xa6\x81\xae\xe6\x0b\x0e\xa7\x63\xc3\x4a\x89\x2f\xa6\x08\x83\x3f\x47\x30\x40\x4d\x4c\x03\xef\x4d\x38\x45\xa9\x07\x21\xcb\xb5\x8e\x3f\xdb\x99\x0e\xbd\xcf\xab\x05\x6e\xf3\x9d\x5e\xfe\xd4\x2a\x91\x14\xe6\x2c\x15\xcc\x7c\x26\x0c\xb3\x05\x69\x92\xa0\x50\xc6\xf1\x10\x0b\x7a\x48\x03\x17\x9c\x16\x4e\xd1\xeb\x39\x1d\x63\xd2\x3a\xea\xd0\x46\xa7\x32\x23\x13\x22\xc7\x8c\x7e\x71\x09\x27\x0d\x12\x6b\x43\x96\x17\xf5\x28\x78\xe6\xf9\xa6\xe7\x38\xf2\x91\xa9\x60\xb6\x25\x10\x26\xfa\x97\x77\xc5\x7c\x4d\x72\x43\x97\xc6\x0a\xf4\x66\x14\x9a\x47\xde\x87\xd5\xcd\xef\xef\x47\x79\xf3\xe6\xf7\xf7\x4c\xe1\x45\xcf\x71\x9c\xf5\xfa\x05\xb0\x48\xdb\xff\xe1\xfc\x03\x90\x4f\xe9\x29\x0c\x98\x36\xf4\x4c\x1b\xb6\x86\xc1\x17\xdd\x78\x49\x8d\x4c\x7e\x22\x27\x42\x93\x27\x5a\x11\x06\x99\x84\x16\xcf\xbb\xa2\x08\xe1\x85\x55\xab\xce\xb4\x1a\xcd\xc7\x9f\xfd\x7b\x8e\x43\x13\x00\x0a\x6d\xb1\x5b\x9a\x77\xae\xe9\x70\xae\x3b\xd4\xe7\x2b\x1f\x38\xb9\x7f\x98\x09\x59\x7a\x1f\xaa\x73\xef\x35\x29\x2d\xab\xa3\xf6\xe4\x4a\x6f\xcb\x52\xf9\x42\xe9\xf0\xd9\x8e\x3f\x6f\x9b\x53\xef\x89\xe6\x5d\xb9\xb3\xe9\xfb\x4b\xd6\x37\x1b\xfb\xe7\x96\xb1\xd1\xfb\xed\x1f\xa5\xee\xb7\xc6\x57\x9b\xcd\x9d\xeb\x7a\xa4\xca\x71\xde\x26\xf1\x7c\xa8\x7e\xce\xdb\x7f\x8f\x99\x18\xaa\xf3\xbc\x7d\x2d\xf6\x53\xff\x85\xd4\x8f\x60\x4f\x7f\x18\x56\xd2\xfb\x66\x65\x66\x99\x19\xc6\xca\xb3\xac\x69\x8c\xfc\x25\x6b\x6a\x1b\xcf\xec\x70\xdb\x31\x2d\x3d\xad\x0d\x3d\x02\xf5\xcb\xfe\x9e\xcb\xa0\x8b\x5c\xa2\xc6\x63\x9c\x18\x08\x5f\xc3\xd0\x17\xa1\xfe\x7d\x7d\x7e\x5d\x41\xa9\x4b\x70\x1c\x9f\x82\x16\xfa\xf6\x0d\x86\x5a\x80\xf8\x8b\x59\x18\xeb\xf5\xe8\x1a\xc6\xfa\xa1\x60\x45\xef\x75\xcc\xd3\xb9\xe8\x1c\x20\xed\x77\xea\x21\x5b\x8c\xb4\x6f\x35\xd7\xd3\xdf\x8e\x78\x9e\x1f\x21\x9e\x7b\x4f\x2c\x8f\xa4\x0d\xd1\xf5\xf9\x87\x6a\x88\x7c\x29\xe3\xe0\x7f\x26\x40\xc7\x5b\x3d\x8d\xde\xee\xe2\xb6\x7d\xd7\x36\x79\x58\x84\x86\xdf\x2b\x5b\xc3\x47\x5c\xa8\x54\x98\xcd\x20\xcb\x8d\x1b\xbc\x64\x5f\x95\x3c\x55\xec\x04\x37\xc8\xa3\x4f\x18\x65\x9b\x87\x71\x44\xa6\xeb\x12\xec\x2f\xef\xd7\x58\xcd\x5a\x27\x58\xa5\xd7\xf2\xd2\xae\x6d\x35\x3b\x87\x98\x88\x37\x3b\x01\x5b\x1e\xc7\xbb\x4e\xd5\x3f\x87\x75\xfc\xed\x54\x7f\x9d\xaa\x37\x1d\x66\xe0\x4d\x44\x59\x71\xe6\x76\xfd\x67\x13\x2d\x1a\xa0\xe7\x50\x6a\x64\xdf\x53\xde\xf8\x0e\x15\x18\x11\x9d\x9b\xd3\x48\x95\x4f\xae\x15\xdc\xaf\x80\x29\x09\x2c\xec\x9c\x3d\xbe\x43\x35\x0c\xd4\x13\x04\xb1\x50\xf8\xa4\xb4\xa5\xfa\xff\x11\xb0\x10\x32\xbc\x68\x6f\x91\xf0\xf0\xb4\x3c\xe8\x08\x30\x49\xe2\x84\x12\x8a\xe6\x14\xd1\x33\x9f\x37\x75\x9f\x4c\xae\x86\x2c\x74\x5d\xef\x5a\xf0\x95\x1e\xdc\xb5\x79\xf1\x3b\x54\x7f\xe8\x8f\x4d\xce\xbe\xa2\x6e\x8c\xe0\x3e\x55\xb0\xf0\x05\x0b\xa4\x8e\xb5\x2f\xcc\x88\x10\x07\x41\x9a\xc8\x7d\xe6\xf8\x47\xf7\x49\x56\xe6\x98\xe5\xce\xde\xa7\x62\x00\x9a\x77\xd3\x2a\xb0\xbe\xd4\x6a\xdd\x9e\xc3\x22\x92\xfb\xe9\x12\x04\xe3\x94\x74\xd1\x4c\x86\x98\x24\xae\x0e\x6e\xd9\x67\x65\xf5\xd6\x19\x6f\x59\x22\x8b\x70\xeb\x84\x34\xa2\x27\x4d\x61\x67\xa2\xf4\xdd\x00\x9f\x6c\x9f\xd3\x37\x49\xf2\x31\x56\x6f\xe3\x54\x84\xf0\x38\x43\x01\x22\xd6\xdd\x79\xfc\xa8\xbf\xf9\x73\x25\x8f\xbe\x84\x48\x0b\x75\x76\x28\xd9\xd6\xe4\xd1\x5d\x10\xd1\xe9\x30\x4f\x13\x3a\x29\xe8\xe2\x4d\xf3\xed\x78\xe6\x7a\xaf\x38\x37\x28\x69\x70\xa9\xf5\xa1\x60\x9c\xf4\x90\x5f\x59\x04\x1c\xc5\xb0\x65\x3c\x17\x2e\x75\x26\x5a\xef\x7c\x52\x72\xd6\x1a\xea\x88\x7d\xef\xdf\x23\xdf\xd4\xa2\xd6\xa4\xfd\xf6\xe5\xdd\x48\x2b\x2c\x07\xb1\xc0\x34\x35\x8f\x85\x6a\xa3\xbb\x39\x0a\x87\x63\x38\x0f\xed\x96\xbb\x4f\x4e\xe0\xa7\x89\xcc\x7c\x44\x30\x3e\x10\xd5\x93\xab\xe7\x70\xcd\xc2\x7d\x30\xcd\xc2\x43\x31\x3c\xb9\x6a\x41\xf1\x36\x31\x18\x8f\x15\x70\x5e\xfa\x09\xb0\x50\xc2\xed\x5d\x4d\x90\xfc\xc6\x42\x69\x3a\xec\xc0\xf5\xe4\x4a\x92\xa3\xff\xbf\x19\xd4\x65\x2c\xb3\x50\x96\x70\x6b\xf4\x76\x43\x6c\x59\x99\x0d\x0d\x0b\x65\x23\x4c\x27\x57\x55\xa0\x4e\xae\x8e\x0b\xd5\x36\x67\xd7\xfc\xa7\xa7\xc8\xc2\xdd\x00\x35\xaa\xbe\x13\xa2\x2c\xcc\xce\x63\x04\x5f\x55\x10\x19\xeb\x07\xcf\x11\xed\xa8\xd8\x8b\x33\xb7\xb0\x08\x44\xac\x00\x9f\xfc\x40\xf1\x15\xc4\x02\xb3\x8e\x1a\x9f\x46\x1c\xbb\x43\x34\xdb\x1f\xff\xf3\x2c\x7b\xbe\x3f\xcb\xda\xd3\x86\x9d\x4c\xbb\xee\x99\x6c\xf2\xec\xa2\x50\xf2\x1c\x71\x9a\x1e\x2f\x2f\x0e\xe2\xe7\x10\x23\x3f\xe5\xaa\xa5\xf3\x0d\x13\xd3\x94\xfb\xc9\x2e\x7e\x2f\x10\x51\xd0\xb6\x6e\x1d\x6b\x29\x90\xe6\x63\x93\x76\x91\x48\x7d\x6f\xd6\xa1\x35\xd5\xe8\x79\x7b\x31\xd4\xd8\xb9\xdb\x42\xb0\x24\x7d\xd0\x22\xf8\x71\x34\x7d\xde\x8d\xa6\x4b\x8b\x81\xa8\xba\x02\x7c\x16\xc2\xa5\x25\xdd\x32\xba\xf7\x61\xf1\x12\xae\x2b\xdd\xba\x20\x3a\xb3\xb3\x84\xec\x12\xd3\x1b\xf7\x1e\x15\xdd\xc7\xe1\xf9\x22\xee\x7b\xa0\x3a\xa7\xf4\x57\x9c\x03\x3e\x61\x90\x2a\x94\x05\x52\xc1\x17\x61\xe9\x0b\x8a\x33\xa9\x20\x8e\x2a\x94\x64\x31\xde\x79\xc6\x96\x36\x1b\xb0\x79\x7b\xd7\x4a\xd2\x7b\x9c\xd4\x76\x3b\xa8\x6d\xf9\xfc\x92\x0f\xbc\xa0\xf5\xb6\xef\xfa\x96\xbe\xf6\xab\xb6\xe8\xdf\xc2\xad\x34\x2b\xe9\x7d\xc4\xc7\x61\x7f\xbd\xce\xee\x2d\x2f\x20\x15\x32\x5d\x2c\xe2\x44\x61\x98\x8d\xda\x77\x0b\x86\x7d\xc5\x79\x41\xb0\xaf\x38\x3f\x16\x02\xb5\xde\xe6\x80\xd4\xe2\x71\xc8\x66\xb9\x6b\x8f\x6c\xa5\xd9\xa6\x11\xac\x13\x26\x57\x72\x2f\x94\x96\x29\xb8\xbb\x4b\x2c\x81\x35\x42\xb4\x89\x3d\xff\xfb\x20\xcd\x28\xf6\x50\x90\x16\xfd\x8f\x0b\xd2\xc9\x95\x2c\x40\x3a\xb9\x92\xc7\x02\xa9\xd6\xdb\x06\xd2\x46\x96\x94\xad\x90\x2c\xa6\xde\x9d\x23\xa5\x9d\xde\xeb\x38\x15\xd5\x23\x86\x80\x9e\xc4\x11\x35\xa6\x6c\x89\x62\xcf\xcb\x48\x52\xd9\xb6\x59\x0b\xf5\x83\xf0\x95\x5b\x75\x30\xc2\xca\x1a\xb6\x31\xf6\xf2\x60\x84\x91\xde\x02\x63\xd4\x3c\x16\xca\x8c\xee\xe6\x60\x30\x61\x2b\x30\x52\x1b\x94\x26\x6c\x95\x27\xdd\x15\x5d\xa4\xd1\x4e\xee\xcd\x13\x2b\x1f\x61\x25\x29\x9d\xd8\x16\x3c\x37\xf3\x25\x20\xc7\x39\x0a\x25\xb3\x8c\x72\x9a\xf8\x8b\x59\xe7\x29\xd2\x08\x2d\x70\xbb\x8f\x63\xfe\x83\xf0\x96\x9b\x75\x30\xde\xca\x1a\xb6\xf1\x16\xf9\x5c\xe2\xc1\x98\x23\xdd\x05\xe6\xa8\x79\x2c\xcc\x19\xdd\xcd\x11\xd1\x01\xd1\xde\x45\x33\x60\x0b\xe8\xca\x33\xef\x0a\x3a\xd2\xd8\xb3\x15\x51\xd3\x24\x4e\x17\xbf\x96\x8a\x05\x2a\xe5\x49\xdf\x4c\xf1\x40\x04\xfd\xff\x93\xef\x48\xd2\xd4\x0a\xd0\xf9\xb3\x69\x43\x2a\x31\x04\x15\x03\x69\x82\x25\x26\x8a\x05\x28\xe1\xde\x7c\xc8\xc4\x09\xcc\xe3\x04\x21\x62\xc8\x43\x39\x0e\xec\xed\x19\xed\x17\x4a\x7b\x35\x8e\x14\x0a\xa3\xc4\x5c\x4f\x4d\xa7\x09\x4e\xa9\x4a\x28\x15\x81\x62\xb1\x90\x23\x72\x3d\x5d\xe6\x7f\x89\x99\x80\xe1\x57\x5c\xc9\x42\xd0\x85\xfe\x08\xfa\x94\x86\xae\xd7\x2f\x8c\x16\x8e\x02\x06\xde\x5b\x1a\xd4\x14\x73\xbd\x80\x41\xa4\x27\xc8\x44\x88\x4f\xc5\xbb\x97\xfa\xed\x78\x6c\x22\xed\xcf\x17\x1c\x2f\x4c\x93\xbe\x85\x96\x40\xa5\x53\xa6\x02\x6b\x3c\xa6\xcb\xfc\xcc\x43\x51\x91\x1b\xad\x75\x2b\xdb\x82\xfe\x32\xcd\x1b\xea\xf6\xd9\xd7\x20\xfb\x8b\xfa\x9a\x0d\x44\x73\xc9\x5f\x5f\x64\x2c\x2e\xfa\x86\x4f\xe2\x39\x53\x38\x5f\xa8\x55\x9f\xc4\xac\x35\x8e\xad\xfc\x68\xa8\x18\xf3\xec\xc5\x91\x47\x5a\x6d\x18\x1a\xaf\x52\xa2\xea\x55\x0a\xc9\xbf\xca\xdc\x36\x2c\x16\x81\xe5\x2e\xd7\x8a\xdc\x04\xbe\x30\x47\xf3\x27\x4b\x57\x9b\x53\xba\x7a\xe9\x7a\x89\x60\xad\xa2\xb0\x83\xa9\x3e\x1b\x59\x10\x80\xe7\x79\xe6\x89\xfd\x8a\xaf\x60\xd0\x6c\xe2\x06\x4c\x59\x75\x47\x4d\xe0\xf9\xea\x0e\xea\xe0\xd9\xe1\xf2\xba\x9d\xac\x0c\x6e\x4d\x2f\x36\x99\x3d\xa6\x6c\xe7\xe8\x84\x67\x6c\x30\x77\x98\x0d\xac\x97\xdf\xfe\xb5\x51\x9e\xe9\x5f\x5c\x9c\x3d\x77\x8b\x58\x2c\x70\xea\xa9\x17\xb8\x5e\xe1\xa6\xac\xe8\x49\xe9\xf8\x0d\xa0\x6f\xbd\xd8\x2f\xc2\xd5\xb7\xa0\x29\xaa\x28\x9d\x4a\x15\xa5\x35\x6d\x2c\x1f\xf8\xd8\x96\x6a\x7a\xb6\x3e\x32\xbb\x6e\xeb\x32\x4c\xab\x5e\x3b\x8f\x36\xdd\x05\x4b\x7d\x6a\x2c\xc6\xac\x61\xa3\x63\x45\x26\xf5\x7a\x71\xbf\xea\x5a\x91\x59\x87\xe8\x76\x59\xa6\x05\x5b\x51\x6a\x19\x09\x09\x00\x70\x7b\x97\xaf\xb8\x2e\x15\x96\x7b\x95\x58\xe6\x9a\x4d\x79\x5c\x91\x86\x66\xdc\xc8\x62\x51\xd0\x68\x56\x30\x97\xcf\x7d\x2b\x59\xad\xba\x39\x5b\xd7\xb5\xb9\xbb\xc5\xb0\x43\x3d\x47\xcf\xf3\x5e\x15\x54\xdc\xb6\xa0\x9b\xd4\x7b\xba\x7b\xa5\xaa\xae\x49\x62\x04\x91\xd8\x2e\xc5\xac\x4b\x5a\x8f\x68\xea\xd2\x0a\x39\xb3\xdf\x88\xd5\xc9\xd2\xc7\xa2\xd4\x32\xfa\x5d\x82\x32\xe5\xc4\xc8\x71\xc9\x77\x4b\x9f\xa7\x78\x80\x57\x32\xd6\xdc\xbe\x37\x5d\x9a\xa0\x47\x7e\x80\xeb\x8d\x6b\x53\x85\x6a\x8e\xb5\x35\xf1\xa3\x24\x5a\x5b\x5a\xe5\x03\x2f\xc8\x7d\xd9\x2d\xdf\xda\x52\x62\x21\x59\x55\xb4\x9d\x76\xd5\xf3\xad\xba\x9e\x67\x33\x2f\x3d\x40\x91\x78\xe9\xd6\x1e\x79\xd7\x1e\x41\x6b\xb9\xed\xae\x45\x6d\x9d\x27\x58\x36\x0d\xdb\xf2\x4b\xd9\x21\x5b\xc7\x9f\xd5\x54\xcc\x70\x66\xa9\x90\x53\xd9\x42\xcd\x39\x53\x6c\x59\xaa\xe5\x8c\xca\x39\x99\xd2\xf9\x98\x39\x1f\xb1\xf5\x9a\x46\x64\xb3\xc9\x3f\x1b\x1a\x0e\xe9\xf4\xde\x0f\x51\x12\xcf\xf3\xb5\xe0\x65\xa9\x97\xe0\x2b\xf0\x39\x8f\x1f\xd1\x5e\x0f\xe6\x85\xea\xf9\xb2\x21\x5e\xd7\x89\x1c\xf1\x5b\xa5\xa6\xb3\xa3\x8b\x33\x1b\x77\x9e\xaa\xa8\xda\x71\x4a\xe9\x5a\xba\x81\x14\x88\x6a\x5d\xf8\x1b\x9c\x91\x6c\xa7\xc3\x8b\x06\xdb\xbc\xdc\x7d\x4c\xd2\x09\xbc\x1f\xcc\x18\x2e\xfd\x7b\x8e\xc6\x1d\x24\xaf\xdd\x41\x29\xac\x9a\xf9\x02\xce\x8c\x23\x34\x4e\xa9\x08\x25\xcb\x12\xb3\x49\x18\xd3\xbb\xc1\xe4\xa4\x01\x27\xdb\xb7\x47\xe5\x5a\x97\xa5\xbd\xf5\xd9\xf4\x2a\xe1\x2f\x56\x49\xf6\xe4\xd9\x95\x72\x78\x1c\x77\x9e\xc5\xa8\xac\x3c\x77\x39\xda\xe9\x84\x32\x28\xdc\xc2\x67\x65\x47\x94\x57\x4c\xc5\x07\xb5\x5a\x9f\x5d\xc9\x47\x3d\x39\x68\xcf\x6c\x48\x72\xbf\xcc\xa6\x9b\xf2\x2c\xbd\x69\x1f\xc0\xfe\xfc\x77\x00\x00\x00\xff\xff\x41\xd8\x55\x9d\x12\x33\x00\x00") func templateBuilderQueryTmplBytes() ([]byte, error) { return bindataRead( @@ -178,7 +167,7 @@ func templateBuilderQueryTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/query.tmpl", size: 12876, mode: os.FileMode(420), modTime: time.Unix(1560146912, 0)} + info := bindataFileInfo{name: "template/builder/query.tmpl", size: 13074, mode: os.FileMode(420), modTime: time.Unix(1561470397, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -198,7 +187,7 @@ func templateBuilderSetterTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/setter.tmpl", size: 2911, mode: os.FileMode(420), modTime: time.Unix(1557131143, 0)} + info := bindataFileInfo{name: "template/builder/setter.tmpl", size: 2911, mode: os.FileMode(420), modTime: time.Unix(1555862705, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -218,7 +207,7 @@ func templateBuilderUpdateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/update.tmpl", size: 7109, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/builder/update.tmpl", size: 7109, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -238,7 +227,7 @@ func templateClientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/client.tmpl", size: 5596, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/client.tmpl", size: 5596, mode: os.FileMode(420), modTime: time.Unix(1558976196, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -258,7 +247,7 @@ func templateConfigTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/config.tmpl", size: 1080, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/config.tmpl", size: 1080, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -278,7 +267,7 @@ func templateDialectGremlinCreateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/create.tmpl", size: 2567, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/create.tmpl", size: 2567, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -298,7 +287,7 @@ func templateDialectGremlinDeleteTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/delete.tmpl", size: 549, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/delete.tmpl", size: 549, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -318,12 +307,12 @@ func templateDialectGremlinGroupTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/group.tmpl", size: 1151, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/group.tmpl", size: 1151, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateDialectGremlinQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x56\xdf\x6b\xdb\x30\x10\x7e\xb6\xff\x8a\x5b\x29\x43\x2e\x46\xed\xf3\x4a\x06\xeb\x8f\x6d\x85\xae\xdb\xba\xd2\x97\x31\x86\x62\x9d\x83\xa8\x22\xb9\x92\x6d\x52\x82\xfe\xf7\x21\x59\x4e\x5d\x13\xb3\xb6\xd0\x3c\xd9\x39\xdd\x77\xdf\x77\x9f\xcf\xe7\xac\xd7\xc0\xb1\x14\x0a\x61\x8f\x0b\x26\xb1\xa8\x0f\x17\x06\x97\x52\xa8\xc3\xfb\x06\xcd\xc3\x1e\x38\x97\xae\xd7\xb0\x3f\x6f\x84\xe4\x68\xe0\xc3\x0c\x2a\x66\x0b\x26\x61\x9f\xfe\x2a\x74\x85\xf4\x24\x9e\xc4\x44\x83\x05\x8a\xb6\xcb\xdc\xdc\x6f\xe0\xce\xa5\x69\xd9\xa8\x02\xc8\x93\x5c\xe7\xe0\x60\xc8\xe2\x5c\x06\x51\xc7\xc5\x99\x25\x45\xbd\x82\x42\xab\x1a\x57\x35\x3d\xed\xae\x19\x90\xdf\x7f\x3c\x84\x5e\x9c\xd1\x9b\x87\x0a\xc1\xb9\x1c\xd0\x18\x6d\x32\x58\xa7\x89\x41\xeb\x15\xbc\x8f\x55\xe8\x35\xda\x4a\x2b\x8b\x6b\x97\x26\xa1\xb3\x1c\xe6\x42\x71\xa1\x16\x21\x6f\xa4\x86\x46\xd8\x4f\x9f\x49\x32\x1a\xaf\x69\x22\x4a\xcf\xb1\x0d\xc1\x8d\xbf\xa3\xe7\x2b\x2c\xbc\xde\x1c\x46\x2c\x39\x18\xb4\xd9\x71\x80\xbf\x9b\x81\x12\xd2\xcb\x4c\x0c\xd6\x8d\x51\xfe\x67\x50\x9f\x26\x2e\x4d\x5a\x34\xb5\x28\xd0\xe6\x3d\x97\x41\x4b\xaf\x91\xf1\xdb\x78\x30\x50\xf2\x9f\x52\x82\x87\xf6\x96\xec\x0e\xb7\xf9\x75\x94\x83\x44\x45\x7a\xc2\x2c\x4b\x93\x52\x1b\xf8\x9b\x83\x0f\xe1\x2a\x90\x33\xb5\x40\xe8\x53\x02\x93\xaf\x3a\x03\x56\x55\xa8\x38\x11\xdc\xf6\xe9\xbe\x36\x19\x91\xf8\x9a\x2e\xed\xc5\x85\x64\x25\x64\xfa\xe2\x39\xf8\x24\xe5\xe4\x1c\x04\x0c\xbd\x62\xcb\xb7\x9d\x82\x5b\x26\x1b\xfc\xc6\x2a\x52\x9b\x06\x77\x3e\x14\xcc\xf8\xf2\x95\x6c\x4c\x78\xf9\xae\x07\x9e\x0d\xe3\xc1\x05\xff\x9e\x3d\x95\xb5\x0d\x47\x3f\x1b\xbd\xec\x2d\x21\xcf\x56\x32\x55\xad\xd0\xaa\x14\x8b\xf1\x03\x8d\xe1\x6c\x33\x02\x13\xf0\x57\x8e\xc5\xa9\x6e\x54\x3d\x31\x18\x42\xd5\x6f\x37\x0c\x1d\xf1\x0e\xa6\xe0\xe8\xd1\xf9\x18\xe9\xd7\xc1\x85\x17\xf0\x72\xcb\xce\x57\xc2\x4e\x59\x36\xd7\x5a\xbe\x9d\x67\x5f\x99\xbd\xc2\xd5\x4e\x5c\x2b\x99\xb4\x38\xe9\xdc\x89\xd6\xf2\x35\xd6\x45\xd9\x70\xc0\xad\xa4\x37\x86\xb5\x68\x2c\x0b\xbc\xad\x6f\x61\x41\x6f\xbb\x2e\x2f\xd9\x1c\x65\xb7\x09\x7f\xb0\xe2\x8e\x2d\xfc\x62\xa2\x21\xda\xf5\x3c\x61\xd4\xb0\x91\x16\x26\xfd\xa4\xa7\x52\x2b\x24\xdd\x66\x8d\x0b\xbb\x7a\xdc\xd5\x63\x54\x65\x90\x8b\x82\xd5\x71\x7b\x57\xf4\x4b\x57\x86\xb4\x5d\x05\x51\x86\xaf\xc0\x18\xa6\x0d\x47\x93\xc1\x47\x38\xea\xf4\xd0\xef\x3e\xe0\x59\x9f\xc1\x19\xc0\x01\x37\xe2\xf3\x84\x91\x53\x2c\x45\xbd\xed\xc9\x87\x83\xe3\x78\x3e\x74\x84\x5e\xfa\x10\x39\x08\x27\x1b\xed\x8d\x12\xf7\x0d\x6e\x2b\xd4\x9d\x1c\x87\xee\xba\xfb\x0c\x66\xb3\x4d\x3f\x67\xc8\x9b\x8a\x3c\xf9\x3e\xb5\x69\xf8\x17\x83\x8a\x83\x73\xff\x02\x00\x00\xff\xff\xc0\x27\xa1\x73\x1d\x09\x00\x00") +var _templateDialectGremlinQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x56\x5b\x4f\xe3\x38\x14\x7e\x4e\x7e\xc5\x59\x84\x50\xd2\x8d\x0c\x0f\xab\x7d\x00\x75\xa5\xe5\x32\x33\x95\x80\x99\xe9\x20\x5e\x46\xa3\x91\x9b\x9c\x14\x0b\xd7\x0e\xb6\xd3\x29\xaa\xfc\xdf\x47\xbe\xa4\x94\x4e\x23\x2e\x12\x3c\xd5\x1c\x9f\xef\xe2\x2f\x27\x0e\xcb\x25\x54\x58\x33\x81\xb0\x53\x31\xca\xb1\x34\xfb\x53\x85\x33\xce\xc4\xfe\x5d\x8b\xea\x7e\x07\xac\x4d\x97\x4b\xd8\x9d\xb4\x8c\x57\xa8\xe0\x70\x08\x0d\xd5\x25\xe5\xb0\x4b\xbe\x95\xb2\x41\x72\x1c\x77\x62\xa3\xc2\x12\xd9\x3c\x74\xae\xd6\x2b\xb8\xb5\x69\x5a\xb7\xa2\x84\xec\x51\xaf\xb5\x30\x58\x57\xb1\x36\x87\xe8\x63\x74\xaa\xb3\xd2\x2c\xa0\x94\xc2\xe0\xc2\x90\x93\xf0\x9b\x43\xf6\xfd\x87\x83\x90\xd1\x29\xb9\xba\x6f\x10\xac\x2d\x00\x95\x92\x2a\x87\x65\x9a\x28\xd4\xce\xc1\x5e\x64\x21\x63\xd4\x8d\x14\x1a\x97\x36\x4d\xfc\xc9\x0a\x98\x30\x51\x31\x31\xf5\x7d\x1b\x6e\x48\x84\x7d\x75\x9d\x59\x4e\xe2\x6f\x9a\xb0\xda\x69\x6c\x43\x54\xca\xad\xc8\xd9\x02\x4b\xe7\xb7\x80\x0d\x95\x02\x14\xea\xfc\xc8\xc3\xff\x1a\x82\x60\xdc\xd9\x4c\x14\x9a\x56\x09\xf7\xa7\x77\x9f\x26\x36\x4d\xe6\xa8\x0c\x2b\x51\x17\x9d\x96\x42\x4d\xc6\x48\xab\xeb\xb8\xb1\xe6\xe4\x09\x2a\x56\xf9\xe3\xcd\xe8\x2d\x6e\xcb\xeb\xa0\x00\x8e\x22\xeb\x04\xf3\x3c\x4d\x6a\xa9\xe0\x67\x01\xae\x84\x0b\x2f\x4e\xc5\x14\xa1\x6b\xf1\x4a\x8e\x75\x08\xb4\x69\x50\x54\x19\xab\x74\xd7\xee\xb8\xb3\x0d\x11\xc7\x69\xd3\xce\x9c\x6f\x16\x8c\xa7\x2f\x9e\x83\xff\x39\xef\x9d\x03\x8f\x21\x97\x74\xf6\xb6\x53\x70\x4d\x79\x8b\x17\xb4\xc9\x8c\x6a\xf1\xdd\x87\x82\x2a\x47\xdf\xf0\x56\xf9\x97\x6f\xbc\x96\xd9\x7a\xdd\xa7\xe0\xde\xb3\xc7\xb6\xb6\xe1\xc8\x07\x25\x67\x5d\x24\xd9\xb3\x9d\xf4\xb1\x95\x52\xd4\x6c\xba\xf9\x40\x63\x39\x5f\x8d\x40\x0f\xfc\x95\x63\x71\x22\x5b\x61\x7a\x06\x83\x09\xf3\x76\xc3\x10\x84\xdf\x61\x0a\x0e\x1e\x92\x8f\x95\xee\x3a\x18\x39\x03\x2f\x8f\xec\x6c\xc1\x74\x5f\x64\x13\x29\xf9\xdb\x65\xf6\x89\xea\x4b\x5c\xbc\x4b\x6a\x35\xe5\x1a\x7b\x93\x3b\x96\x92\xbf\x26\xba\x68\x1b\x06\x95\xe6\xe4\x4a\xd1\x39\x2a\x4d\xbd\xee\xdc\x1d\x61\x4a\xae\xc3\x29\xcf\xe9\x04\x79\xb8\x09\xbf\xd0\xf2\x96\x4e\xdd\xc5\x44\x7c\x35\x9c\xb9\x27\xa8\xf5\x83\xcc\xa1\x37\x4f\x72\xc2\xa5\xc0\x2c\xdc\xac\xf1\xc2\x6e\x1e\xee\xea\x4d\x54\xa3\xb0\x62\x25\x35\xf1\xf6\x6e\xc8\xc7\x40\x93\xcd\x03\x03\xab\xfd\x57\x60\x13\x26\x55\x85\x2a\x87\xff\xe0\x20\xf8\x21\x9f\x5d\xc1\xa9\x3e\x43\xd3\x83\x3d\x6e\x43\xcf\x09\xda\x34\xd1\xbf\x98\x29\x6f\x80\xb3\x19\x33\x05\xc8\xba\xd6\x68\xb6\x4d\x41\x6c\xf8\x83\xde\x03\x8e\x9c\x40\x49\x35\x06\x9e\x2e\xbd\xbd\xbd\x8e\x30\x14\x0e\xbd\xfb\xb1\xf3\x99\x0d\xc2\x4e\x01\x71\x01\x7f\xc3\xc0\x83\xf3\xc8\xf4\x34\x72\x46\xcd\x0d\xb9\xa0\x8b\x91\x30\xff\xfe\x93\x6f\x31\x10\x50\xe7\xae\x92\xad\xc8\x43\xce\xad\x60\x77\x2d\x6e\x3b\x68\xd8\x39\xf2\x4f\x22\xac\x73\x18\x0e\x57\xd9\x9f\x62\xd5\x36\xd9\xa3\x6f\xe9\x3c\xf5\xff\x71\xa1\xa8\xc0\xda\xdf\x01\x00\x00\xff\xff\x11\xa4\x59\x70\xc9\x09\x00\x00") func templateDialectGremlinQueryTmplBytes() ([]byte, error) { return bindataRead( @@ -338,7 +327,7 @@ func templateDialectGremlinQueryTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/query.tmpl", size: 2333, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/query.tmpl", size: 2505, mode: os.FileMode(420), modTime: time.Unix(1561481160, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -358,7 +347,7 @@ func templateDialectGremlinUpdateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/update.tmpl", size: 4708, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/update.tmpl", size: 4708, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -378,7 +367,7 @@ func templateDialectSqlCreateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/create.tmpl", size: 6044, mode: os.FileMode(420), modTime: time.Unix(1560438408, 0)} + info := bindataFileInfo{name: "template/dialect/sql/create.tmpl", size: 6044, mode: os.FileMode(420), modTime: time.Unix(1560346178, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -398,7 +387,7 @@ func templateDialectSqlDeleteTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/delete.tmpl", size: 493, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/dialect/sql/delete.tmpl", size: 493, mode: os.FileMode(420), modTime: time.Unix(1558541632, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -418,12 +407,12 @@ func templateDialectSqlGroupTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/group.tmpl", size: 835, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/dialect/sql/group.tmpl", size: 835, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateDialectSqlQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x55\xdf\x6f\xdb\x36\x10\x7e\xb6\xfe\x8a\xab\xd1\x15\x52\xa0\xb1\xcd\x6b\x02\x0f\xd8\xe2\x0e\x08\x50\x14\x6b\xdd\xb7\x20\x18\x18\xea\xe4\x11\xa1\x49\x99\xa4\x1c\x07\x82\xfe\xf7\xe1\xa8\x1f\x96\x7f\xc8\x4b\x82\x01\x7d\x08\x22\x93\x1f\xf9\xdd\x7d\xf7\xdd\xb1\xaa\x20\xc3\x5c\x6a\x84\x69\x26\xb9\x42\xe1\x3f\xba\xb5\xfa\xb8\x2e\xd1\x3e\x4f\xa1\xae\xa3\xaa\x82\xf7\xc5\xe3\x12\xae\x66\xf0\x9e\x2d\x84\x29\x90\xfd\xc5\xc5\x23\x5f\x62\xb7\xfb\x50\x4a\x95\xa1\x25\x44\xc1\x9d\xe0\xaa\x07\xfe\xd1\xee\xb4\x40\x8b\x02\xe5\xa6\x41\xf6\xdf\xfd\xf1\xba\x8e\xa2\xbc\xd4\x02\xe2\x3d\x6c\x5d\xc3\xc5\x90\xa5\xae\x13\x70\x6b\xf5\xbb\x52\xb1\xf0\x5b\x10\x46\x7b\xdc\x7a\x76\xd3\xfc\x4f\x20\xbe\xbb\x0f\x78\xf6\x95\xaf\x28\xc4\x14\xd0\x5a\x63\x13\xa8\xa2\x89\x35\x4f\x8e\xc8\x3f\xb8\xb5\x62\xdf\xcd\x93\xab\xea\x68\xe2\x90\xb2\x36\x21\xaa\x03\x66\xe6\xd6\xea\x1b\x29\x11\x27\xd1\x44\xe6\x50\x6a\xb9\x2e\xf1\x14\xb0\xd9\xb9\x06\x85\x3a\x6e\xbe\x13\x98\xcd\xe0\x13\xb1\xf6\x0c\x6c\x2e\x9d\x97\x5a\x78\xba\xae\x8e\x26\x41\xe4\x14\xb8\x5d\x86\xa8\x7a\xd8\x90\x12\xed\xc9\xc0\x32\x4b\x5f\x2d\x52\xf8\x6d\x0a\x83\xcb\x52\xa0\x44\x93\xeb\x70\xf8\xdd\x0c\xb4\x54\x21\x0e\x8b\xbe\xb4\x9a\x7e\x06\x51\x42\x0c\x19\xe6\x68\x03\x9e\xdd\x28\xe3\x90\x68\xab\xea\x57\x62\xf3\xa1\xa2\xaa\xb4\xa1\xa2\xdf\x77\xec\xd1\x64\xc3\x6d\x1b\x92\xa7\x02\x55\xd5\x0e\x17\x64\x0f\xa0\xc3\xe8\x09\xca\xfe\xb4\x66\x45\xca\xc7\x2f\x0f\x71\x70\x5a\x18\x9d\xcb\xe5\xa1\x41\xda\xe5\x24\xea\x8e\xef\x4e\xa4\x74\x55\xf4\x2a\x67\xdd\x98\x52\xfb\x11\x6f\x49\xed\xff\x37\x3f\xed\xcc\x74\x77\xef\xbc\x95\x7a\x59\x05\xfc\xa0\xbd\x58\xf8\x7d\x3b\xa7\x08\x9c\xe7\x3a\x88\xdd\x28\x4b\x46\x3b\x6d\xc2\x04\x7e\x6b\x7d\xd7\x32\x8c\xb9\x35\x88\xdb\x9b\xae\x49\x9b\x12\xe9\x5d\x3a\xd8\x53\xe5\x4a\xbb\xd6\xd9\x8c\xb1\x84\xfe\x92\x9f\xe6\xe0\x4f\xe7\xfd\x2b\x73\x78\x17\x56\xbe\xe2\xd6\xc7\xc9\xf1\x49\x63\x69\xef\x29\x9e\x76\xc3\xad\xae\xaf\x40\x9b\x70\x0d\xe4\xa6\xd4\xd9\xb4\xe9\x50\xf2\xb9\x06\xa9\xfd\x30\x93\x70\xf5\x42\x70\x1d\x7f\xd0\xe7\x42\xcc\x57\x9e\x7d\x26\xb2\x7c\x9f\x28\xe7\x52\x61\x06\x16\x79\x26\xf5\x12\x04\x09\x7f\x05\xbf\x6c\xa6\x21\xb6\x86\xb8\xeb\x83\x37\xf8\xf7\xf3\x56\xba\x31\xff\x3e\x18\xa3\x86\x06\xd6\xe9\x58\x79\x86\x8d\xb0\xab\xe3\x71\x9e\x39\x57\x0e\xc7\x73\x15\xff\xa0\x78\x04\xa4\x90\x50\x0b\x1c\x4b\x93\x2c\xfb\x86\x54\x6f\xe7\x6e\xf4\x11\xe8\x5a\xe7\xc7\x73\x71\xf8\x0c\x6c\xdc\xb9\xb4\xdb\x97\xe5\x5c\xd2\x7b\xe3\x89\x3c\x22\x33\x07\x47\x94\xd1\x24\x37\x16\xfe\x4e\x61\x13\x5c\xc3\xf5\x12\x61\xe3\xc2\x3d\x84\x9f\x01\x2f\x0a\xd4\x59\x2c\x33\x97\xc2\x86\xdd\xce\xf7\x34\x09\xab\xad\x22\xaf\x90\xa4\xed\x3c\xb8\xa0\x4e\x5e\x74\xa3\xa8\x8a\x26\xfe\x32\x74\xe8\x5a\xb1\x1f\xfc\x41\x61\x7c\x38\x6a\xc2\x6a\xb2\x3f\xbe\x76\x77\xc4\xfe\xb2\x9f\x02\x87\x27\xdb\xf5\x6e\x2c\x84\x11\x1f\xfb\xcb\x46\xc0\x13\x02\x0f\x05\xed\xd9\x4e\x96\x62\xf8\x76\xb6\x71\x1c\xcd\xa4\xff\x88\x26\x48\xda\xd6\xa1\xd8\xd5\xe1\x90\xac\xb0\x98\x49\xc1\x3d\x36\xf5\x29\xd8\xe2\xdb\x97\x9e\xeb\xa5\x97\x18\x4b\x85\x18\x3b\x4f\x43\x5b\xae\xa4\x3f\x65\xbb\xb0\x71\xdd\xee\x9f\x90\x87\x7d\xa1\x9d\xf8\x22\x00\xf6\x6c\xd2\x21\xc8\x26\x55\x05\xa8\x33\xa8\xeb\x7f\x03\x00\x00\xff\xff\x60\xec\xa0\x25\xd5\x09\x00\x00") +var _templateDialectSqlQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x56\xdf\x6b\x1c\x37\x10\x7e\xbe\xfd\x2b\x26\x47\x1a\x76\xcd\x55\x8e\xa1\xf4\xc1\xe6\x0a\xad\x9d\x82\x21\x4d\x9b\x38\xd0\x87\x10\x8a\x2c\xcd\x9e\x85\x75\xd2\x9e\xa4\xdd\x3b\xb3\xec\xff\x5e\x46\xfb\xe3\xf6\x7e\xb9\x49\x28\xe4\x21\x64\x4f\xfa\x66\xe6\x9b\x6f\x3e\x49\xae\x6b\x90\x98\x2b\x83\x30\x95\x8a\x6b\x14\xe1\xdc\xaf\xf4\xf9\xaa\x44\xf7\x34\x85\xa6\x49\xea\x1a\x5e\x16\x8f\x0b\xb8\x9c\xc3\x4b\x76\x27\x6c\x81\xec\x2f\x2e\x1e\xf9\x02\xfb\xdd\xfb\x52\x69\x89\x8e\x10\x05\xf7\x82\xeb\x01\xf8\x5b\xb7\xd3\x01\x1d\x0a\x54\x55\x8b\x1c\xbe\x87\xf0\xa6\x49\x92\xbc\x34\x02\xd2\x1d\x6c\xd3\xc0\xd9\xb8\x4a\xd3\x64\xe0\x57\xfa\x57\xad\x53\x11\x36\x20\xac\x09\xb8\x09\xec\xba\xfd\x3f\x83\xf4\xd3\xe7\x88\x67\xef\xf8\x92\x28\xce\x00\x9d\xb3\x2e\x83\x3a\x99\x38\xbb\xf6\x54\xfc\x95\x5f\x69\xf6\xc1\xae\x7d\xdd\x24\x13\x8f\xd4\xb5\x8d\xac\xf6\x2a\x33\xbf\xd2\xef\x49\x89\x34\x4b\x26\x2a\x87\xd2\xa8\x55\x89\xc7\x80\xed\xce\x15\x68\x34\x69\xfb\x9d\xc1\x7c\x0e\xaf\xa9\xea\x50\x81\xdd\x28\x1f\x94\x11\x81\xd2\x35\xc9\x24\x8a\x3c\x03\xee\x16\x91\xd5\x00\x1b\x97\x44\x77\x94\x98\x74\xf4\xd5\x21\x45\xd8\xcc\x60\x94\x6c\x06\xd4\x68\x76\x15\x83\x5f\xcc\xc1\x28\x1d\x79\x38\x0c\xa5\x33\xf4\x33\x8a\x12\x39\x48\xcc\xd1\x45\x3c\xbb\xd6\xd6\x23\x95\xad\xeb\x1f\xa9\x5a\x88\x13\xd5\xa5\x8b\x13\xfd\xb0\xad\x9e\x4c\x2a\xee\x3a\x4a\x81\x06\x54\xd7\x5b\x5c\x94\x3d\x82\xf6\xd9\x13\x94\xfd\xee\xec\x92\x94\x4f\xbf\x9c\xe2\x28\x5a\x58\x93\xab\xc5\xbe\x41\xba\xe5\x2c\xe9\xc3\xb7\x11\x33\x4a\x95\x7c\x95\xb3\xae\x6d\x69\xc2\x09\x6f\x29\x13\xfe\x37\x3f\x6d\xcd\xf4\xe9\xb3\x0f\x4e\x99\x45\x1d\xf1\xa3\xe3\xc5\xe2\xef\xdb\x1b\x62\xe0\x03\x37\x51\xec\x56\x59\x32\xda\x71\x13\x66\xf0\x4b\xe7\xbb\xae\xc2\x29\xb7\x46\x71\x07\xd3\xb5\x6d\x53\x23\x83\x4b\x47\x7b\xba\x5c\x1a\xdf\x39\x9b\x31\x96\xd1\xbf\xec\xbb\x39\xf8\xf5\xf3\xfe\x55\x39\xbc\x88\x2b\xef\x70\x13\xd2\xec\x30\xd2\x3a\xda\x5b\xa7\xd3\xfe\x72\x6b\x9a\x4b\x30\x36\xa6\x81\xdc\x96\x46\x4e\xdb\x13\x4a\x3e\x37\xa0\x4c\x18\x77\x12\x53\xdf\x09\x6e\xd2\x57\xe6\x39\x8a\xf9\x32\xb0\x37\x54\x2c\xdf\x2d\x94\x73\xa5\x51\x82\x43\x2e\x95\x59\x80\x20\xe1\x2f\xe1\x87\x6a\x1a\xb9\xb5\x85\xfb\x73\xf0\x0d\xfe\x7d\xb3\x51\xfe\x94\x7f\xef\xad\xd5\x63\x03\x9b\xd9\xa9\xf1\x8c\x0f\xc2\x76\x8e\x87\x7d\xe6\x5c\x7b\x3c\xdd\xab\x78\x40\xf1\x08\x48\x94\xd0\x08\x3c\xd5\x26\x59\xf6\x1b\x5a\xbd\xbd\xf1\x27\x1f\x81\xfe\xe8\x7c\x7c\x2a\xf6\x9f\x81\xca\x3f\xd7\x76\xf7\xb2\x3c\xd7\xf4\xce\xf5\x44\x1e\x51\xd2\xc3\x41\xc9\x64\x92\x5b\x07\xff\xcc\xa0\x8a\xae\xe1\x66\x81\x50\xf9\x98\x87\xf0\x73\xe0\x45\x81\x46\xa6\x4a\xfa\x19\x54\xec\xf6\x66\x47\x93\xb8\xda\x29\xf2\x15\x92\x74\x27\x0f\xce\xe8\x24\xdf\xf5\x57\x51\x9d\x4c\xc2\x45\x3c\xa1\x2b\xcd\x3e\xf2\x7b\x8d\xe9\xfe\x55\x13\x57\xb3\xdd\xeb\x6b\x9b\x23\x0d\x17\xc3\x2d\xb0\x1f\xd9\xad\xf7\xd7\x42\xbc\xe2\xd3\x70\xd1\x0a\x78\x44\xe0\xb1\xa0\x43\xb5\xa3\xa3\x18\xbf\x9d\x1d\x8f\x83\x3b\xe9\x3f\xd8\x44\x49\xbb\x39\x14\xdb\x39\xec\x17\x2b\x1c\x4a\x25\x78\xc0\x76\x3e\x05\xbb\x7b\xff\x76\xa8\xf5\xa5\x49\xac\xa3\x41\x9c\x8a\x57\x39\xd8\x3c\xf7\xed\xb3\x7a\x10\x1a\x77\xae\x7a\xc4\x48\xa1\xf3\x73\xd0\x6a\xa9\x02\x28\x0f\x4b\x6e\x24\x0f\xd6\x3d\x01\x91\xe9\xb0\x42\xf3\xd2\x23\x83\xbf\x11\x7c\xe0\x2e\xb4\x31\x6b\x15\x1e\xe8\x2f\x3b\x5e\xea\x00\x15\xd7\x25\xce\x80\x1b\x09\xb6\x42\xe7\x94\x44\x50\x01\xee\x51\xdb\x35\xa8\x1c\x0c\xa2\x44\xc9\xc6\x72\xff\x19\x93\xa7\x67\x6d\x91\x8c\xbd\x25\x0e\xe9\x92\x87\x07\xf6\x07\xdf\xdc\x9a\xf0\xf3\x4f\x43\x5b\x2d\xbf\x23\x5d\xc5\x8d\xab\x6e\xff\xc8\xd4\xbb\xac\x67\x11\xb0\xe3\xfe\x1e\x41\xee\xaf\x6b\x40\x23\xa1\x69\xfe\x0d\x00\x00\xff\xff\x88\xb8\x4d\x52\xac\x0a\x00\x00") func templateDialectSqlQueryTmplBytes() ([]byte, error) { return bindataRead( @@ -438,7 +427,7 @@ func templateDialectSqlQueryTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/query.tmpl", size: 2517, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/dialect/sql/query.tmpl", size: 2732, mode: os.FileMode(420), modTime: time.Unix(1561476415, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -458,7 +447,7 @@ func templateDialectSqlUpdateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/update.tmpl", size: 11220, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/dialect/sql/update.tmpl", size: 11220, mode: os.FileMode(420), modTime: time.Unix(1558625976, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -478,7 +467,7 @@ func templateEntTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/ent.tmpl", size: 6584, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/ent.tmpl", size: 6584, mode: os.FileMode(420), modTime: time.Unix(1558976196, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -498,7 +487,7 @@ func templateExampleTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/example.tmpl", size: 2407, mode: os.FileMode(420), modTime: time.Unix(1560441183, 0)} + info := bindataFileInfo{name: "template/example.tmpl", size: 2407, mode: os.FileMode(420), modTime: time.Unix(1560602349, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -518,12 +507,12 @@ func templateHeaderTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/header.tmpl", size: 101, mode: os.FileMode(420), modTime: time.Unix(1554708928, 0)} + info := bindataFileInfo{name: "template/header.tmpl", size: 101, mode: os.FileMode(420), modTime: time.Unix(1554626550, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateImportTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x90\x41\x6e\xeb\x20\x10\x86\xd7\x70\x8a\x11\xca\x22\xc9\xc2\x1c\xe2\x5d\xe0\x49\x3d\x40\x44\xf0\x18\x8f\x0a\x83\x03\xa8\xad\x84\xb8\x7b\x85\xe3\x34\x8b\xa6\xf2\xee\xe3\xe7\x63\x34\xfc\xb5\xc2\x88\x13\x31\x82\xa2\xb0\xc4\x54\x14\xb4\x26\xef\x08\x47\x29\xd4\x14\x8a\x92\x42\xd9\xc8\x05\xbf\x56\xc4\x94\x62\xca\x9d\x72\x49\x36\xf2\xc7\x86\xc4\x6e\x4d\x0b\x05\x54\x52\x8a\x5a\xf5\x19\xc8\x71\x4c\x08\x0e\x19\x53\x21\x76\x10\x19\x5c\x32\xcb\x0c\x05\xc3\xe2\x4d\xc1\x0c\x67\xdd\x5a\xd7\x81\x26\xe0\x58\xe0\x88\x37\x38\x0c\xff\x22\x4f\xe4\x86\xff\xc6\xbe\x1b\x87\x70\x78\xd0\xa9\x2f\x28\x84\xaa\xf5\xb7\xd4\x9a\x5e\xe3\xe7\x59\x49\xd1\x27\x7f\x52\x99\x9f\xfa\x9b\x9d\x31\x18\x80\xd6\xa0\x8f\x19\xba\x07\xb5\x02\xf2\x08\xdb\x2a\x1b\xf6\x02\xae\x56\x23\xaf\x3f\xdf\x50\x8f\x64\x3c\xda\x57\x91\xce\x37\xaf\x1e\xaf\x3c\x5d\xb5\x8b\xda\x25\x0c\x9e\x58\xbd\x4c\xf5\x5a\x86\x1e\xb3\xdf\xbb\xd7\x97\xcb\xae\xe2\x76\x8d\xe5\x0f\x03\xd9\xc6\x91\xd8\xdd\xd5\x1c\x59\xc9\x93\xfc\xe9\xe1\x3b\x00\x00\xff\xff\xbe\x62\x2e\x09\x26\x02\x00\x00") +var _templateImportTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x90\x41\x6e\xeb\x20\x10\x86\xd7\x70\x8a\x11\xca\x22\xc9\xc2\x1c\xe2\x5d\xe0\x49\x3d\x40\x44\xf0\x18\x8f\x0a\x83\x03\xa8\xad\x84\xb8\x7b\x85\xe3\x34\x8b\xa6\xf2\xca\x9f\xff\xf9\x18\x8d\xfe\x5a\x61\xc4\x89\x18\x41\x51\x58\x62\x2a\x0a\x5a\x93\x77\x84\xa3\x14\x6a\x0a\x45\x49\xa1\x6c\xe4\x82\x5f\x2b\x62\x4a\x31\xe5\x4e\xc1\x94\xb9\x7f\x73\x49\x36\xf2\xc7\x86\xc4\x6e\x9d\x16\x0a\xa8\xa4\x14\xb5\xea\x33\x90\xe3\x98\x10\x1c\x32\xa6\x42\xec\x20\x32\xb8\x64\x96\x19\x0a\x86\xc5\x9b\x82\x19\xce\xba\xb5\xae\x03\x4d\xc0\xb1\xc0\x11\x6f\x70\x18\xfe\x45\x9e\xc8\x0d\xff\x8d\x7d\x37\x0e\xe1\xf0\xa0\x53\x3f\x54\x08\x55\xeb\x6f\xa9\x35\xbd\xc6\xcf\x7f\x25\x45\xdf\xfc\x49\x65\x7e\xea\x6f\x76\xc6\x60\x00\x5a\x83\xbe\x66\xe8\x1e\xd4\x0a\xc8\x23\x6c\xa7\x6c\xd8\x8b\xb8\x5a\x8d\xbc\x36\xb0\xa1\x1e\xc9\x78\xb4\xaf\x22\x9d\x6f\x5e\x3d\x5e\x79\xba\x6a\x17\xb5\x4b\x18\x3c\xb1\x7a\x99\xea\xb5\x0c\x3d\x66\xbf\x37\xd7\x97\xcb\xae\xe2\x76\x8d\xe5\x0f\x03\xd9\xc6\x91\xd8\xdd\xd5\x1c\x59\xc9\x93\xfc\xe9\xe1\x3b\x00\x00\xff\xff\xdd\xe6\x58\x59\x2e\x02\x00\x00") func templateImportTmplBytes() ([]byte, error) { return bindataRead( @@ -538,7 +527,7 @@ func templateImportTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/import.tmpl", size: 550, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/import.tmpl", size: 558, mode: os.FileMode(420), modTime: time.Unix(1561475554, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -558,7 +547,7 @@ func templateMetaTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/meta.tmpl", size: 3550, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/meta.tmpl", size: 3550, mode: os.FileMode(420), modTime: time.Unix(1558789265, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -578,7 +567,7 @@ func templateMigrateMigrateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/migrate/migrate.tmpl", size: 2604, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/migrate/migrate.tmpl", size: 2604, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -598,7 +587,7 @@ func templateMigrateSchemaTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/migrate/schema.tmpl", size: 936, mode: os.FileMode(420), modTime: time.Unix(1559129106, 0)} + info := bindataFileInfo{name: "template/migrate/schema.tmpl", size: 936, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -618,7 +607,7 @@ func templateTxTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/tx.tmpl", size: 3426, mode: os.FileMode(420), modTime: time.Unix(1560438408, 0)} + info := bindataFileInfo{name: "template/tx.tmpl", size: 3426, mode: os.FileMode(420), modTime: time.Unix(1560345874, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -638,7 +627,7 @@ func templateWhereTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/where.tmpl", size: 6958, mode: os.FileMode(420), modTime: time.Unix(1560146912, 0)} + info := bindataFileInfo{name: "template/where.tmpl", size: 6958, mode: os.FileMode(420), modTime: time.Unix(1559829316, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/builder/query.tmpl b/entc/gen/template/builder/query.tmpl index 8fff8f040..0f384355c 100644 --- a/entc/gen/template/builder/query.tmpl +++ b/entc/gen/template/builder/query.tmpl @@ -10,10 +10,11 @@ // {{ $builder }} is the builder for querying {{ pascal $.Name }} entities. type {{ $builder }} struct { config - limit *int - order []Order - unique []string - predicates []ent.Predicate + limit *int + offset *int + order []Order + unique []string + predicates []ent.Predicate // intermediate queries. sql *sql.Selector gremlin *dsl.Traversal @@ -31,6 +32,12 @@ func ({{ $receiver }} *{{ $builder }}) Limit(limit int) *{{ $builder }} { return {{ $receiver }} } +// Offset adds an offset step to the query. +func ({{ $receiver }} *{{ $builder }}) Offset(offset int) *{{ $builder }} { + {{ $receiver }}.offset = &offset + return {{ $receiver }} +} + // Order adds an order step to the query. func ({{ $receiver }} *{{ $builder }}) Order(o ...Order) *{{ $builder }} { {{ $receiver }}.order = append({{ $receiver }}.order, o...) diff --git a/entc/gen/template/dialect/gremlin/query.tmpl b/entc/gen/template/dialect/gremlin/query.tmpl index 295b301fe..8b7ebe4dd 100644 --- a/entc/gen/template/dialect/gremlin/query.tmpl +++ b/entc/gen/template/dialect/gremlin/query.tmpl @@ -65,7 +65,12 @@ func ({{ $receiver }} *{{ $builder }}) gremlinQuery() *dsl.Traversal { p.Gremlin(v) } } - if limit := {{ $receiver }}.limit; limit != nil { + switch limit, offset := {{ $receiver }}.limit, {{ $receiver }}.offset; { + case limit != nil && offset != nil: + v.Range(*offset, *offset + *limit) + case offset != nil: + v.Range(*offset, math.MaxInt64) + case limit != nil: v.Limit(*limit) } if unique := {{ $receiver }}.unique; len(unique) == 0 { diff --git a/entc/gen/template/dialect/sql/query.tmpl b/entc/gen/template/dialect/sql/query.tmpl index cc0c02903..6c853b03f 100644 --- a/entc/gen/template/dialect/sql/query.tmpl +++ b/entc/gen/template/dialect/sql/query.tmpl @@ -80,6 +80,11 @@ func ({{ $receiver }} *{{ $builder }}) sqlQuery() *sql.Selector { for _, p := range {{ $receiver }}.order { p.SQL(selector) } + if offset := {{ $receiver }}.offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt64) + } if limit := {{ $receiver }}.limit; limit != nil { selector.Limit(*limit) } diff --git a/entc/gen/template/import.tmpl b/entc/gen/template/import.tmpl index 162bd1612..9163e00ad 100644 --- a/entc/gen/template/import.tmpl +++ b/entc/gen/template/import.tmpl @@ -3,6 +3,7 @@ import ( "fmt" "context" "errors" + "math" "strconv" "strings" "time" diff --git a/entc/integration/ent/card_query.go b/entc/integration/ent/card_query.go index 67c3a63e5..4caa0e09f 100644 --- a/entc/integration/ent/card_query.go +++ b/entc/integration/ent/card_query.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "math" "fbc/ent/entc/integration/ent/card" "fbc/ent/entc/integration/ent/user" @@ -24,6 +25,7 @@ import ( type CardQuery struct { config limit *int + offset *int order []Order unique []string predicates []ent.Predicate @@ -44,6 +46,12 @@ func (cq *CardQuery) Limit(limit int) *CardQuery { return cq } +// Offset adds an offset step to the query. +func (cq *CardQuery) Offset(offset int) *CardQuery { + cq.offset = &offset + return cq +} + // Order adds an order step to the query. func (cq *CardQuery) Order(o ...Order) *CardQuery { cq.order = append(cq.order, o...) @@ -363,6 +371,11 @@ func (cq *CardQuery) sqlQuery() *sql.Selector { for _, p := range cq.order { p.SQL(selector) } + if offset := cq.offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt64) + } if limit := cq.limit; limit != nil { selector.Limit(*limit) } @@ -432,7 +445,12 @@ func (cq *CardQuery) gremlinQuery() *dsl.Traversal { p.Gremlin(v) } } - if limit := cq.limit; limit != nil { + switch limit, offset := cq.limit, cq.offset; { + case limit != nil && offset != nil: + v.Range(*offset, *offset+*limit) + case offset != nil: + v.Range(*offset, math.MaxInt64) + case limit != nil: v.Limit(*limit) } if unique := cq.unique; len(unique) == 0 { diff --git a/entc/integration/ent/comment_query.go b/entc/integration/ent/comment_query.go index a8b5361f1..60b35c629 100644 --- a/entc/integration/ent/comment_query.go +++ b/entc/integration/ent/comment_query.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "math" "fbc/ent/entc/integration/ent/comment" @@ -23,6 +24,7 @@ import ( type CommentQuery struct { config limit *int + offset *int order []Order unique []string predicates []ent.Predicate @@ -43,6 +45,12 @@ func (cq *CommentQuery) Limit(limit int) *CommentQuery { return cq } +// Offset adds an offset step to the query. +func (cq *CommentQuery) Offset(offset int) *CommentQuery { + cq.offset = &offset + return cq +} + // Order adds an order step to the query. func (cq *CommentQuery) Order(o ...Order) *CommentQuery { cq.order = append(cq.order, o...) @@ -330,6 +338,11 @@ func (cq *CommentQuery) sqlQuery() *sql.Selector { for _, p := range cq.order { p.SQL(selector) } + if offset := cq.offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt64) + } if limit := cq.limit; limit != nil { selector.Limit(*limit) } @@ -399,7 +412,12 @@ func (cq *CommentQuery) gremlinQuery() *dsl.Traversal { p.Gremlin(v) } } - if limit := cq.limit; limit != nil { + switch limit, offset := cq.limit, cq.offset; { + case limit != nil && offset != nil: + v.Range(*offset, *offset+*limit) + case offset != nil: + v.Range(*offset, math.MaxInt64) + case limit != nil: v.Limit(*limit) } if unique := cq.unique; len(unique) == 0 { diff --git a/entc/integration/ent/file_query.go b/entc/integration/ent/file_query.go index 65d33c4ed..b2a067831 100644 --- a/entc/integration/ent/file_query.go +++ b/entc/integration/ent/file_query.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "math" "fbc/ent/entc/integration/ent/file" @@ -23,6 +24,7 @@ import ( type FileQuery struct { config limit *int + offset *int order []Order unique []string predicates []ent.Predicate @@ -43,6 +45,12 @@ func (fq *FileQuery) Limit(limit int) *FileQuery { return fq } +// Offset adds an offset step to the query. +func (fq *FileQuery) Offset(offset int) *FileQuery { + fq.offset = &offset + return fq +} + // Order adds an order step to the query. func (fq *FileQuery) Order(o ...Order) *FileQuery { fq.order = append(fq.order, o...) @@ -343,6 +351,11 @@ func (fq *FileQuery) sqlQuery() *sql.Selector { for _, p := range fq.order { p.SQL(selector) } + if offset := fq.offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt64) + } if limit := fq.limit; limit != nil { selector.Limit(*limit) } @@ -412,7 +425,12 @@ func (fq *FileQuery) gremlinQuery() *dsl.Traversal { p.Gremlin(v) } } - if limit := fq.limit; limit != nil { + switch limit, offset := fq.limit, fq.offset; { + case limit != nil && offset != nil: + v.Range(*offset, *offset+*limit) + case offset != nil: + v.Range(*offset, math.MaxInt64) + case limit != nil: v.Limit(*limit) } if unique := fq.unique; len(unique) == 0 { diff --git a/entc/integration/ent/group_query.go b/entc/integration/ent/group_query.go index 05b3975a6..0b09a6c0e 100644 --- a/entc/integration/ent/group_query.go +++ b/entc/integration/ent/group_query.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "math" "fbc/ent/entc/integration/ent/file" "fbc/ent/entc/integration/ent/group" @@ -26,6 +27,7 @@ import ( type GroupQuery struct { config limit *int + offset *int order []Order unique []string predicates []ent.Predicate @@ -46,6 +48,12 @@ func (gq *GroupQuery) Limit(limit int) *GroupQuery { return gq } +// Offset adds an offset step to the query. +func (gq *GroupQuery) Offset(offset int) *GroupQuery { + gq.offset = &offset + return gq +} + // Order adds an order step to the query. func (gq *GroupQuery) Order(o ...Order) *GroupQuery { gq.order = append(gq.order, o...) @@ -427,6 +435,11 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { for _, p := range gq.order { p.SQL(selector) } + if offset := gq.offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt64) + } if limit := gq.limit; limit != nil { selector.Limit(*limit) } @@ -496,7 +509,12 @@ func (gq *GroupQuery) gremlinQuery() *dsl.Traversal { p.Gremlin(v) } } - if limit := gq.limit; limit != nil { + switch limit, offset := gq.limit, gq.offset; { + case limit != nil && offset != nil: + v.Range(*offset, *offset+*limit) + case offset != nil: + v.Range(*offset, math.MaxInt64) + case limit != nil: v.Limit(*limit) } if unique := gq.unique; len(unique) == 0 { diff --git a/entc/integration/ent/groupinfo_query.go b/entc/integration/ent/groupinfo_query.go index 070aef675..de04461dd 100644 --- a/entc/integration/ent/groupinfo_query.go +++ b/entc/integration/ent/groupinfo_query.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "math" "fbc/ent/entc/integration/ent/group" "fbc/ent/entc/integration/ent/groupinfo" @@ -24,6 +25,7 @@ import ( type GroupInfoQuery struct { config limit *int + offset *int order []Order unique []string predicates []ent.Predicate @@ -44,6 +46,12 @@ func (giq *GroupInfoQuery) Limit(limit int) *GroupInfoQuery { return giq } +// Offset adds an offset step to the query. +func (giq *GroupInfoQuery) Offset(offset int) *GroupInfoQuery { + giq.offset = &offset + return giq +} + // Order adds an order step to the query. func (giq *GroupInfoQuery) Order(o ...Order) *GroupInfoQuery { giq.order = append(giq.order, o...) @@ -363,6 +371,11 @@ func (giq *GroupInfoQuery) sqlQuery() *sql.Selector { for _, p := range giq.order { p.SQL(selector) } + if offset := giq.offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt64) + } if limit := giq.limit; limit != nil { selector.Limit(*limit) } @@ -432,7 +445,12 @@ func (giq *GroupInfoQuery) gremlinQuery() *dsl.Traversal { p.Gremlin(v) } } - if limit := giq.limit; limit != nil { + switch limit, offset := giq.limit, giq.offset; { + case limit != nil && offset != nil: + v.Range(*offset, *offset+*limit) + case offset != nil: + v.Range(*offset, math.MaxInt64) + case limit != nil: v.Limit(*limit) } if unique := giq.unique; len(unique) == 0 { diff --git a/entc/integration/ent/node_query.go b/entc/integration/ent/node_query.go index 6f2ea5735..9924af317 100644 --- a/entc/integration/ent/node_query.go +++ b/entc/integration/ent/node_query.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "math" "fbc/ent/entc/integration/ent/node" @@ -23,6 +24,7 @@ import ( type NodeQuery struct { config limit *int + offset *int order []Order unique []string predicates []ent.Predicate @@ -43,6 +45,12 @@ func (nq *NodeQuery) Limit(limit int) *NodeQuery { return nq } +// Offset adds an offset step to the query. +func (nq *NodeQuery) Offset(offset int) *NodeQuery { + nq.offset = &offset + return nq +} + // Order adds an order step to the query. func (nq *NodeQuery) Order(o ...Order) *NodeQuery { nq.order = append(nq.order, o...) @@ -381,6 +389,11 @@ func (nq *NodeQuery) sqlQuery() *sql.Selector { for _, p := range nq.order { p.SQL(selector) } + if offset := nq.offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt64) + } if limit := nq.limit; limit != nil { selector.Limit(*limit) } @@ -450,7 +463,12 @@ func (nq *NodeQuery) gremlinQuery() *dsl.Traversal { p.Gremlin(v) } } - if limit := nq.limit; limit != nil { + switch limit, offset := nq.limit, nq.offset; { + case limit != nil && offset != nil: + v.Range(*offset, *offset+*limit) + case offset != nil: + v.Range(*offset, math.MaxInt64) + case limit != nil: v.Limit(*limit) } if unique := nq.unique; len(unique) == 0 { diff --git a/entc/integration/ent/pet_query.go b/entc/integration/ent/pet_query.go index 1e8233e53..0f99868ad 100644 --- a/entc/integration/ent/pet_query.go +++ b/entc/integration/ent/pet_query.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "math" "fbc/ent/entc/integration/ent/pet" "fbc/ent/entc/integration/ent/user" @@ -24,6 +25,7 @@ import ( type PetQuery struct { config limit *int + offset *int order []Order unique []string predicates []ent.Predicate @@ -44,6 +46,12 @@ func (pq *PetQuery) Limit(limit int) *PetQuery { return pq } +// Offset adds an offset step to the query. +func (pq *PetQuery) Offset(offset int) *PetQuery { + pq.offset = &offset + return pq +} + // Order adds an order step to the query. func (pq *PetQuery) Order(o ...Order) *PetQuery { pq.order = append(pq.order, o...) @@ -382,6 +390,11 @@ func (pq *PetQuery) sqlQuery() *sql.Selector { for _, p := range pq.order { p.SQL(selector) } + if offset := pq.offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt64) + } if limit := pq.limit; limit != nil { selector.Limit(*limit) } @@ -451,7 +464,12 @@ func (pq *PetQuery) gremlinQuery() *dsl.Traversal { p.Gremlin(v) } } - if limit := pq.limit; limit != nil { + switch limit, offset := pq.limit, pq.offset; { + case limit != nil && offset != nil: + v.Range(*offset, *offset+*limit) + case offset != nil: + v.Range(*offset, math.MaxInt64) + case limit != nil: v.Limit(*limit) } if unique := pq.unique; len(unique) == 0 { diff --git a/entc/integration/ent/user_query.go b/entc/integration/ent/user_query.go index 327a6a73c..619125e8a 100644 --- a/entc/integration/ent/user_query.go +++ b/entc/integration/ent/user_query.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "math" "fbc/ent/entc/integration/ent/card" "fbc/ent/entc/integration/ent/file" @@ -27,6 +28,7 @@ import ( type UserQuery struct { config limit *int + offset *int order []Order unique []string predicates []ent.Predicate @@ -47,6 +49,12 @@ func (uq *UserQuery) Limit(limit int) *UserQuery { return uq } +// Offset adds an offset step to the query. +func (uq *UserQuery) Offset(offset int) *UserQuery { + uq.offset = &offset + return uq +} + // Order adds an order step to the query. func (uq *UserQuery) Order(o ...Order) *UserQuery { uq.order = append(uq.order, o...) @@ -576,6 +584,11 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { for _, p := range uq.order { p.SQL(selector) } + if offset := uq.offset; offset != nil { + // limit is mandatory for offset clause. We start + // with default value, and override it below if needed. + selector.Offset(*offset).Limit(math.MaxInt64) + } if limit := uq.limit; limit != nil { selector.Limit(*limit) } @@ -645,7 +658,12 @@ func (uq *UserQuery) gremlinQuery() *dsl.Traversal { p.Gremlin(v) } } - if limit := uq.limit; limit != nil { + switch limit, offset := uq.limit, uq.offset; { + case limit != nil && offset != nil: + v.Range(*offset, *offset+*limit) + case offset != nil: + v.Range(*offset, math.MaxInt64) + case limit != nil: v.Limit(*limit) } if unique := uq.unique; len(unique) == 0 { diff --git a/entc/integration/integration_test.go b/entc/integration/integration_test.go index c8bd70a23..2244f147a 100644 --- a/entc/integration/integration_test.go +++ b/entc/integration/integration_test.go @@ -96,6 +96,7 @@ func TestGremlin(t *testing.T) { var tests = []func(*testing.T, *ent.Client){ Tx, Sanity, + Paging, Relation, UniqueConstraint, O2OTwoTypes, @@ -194,6 +195,30 @@ func Sanity(t *testing.T, client *ent.Client) { client.User.Delete().Where(user.IDIn(ids...)).ExecX(ctx) } +func Paging(t *testing.T, client *ent.Client) { + require := require.New(t) + ctx := context.Background() + for i := 1; i <= 10; i++ { + client.User.Create().SetName(fmt.Sprintf("name-%d", i)).SetAge(i).SaveX(ctx) + } + + require.Equal(10, client.User.Query().CountX(ctx)) + require.Len(client.User.Query().Offset(5).AllX(ctx), 5) + require.Len(client.User.Query().Offset(6).AllX(ctx), 4) + require.Equal( + []int{7, 8}, + client.User.Query(). + Offset(6). + Limit(2). + Order(ent.Asc(user.FieldAge)). + GroupBy(user.FieldAge). + IntsX(ctx), + ) + for i := 0; i < 10; i++ { + require.Equal(i+1, client.User.Query().Order(ent.Asc(user.FieldAge)).Offset(i).Limit(1).AllX(ctx)[0].Age) + } +} + func Relation(t *testing.T, client *ent.Client) { require := require.New(t) ctx := context.Background()