From 56656dfcb694204f8d4277de1cab712ccc1116ba Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Tue, 30 Jul 2019 02:45:15 -0700 Subject: [PATCH] ent/entc: configure storage driver in codegen Summary: Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1229 Reviewed By: alexsn Differential Revision: D16539934 fbshipit-source-id: b3a8bf1f1be6f65ad3f649cd921ea20fc24182bf --- entc/cmd/entc/entc.go | 31 +- entc/gen/bindata.go | 368 ++++++++++++++---- entc/gen/func.go | 60 ++- entc/gen/graph.go | 20 + entc/gen/{where.go => predicate.go} | 0 entc/gen/storage.go | 80 ++++ entc/gen/template.go | 14 +- entc/gen/template/base.tmpl | 152 +++----- entc/gen/template/builder/create.tmpl | 19 +- entc/gen/template/builder/delete.tmpl | 19 +- entc/gen/template/builder/query.tmpl | 135 +++---- entc/gen/template/builder/update.tmpl | 39 +- entc/gen/template/client.tmpl | 41 +- entc/gen/template/dialect/gremlin/by.tmpl | 44 +++ entc/gen/template/dialect/gremlin/decode.tmpl | 58 +++ entc/gen/template/dialect/gremlin/errors.tmpl | 46 +++ entc/gen/template/dialect/gremlin/meta.tmpl | 11 + .../template/dialect/gremlin/predicate.tmpl | 107 +++++ entc/gen/template/dialect/gremlin/query.tmpl | 32 +- entc/gen/template/dialect/gremlin/update.tmpl | 23 +- entc/gen/template/dialect/sql/by.tmpl | 28 ++ entc/gen/template/dialect/sql/decode.tmpl | 59 +++ entc/gen/template/dialect/sql/errors.tmpl | 21 + entc/gen/template/dialect/sql/meta.tmpl | 42 ++ entc/gen/template/dialect/sql/predicate.tmpl | 145 +++++++ entc/gen/template/dialect/sql/query.tmpl | 73 +++- entc/gen/template/ent.tmpl | 111 +----- entc/gen/template/example.tmpl | 26 +- entc/gen/template/import.tmpl | 12 +- entc/gen/template/meta.tmpl | 55 +-- entc/gen/template/predicate.tmpl | 16 +- entc/gen/template/where.tmpl | 254 +++--------- entc/integration/compose/docker-compose.yaml | 2 +- entc/integration/ent/card.go | 60 +-- entc/integration/ent/card/card.go | 10 +- entc/integration/ent/card_query.go | 4 +- entc/integration/ent/card_update.go | 18 +- entc/integration/ent/comment.go | 54 +-- entc/integration/ent/comment/comment.go | 1 + entc/integration/ent/comment_query.go | 4 +- entc/integration/ent/comment_update.go | 18 +- entc/integration/ent/ent.go | 83 ++-- entc/integration/ent/example_test.go | 90 ++--- entc/integration/ent/fieldtype.go | 116 +++--- entc/integration/ent/fieldtype/fieldtype.go | 5 +- entc/integration/ent/fieldtype_query.go | 4 +- entc/integration/ent/fieldtype_update.go | 18 +- entc/integration/ent/file.go | 64 +-- entc/integration/ent/file/file.go | 5 +- entc/integration/ent/file_query.go | 4 +- entc/integration/ent/file_update.go | 18 +- entc/integration/ent/group.go | 76 ++-- entc/integration/ent/group/group.go | 22 +- entc/integration/ent/group_query.go | 4 +- entc/integration/ent/group_update.go | 18 +- entc/integration/ent/groupinfo.go | 64 +-- entc/integration/ent/groupinfo/groupinfo.go | 10 +- entc/integration/ent/groupinfo_query.go | 4 +- entc/integration/ent/groupinfo_update.go | 18 +- entc/integration/ent/node.go | 60 +-- entc/integration/ent/node/node.go | 14 +- entc/integration/ent/node_query.go | 4 +- entc/integration/ent/node_update.go | 18 +- entc/integration/ent/pet.go | 60 +-- entc/integration/ent/pet/pet.go | 14 +- entc/integration/ent/pet_query.go | 4 +- entc/integration/ent/pet_update.go | 18 +- entc/integration/ent/predicate/predicate.go | 72 ++-- entc/integration/ent/user.go | 76 ++-- entc/integration/ent/user/user.go | 50 +-- entc/integration/ent/user_query.go | 4 +- entc/integration/ent/user_update.go | 18 +- entc/integration/generate.go | 4 +- entc/integration/migrate/entv1/ent.go | 140 +------ .../integration/migrate/entv1/example_test.go | 26 +- .../migrate/entv1/predicate/predicate.go | 19 +- entc/integration/migrate/entv1/user.go | 49 --- entc/integration/migrate/entv1/user/user.go | 5 +- entc/integration/migrate/entv1/user/where.go | 239 +++--------- entc/integration/migrate/entv1/user_create.go | 35 -- entc/integration/migrate/entv1/user_delete.go | 19 - entc/integration/migrate/entv1/user_query.go | 141 +------ entc/integration/migrate/entv1/user_update.go | 82 ---- entc/integration/migrate/entv2/ent.go | 140 +------ .../integration/migrate/entv2/example_test.go | 42 +- entc/integration/migrate/entv2/group.go | 37 -- entc/integration/migrate/entv2/group/group.go | 1 + entc/integration/migrate/entv2/group/where.go | 74 +--- .../integration/migrate/entv2/group_create.go | 26 -- .../integration/migrate/entv2/group_delete.go | 19 - entc/integration/migrate/entv2/group_query.go | 141 +------ .../integration/migrate/entv2/group_update.go | 64 --- entc/integration/migrate/entv2/pet.go | 37 -- entc/integration/migrate/entv2/pet/pet.go | 1 + entc/integration/migrate/entv2/pet/where.go | 74 +--- entc/integration/migrate/entv2/pet_create.go | 26 -- entc/integration/migrate/entv2/pet_delete.go | 19 - entc/integration/migrate/entv2/pet_query.go | 141 +------ entc/integration/migrate/entv2/pet_update.go | 64 --- .../migrate/entv2/predicate/predicate.go | 51 +-- entc/integration/migrate/entv2/user.go | 49 --- entc/integration/migrate/entv2/user/user.go | 5 +- entc/integration/migrate/entv2/user/where.go | 239 +++--------- entc/integration/migrate/entv2/user_create.go | 35 -- entc/integration/migrate/entv2/user_delete.go | 19 - entc/integration/migrate/entv2/user_query.go | 141 +------ entc/integration/migrate/entv2/user_update.go | 82 ---- entc/integration/plugin/ent/boring.go | 54 +-- entc/integration/plugin/ent/boring/boring.go | 1 + entc/integration/plugin/ent/boring_query.go | 4 +- entc/integration/plugin/ent/boring_update.go | 18 +- entc/integration/plugin/ent/ent.go | 83 ++-- entc/integration/plugin/ent/example_test.go | 26 +- .../plugin/ent/predicate/predicate.go | 8 +- entc/integration/plugin/plugin_test.go | 2 +- entc/plugin/plugin.go | 16 +- go.sum | 4 + 117 files changed, 2257 insertions(+), 3592 deletions(-) rename entc/gen/{where.go => predicate.go} (100%) create mode 100644 entc/gen/storage.go create mode 100644 entc/gen/template/dialect/gremlin/by.tmpl create mode 100644 entc/gen/template/dialect/gremlin/decode.tmpl create mode 100644 entc/gen/template/dialect/gremlin/errors.tmpl create mode 100644 entc/gen/template/dialect/gremlin/meta.tmpl create mode 100644 entc/gen/template/dialect/gremlin/predicate.tmpl create mode 100644 entc/gen/template/dialect/sql/by.tmpl create mode 100644 entc/gen/template/dialect/sql/decode.tmpl create mode 100644 entc/gen/template/dialect/sql/errors.tmpl create mode 100644 entc/gen/template/dialect/sql/meta.tmpl create mode 100644 entc/gen/template/dialect/sql/predicate.tmpl diff --git a/entc/cmd/entc/entc.go b/entc/cmd/entc/entc.go index 4bb5e8143..7b1cbc622 100644 --- a/entc/cmd/entc/entc.go +++ b/entc/cmd/entc/entc.go @@ -10,6 +10,7 @@ import ( "text/template" "unicode" + "fbc/ent/entc/gen" "fbc/ent/entc/plugin" "github.com/spf13/cobra" @@ -58,16 +59,17 @@ func main() { ), Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, path []string) { - graph, err := plugin.LoadGraph(path[0]) + graph, err := plugin.LoadGraph(path[0], gen.Config{}) failOnErr(err) graph.Describe(os.Stdout) }, }, func() *cobra.Command { var ( - plugins []string - header, target string - cmd = &cobra.Command{ + cfg gen.Config + storage []string + plugins []string + cmd = &cobra.Command{ Use: "generate [flags] path", Short: "generate go code for the schema directory", Example: examples( @@ -76,16 +78,18 @@ func main() { ), Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, path []string) { - graph, err := plugin.LoadGraph(path[0]) - failOnErr(err) - - if target == "" { + if cfg.Target == "" { abs, err := filepath.Abs(path[0]) failOnErr(err) - target = filepath.Dir(abs) + cfg.Target = filepath.Dir(abs) } - graph.Target = target - graph.Header = header + for _, s := range storage { + sr, err := gen.NewStorage(s) + failOnErr(err) + cfg.Storage = append(cfg.Storage, sr) + } + graph, err := plugin.LoadGraph(path[0], cfg) + failOnErr(err) failOnErr(graph.Gen()) // execute additional plugins. @@ -95,9 +99,10 @@ func main() { }, } ) - cmd.Flags().StringVar(&header, "header", "", "override codegen header") - cmd.Flags().StringVar(&target, "target", "", "target directory for codegen") + cmd.Flags().StringVar(&cfg.Header, "header", "", "override codegen header") + cmd.Flags().StringVar(&cfg.Target, "target", "", "target directory for codegen") cmd.Flags().StringSliceVarP(&plugins, "plugin", "", nil, "specifies additional plugin to execute") + cmd.Flags().StringSliceVarP(&storage, "storage", "", []string{"sql"}, "list of storage drivers to support") return cmd }(), ) diff --git a/entc/gen/bindata.go b/entc/gen/bindata.go index ab3a321cb..b40406a62 100644 --- a/entc/gen/bindata.go +++ b/entc/gen/bindata.go @@ -9,14 +9,24 @@ // template/client.tmpl // template/config.tmpl // template/context.tmpl +// template/dialect/gremlin/by.tmpl // template/dialect/gremlin/create.tmpl +// template/dialect/gremlin/decode.tmpl // template/dialect/gremlin/delete.tmpl +// template/dialect/gremlin/errors.tmpl // template/dialect/gremlin/group.tmpl +// template/dialect/gremlin/meta.tmpl +// template/dialect/gremlin/predicate.tmpl // template/dialect/gremlin/query.tmpl // template/dialect/gremlin/update.tmpl +// template/dialect/sql/by.tmpl // template/dialect/sql/create.tmpl +// template/dialect/sql/decode.tmpl // template/dialect/sql/delete.tmpl +// template/dialect/sql/errors.tmpl // template/dialect/sql/group.tmpl +// template/dialect/sql/meta.tmpl +// template/dialect/sql/predicate.tmpl // template/dialect/sql/query.tmpl // template/dialect/sql/update.tmpl // template/ent.tmpl @@ -94,7 +104,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _templateBaseTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x59\x4b\x6f\xdc\x38\x12\x3e\x77\xff\x8a\x1a\xad\x3d\x90\xbc\x1a\x75\x92\xc3\x1e\x1c\xf8\x90\x49\x9c\x6c\x00\x4f\x36\x8e\xed\x5d\x2c\x0c\xc3\xa1\xa5\x92\x9a\xb0\x44\xca\x24\xd5\x76\xa3\x47\xff\x7d\x51\x24\xf5\xe8\xd7\xd8\x9b\x19\x1f\x1a\xdd\x7c\xd4\x8b\x5f\x7d\x55\xa4\x57\x2b\xc8\x30\xe7\x02\x21\xb8\x63\x1a\x03\x68\xdb\xe9\x74\xb5\x82\x83\xfa\xbe\x80\xe3\x13\xa0\x41\x38\x48\xde\x4b\x91\xf3\x22\xf9\xca\xd2\x7b\x56\x20\x2d\x5a\xad\xc0\x60\x55\x97\xcc\x20\x04\x73\x64\x19\xaa\xc0\xed\xf2\x12\x86\x59\x5e\xd5\x52\x99\x00\x0e\xec\xd4\x6c\x06\xff\x52\x19\x2a\x60\x75\x5d\x72\xd4\xc0\x04\x48\x1a\xe0\xa2\x00\x29\x00\xb9\x99\xa3\x82\x42\xb1\x7a\x0e\x46\xb1\x05\x2a\xcd\x4a\x90\x0a\xf4\x43\x09\x1a\x4b\x4c\x8d\x54\xc9\xd4\x2c\x6b\xf4\x92\xb4\x51\x4d\x6a\x60\x35\x9d\x5c\x9c\x9f\x01\xfd\xe5\x8d\x48\xc3\x23\xfd\x50\x26\x17\x7e\x43\x34\x9d\x7c\x52\x58\x95\x5c\xf8\xc9\x4c\x97\xc9\x65\x27\x3e\x9a\x3a\xa3\x15\x13\x05\xc2\x41\x1e\xc3\x81\xb5\x89\x42\xe0\xbe\xb4\xed\x74\x42\x71\xc9\xe1\x04\x6a\xa6\x53\x56\xd2\x77\x1a\x9d\xcd\xc0\x4d\xb4\x6d\xef\x93\x99\x23\x14\x7c\x81\x02\x72\x8e\x65\xa6\x81\x0b\x5a\xd4\xd4\x35\x2a\xbf\xd4\x8a\x4d\xa6\x13\xb2\xa6\x17\x10\xfa\xe5\x49\x92\x68\x43\x11\x89\xbc\x8b\xab\xe9\x64\xa2\xd0\x34\x4a\xb8\x01\xfa\x4d\xde\x1e\x3b\x6f\x34\xac\x3b\x6b\xd7\x4f\x26\xb9\x54\x70\x1b\x43\x4e\x6e\x38\xd7\xbc\x7c\x37\x3d\xd1\x89\x15\xf6\xeb\x32\xa4\xdd\x83\x11\x51\x64\xe7\x5b\xfa\x6c\x63\xfa\xf4\xb1\xf3\xea\x8c\x82\x8d\xf8\xbd\x50\xa1\x51\xc9\xaf\xcb\x30\x8f\x81\x76\xaf\x56\x7d\x24\xbb\x18\x6f\xea\x6d\xa7\x13\x0b\x35\x14\x59\x07\x9e\x77\x45\xa1\xb0\x20\x60\x8d\x00\xc4\xfc\x20\x97\x02\xb4\xc1\x9a\x80\x64\xcf\x40\xc9\xa6\xfe\xe5\x6e\x39\x00\x69\xb6\x81\xa0\x41\xdc\x80\xa2\xd9\x0c\x08\x48\x24\x20\x95\x65\x53\x09\x78\x54\xac\xae\x31\x83\x47\x6e\xe6\x76\x7c\xac\x90\x42\x42\x5f\x92\x3f\xc4\x1f\xb8\x03\xb5\xd2\x3b\x24\x16\x68\x34\x98\x47\x09\x25\xbb\xc3\x52\x03\xd3\x50\x33\xc5\x2a\x34\xa8\x74\x02\x97\x73\x8a\x9f\xd2\x06\x1a\x8d\x19\x61\x88\x54\x7f\x7f\xa7\xbf\x3b\x27\x29\xda\x34\x52\x2b\xcc\x78\xca\x0c\xc6\x56\x3a\x13\x99\x1d\xd6\x98\x4a\x91\x01\x77\x29\x56\x93\x89\xac\x04\xc1\x2a\xec\x77\x0a\x7c\x32\xc3\x76\x0d\xa1\x54\x76\x8e\x12\x57\x41\xa3\x59\x81\x51\xb2\x91\x39\xce\x8f\x18\x3a\x80\xf6\x03\x3b\x52\xca\x1e\x98\xb6\x26\x40\xad\xb1\xc9\xe4\xce\xc8\x59\x9d\x0a\x05\xab\x88\x04\x98\x90\x96\x02\xdc\x67\xb7\x46\xbb\xe0\xa7\x8d\x36\xb2\xb2\x5e\xe8\x04\x3e\x4a\x05\xf8\xc4\xaa\xba\xc4\xe3\xe9\x6c\x36\x9d\xcd\x26\x9f\xe8\xc8\x09\x64\x04\xbc\xd7\xb1\x03\xe0\x9b\x28\xa1\xb9\xfe\xb0\xc3\x8e\xe2\xda\x36\x79\xa7\xc7\xbf\x2e\x9a\xca\x6f\x8d\x62\x08\x74\x53\xdd\xba\x5f\x41\x14\xc3\x0b\x76\xbd\x59\xdb\xf5\x26\x88\x9c\xe2\x8b\x94\x89\x30\x35\x4f\x31\xfc\xbc\x88\xc8\x50\x9b\xf5\xef\x74\x98\x8b\x01\x81\xb1\x85\x79\x17\xd6\x01\x98\xab\x69\x97\xfa\xfd\x18\xa5\xd3\x1f\x64\xbf\x93\xe1\x92\xce\x6f\xa5\x05\x56\x5f\x72\x71\x7e\x16\xea\xc8\x2a\xa3\x74\xb3\x79\xb6\x9e\xde\xda\x30\x65\x62\xb8\x7d\xf6\x88\xd7\x34\xe4\x22\xf1\x62\x3a\x01\x23\x0d\xed\x3a\xc1\xd2\xf1\xc5\x70\x40\x27\xfa\x91\x02\x45\x7c\xc1\x7a\x87\x7b\xae\x15\x34\xde\x71\x84\x05\xae\x27\xdc\x0f\x98\xb3\xa6\x34\x7e\x51\xdb\x9e\x51\xfe\x10\xcc\x08\xd4\x99\x9b\x74\x49\xb5\x8e\xf7\x7e\xc3\xbe\x04\x9e\xcd\xe0\xb3\x01\x3d\x97\x4d\x99\xc1\x1d\xba\xc4\x63\x4e\xae\x23\x88\x5f\x0c\x2b\xac\xbc\x0c\x53\x99\xd9\xa8\x48\x05\x0c\x2a\x56\xc3\x3d\x2e\xed\x14\x17\x06\x15\x73\xd0\xee\x29\xc3\x85\x09\x33\x50\xa8\x6b\x29\x34\x7a\x75\xbe\xfc\x81\x91\x64\xde\x43\x23\x0d\xf6\xce\xc2\x1b\x12\x5e\x49\xd5\x13\x29\x25\x37\x5b\x48\x9e\x41\x2a\x45\x5e\xf2\xd4\x58\x13\x1a\x8d\x8e\x1c\xf6\x42\xb4\x77\xdd\x01\x95\x70\xea\x72\xe9\x96\x74\x05\xd1\x77\x6b\x4d\x9f\x91\x9b\xc9\x46\xec\xd3\xdb\x29\x17\xa8\x14\xcf\x10\xb8\x49\xa6\x93\x54\x0a\x6d\xf6\x1c\xc9\xc9\xb6\x4f\xd3\xa1\x64\x8a\xcd\x9a\xb9\x1d\x80\x9d\x74\x21\x6d\x35\xe5\xf9\x18\x41\x6d\xbb\x51\x74\x41\xe6\xd0\x97\x0e\x64\xe9\xdc\x55\x83\xb5\x92\x6b\xe3\xb1\x43\x94\x13\xe0\x50\xdf\xcb\xd8\xc8\xc9\xad\xa4\x84\xe7\x8a\xf2\x38\x2d\xc7\x79\xe9\x0c\xc0\x07\x6b\x50\xf0\x1b\x32\x41\x7d\xd8\xbb\x85\x55\x5d\x6a\x8a\x43\x6f\x6d\x6f\xcd\x2e\xb3\x75\xf2\xde\x9f\xee\xb0\x33\x38\x0a\x06\x0f\xf6\x15\xf4\x21\x61\x5f\x98\xf3\x13\x32\x58\x64\x70\x72\x02\x41\xd0\x55\x77\x3b\xb0\x1b\x08\x43\x5d\xef\x1c\x47\x91\xc5\x70\x7b\x4b\x28\xb5\xda\xa3\x64\x87\x43\x57\x22\x97\x65\x16\x46\xc9\xbf\x59\xd9\xa0\xf6\xce\x8d\xb0\x1c\xed\x08\x51\x48\x06\x9f\xc9\x94\x95\x51\xef\x39\xa9\xf1\x74\xb4\xb7\xb3\x38\x55\xea\x8b\x34\x1f\x65\x23\x32\x9f\xac\x1a\x1e\xe7\x28\xc0\xa8\x25\x9d\x9b\x91\x90\xa3\x49\xe7\xc0\x40\xd7\x98\xf2\x9c\xa7\x80\xc2\x70\xb3\xb4\x59\xc9\x0d\x3c\x32\x0d\x42\x1a\xc8\xad\x0c\x5f\xaf\x33\x66\x18\xb5\xd1\xbe\xe1\x18\x6b\x19\x5a\x0e\xc7\x55\xbe\x45\xe8\xcd\x21\x2a\xa1\xda\x56\xa1\x30\x2e\x41\xd0\x0d\x12\xbf\xe4\x2c\xc5\xc4\x15\x92\x10\xe1\x68\x24\x37\x72\x7b\xc3\x31\xe2\x3a\x92\xae\x4c\x72\x51\x2b\x2e\x4c\x1e\x06\x03\x3b\x1c\xc3\xe1\xc8\xf2\x20\x06\x4c\xac\x45\x91\xb7\xe5\xb3\xde\x8a\x0c\x83\x3b\x29\x4b\x64\x02\xb8\xb0\xed\x03\x29\x7a\x9c\xa3\x2d\xda\x23\x53\x69\xe5\x10\x13\x3b\xe8\xad\x1e\x84\x86\xa8\x94\x9b\x8a\xac\x54\x32\xf8\x36\x06\x79\x4f\xfc\x8f\x4a\x25\xe1\x9a\x7b\xbd\x37\xf2\xde\xdb\xf7\x1b\xd3\xf7\xbd\x85\x15\xd3\xf7\xe4\x8d\xda\xa1\x73\xbc\x70\xac\xd5\x19\xbb\x9a\x12\xae\xd7\xed\x8a\xc6\xb9\x2e\x78\x49\xb8\xe9\x31\xac\xd4\x74\x8c\x9d\x0b\x2e\x8a\xa6\x64\xea\x59\xf8\x74\xeb\x46\xf0\xb1\x24\x6f\x68\xbd\x14\x68\x91\xf4\x3c\x8a\x7a\x7d\x7f\x3d\x90\x3a\xd1\x7f\x02\x4b\x9d\x97\x7b\xe0\xb4\x15\xac\xff\x17\x51\x43\x14\x37\x41\xd5\x89\x7e\x31\xae\x7a\x6f\x37\xa0\xe5\xc3\xf7\x9e\x2a\x9c\x62\x5c\x98\x8f\x8c\x97\xb8\x97\x1e\x52\x85\xcc\xe0\xac\xa9\x33\x2a\x07\x74\x8e\x5d\xf5\xb6\x07\xed\x2e\x2b\x19\x09\x1d\xcf\xc9\x9c\xbc\xe3\x0a\xd2\x5e\x8d\x86\xdc\x2a\x5a\xeb\x70\x63\x58\x70\x59\xba\x52\x28\x73\xc0\xac\xb0\x32\x5c\xad\x6a\x04\x7f\x68\x50\xa0\xd6\x03\x42\xb6\xcc\x1e\x60\x52\xe9\xa2\xbf\x90\xd0\xe5\xc6\x45\xe9\x87\x00\xb3\x43\xd1\x8f\x80\xc6\x39\x30\x8a\x81\x0f\x01\xc1\xc9\x22\xa8\xd2\x45\x87\x9f\x2b\x61\x6d\xde\x65\xa1\x4e\xfe\x63\xef\x6a\x7b\xb1\xbd\x6d\xab\x93\x16\x8e\x48\xa0\x4b\xef\x84\x26\xbc\xce\xf7\x92\xfa\x9d\x75\x8d\x54\x68\xbe\xd8\xf1\x17\x86\x85\x84\x84\xa3\xda\x7a\x7d\xd3\xef\x5c\xb5\xd1\x48\xb5\x36\x2a\x95\x62\x91\x9c\x53\x37\x14\x62\x52\x2b\xcc\xf9\x53\x18\xc1\xdf\x7d\x24\x62\xcb\x45\xed\xf4\x59\xdf\x2a\xa6\xf4\x9c\x95\x9f\x14\xab\xe7\x5a\x8a\xf0\x0e\xae\x6f\xee\x96\x06\x47\xee\x2e\x98\x82\x05\x5c\xbf\xbe\x39\xea\x20\x41\xd5\x5d\xd9\xd7\x8f\xc2\xef\x4b\x7a\x49\xe1\x9d\xbd\xc5\xbc\xb5\x2b\x7e\x3a\x21\x3b\xc6\x14\x49\x9c\x48\x14\xc9\x73\x58\x5c\xbf\xba\xa1\x0e\x61\x63\x05\x41\xc0\xe2\x63\x03\x01\x15\xd7\x94\xd2\x1d\x66\x16\x54\xf2\x83\xa8\x13\xf6\x93\x1b\xd6\xc9\x3f\x99\xfe\xea\xa2\x71\x44\x0a\x08\x1a\x5d\x74\xa2\x97\xa8\xe1\x62\xc1\x4a\xde\x35\x3a\xb6\x5f\xb7\x91\xf0\x40\xb3\x42\x9d\x56\x1b\x69\x38\x81\x4e\xf3\xa5\xe2\xd5\x5e\xd5\xd3\x71\x8d\x70\x90\x71\x73\x3d\x59\xf8\xab\x3a\x0d\xd9\x6b\x05\x69\x2e\xfc\xcd\xda\xc2\x9e\x09\xa3\x3b\x00\xed\x3c\xcd\x1e\x05\x5d\x5a\x79\xd9\x10\x9c\x3a\x0f\x02\x70\x9a\xbf\xe0\xe3\xa9\x52\x57\x36\xa5\x5c\x2f\xe5\xa8\x89\xa8\x73\x94\x61\x0e\x01\x64\x87\xcf\x3e\x77\xc9\xf0\x36\x6c\x09\x09\x2d\x89\xfb\x2b\x35\x74\x18\x5e\xc0\x1a\x86\x77\xe1\x70\x04\xec\x9f\x77\x4c\xaf\x2a\x5d\x1c\xaf\x33\x83\x53\x71\xa8\x93\x43\x7f\xef\xb7\x68\x38\x86\xc3\xbf\x2d\x82\x18\xc6\x76\xc4\xb0\x88\xda\xe9\xb6\xdb\xa7\x44\x8f\x2f\xf3\x9a\x98\x74\x97\xd3\x24\xa2\xf3\x99\xd6\xc4\xc0\x87\xfe\xf8\xaf\xf1\xd3\x92\xf8\xc8\x4d\x9e\x6d\xf8\xd8\xe9\xed\x7d\xfc\xac\xd7\xc5\x36\x0a\x7f\xa8\x82\x6e\x10\x6d\xa3\xb0\xaf\xa0\x5b\x0a\x5e\x56\x47\xb7\xf0\xba\xdd\xa7\x71\x27\x9b\x09\xe3\x6b\x8c\xe8\x5e\x9e\x78\x3e\x7a\x34\xed\x6e\xc8\x30\x97\xf6\xce\xbb\x95\x26\xf4\xc5\x30\x2e\xdc\x73\xd1\x5a\x03\xb0\xa1\x22\x54\x70\xe4\x77\x27\xdf\xbc\xd8\x08\x76\xda\x1b\x5b\xdf\x2c\x87\x20\x39\xb6\xf3\x08\xdb\x67\xc8\x51\x91\x96\xa6\x34\xc9\x07\x66\x58\x0c\xb8\x97\x27\x05\x27\x04\xb3\x52\xe3\x5a\x47\x19\x83\x51\x0d\xf6\xc4\xce\xf5\xc5\xf9\xd9\x60\x84\x73\x69\x74\x1a\xcf\x39\xd2\x57\x73\xd1\x54\x77\xa8\xe0\xf5\xab\x7f\xbc\xa1\xf3\x3f\xfd\x76\xfb\xe1\xea\xeb\xed\xe9\x97\xcb\x6f\xff\xa5\x16\xb3\x5a\xea\x87\x32\xb6\x8d\x68\x70\xf5\xe5\xf3\xf9\xd5\xe9\x76\x25\x0e\x68\xe3\xc5\xf9\x19\x37\x1d\x8f\x25\x36\x18\x44\x92\x1e\x07\xbe\xec\xbf\x85\x6d\xb2\xae\x74\x11\x7b\x9e\xb2\x56\x04\x11\xfc\xfe\xfb\xde\x75\x7b\x6d\x58\xa3\xf8\x7d\x49\x16\x93\x31\xad\x0f\xe5\x28\xba\xa3\x98\x3b\x3c\x2a\x59\x96\x77\x2c\xbd\x87\x94\x95\xa5\xa6\x16\xce\x3c\x25\xdf\xba\x41\x8a\x06\x75\x00\xe3\xf7\x7c\x97\x41\xc3\xa3\x4e\xb7\xd6\x67\x56\x0e\x32\x4d\x1b\xa5\x30\xf3\x70\xec\x16\x84\xe6\x09\x32\xce\x4a\x4c\x4d\x72\xf9\x64\x0d\xdc\x75\xf7\x50\x1e\x59\x23\x33\x28\x9c\x6a\x03\x43\xf4\xf3\x64\xad\xc2\x1d\xea\x63\x38\x24\xde\x18\x1d\x43\x6c\xf7\xf5\x15\x14\x95\xea\x72\x76\x1f\xac\xa2\xb7\xb4\x60\x47\x35\x5f\xbf\xf0\x50\x39\xe5\xf6\xd1\x2e\xe4\x22\xc3\x27\x38\xb0\x6d\x90\x86\x57\x51\xf2\xf9\x43\x72\x49\xfd\x67\xdb\x52\x80\xef\x71\xa9\xd7\x0a\x20\x0d\xcc\x78\xa6\x21\x57\xb2\x72\x9c\x44\x14\x58\xb1\xda\x07\x8c\x16\x84\x15\x0d\x5c\x7b\x35\x6d\x7b\xe3\x1a\x57\x2a\x2f\xd7\x37\xfd\x28\xd9\xa9\xc9\x88\x8a\xdd\x63\x38\x9a\x88\xe1\x55\x0c\x25\x8a\xb0\xa2\xb2\x6c\x1f\xe4\xb2\x18\x6e\x87\x7f\x4a\x54\xd6\x45\x0d\x27\x40\xad\xa2\xc8\x42\x6d\x29\x76\xec\xa9\x9e\x8e\x9f\x07\xfe\x17\x00\x00\xff\xff\xa3\xe9\xef\xdd\x27\x1b\x00\x00") +var _templateBaseTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\x4b\x6f\xdc\x36\x10\x3e\x4b\xbf\x62\x20\x6c\x0a\xa9\x50\xa4\x24\xc7\x05\x7c\xc8\xa3\x2e\x72\x68\x1a\xc0\x29\x72\x08\x02\x83\x96\x46\x5a\x62\x25\x52\x21\xa9\xb5\x0d\x41\xff\xbd\x18\x52\xaf\x7d\xc5\x9b\x34\xbd\x18\x5e\x3e\x66\xbe\xf9\xe6\x9b\x19\xee\x76\x1d\xe4\x58\x70\x81\x10\xdc\x31\x8d\x01\xf4\xbd\xef\x77\x1d\xac\x9a\x6d\x09\xeb\x2b\xa0\x45\x58\x25\x6f\xa5\x28\x78\x99\x7c\x64\xd9\x96\x95\x48\x87\xba\x0e\x0c\xd6\x4d\xc5\x0c\x42\xb0\x41\x96\xa3\x0a\xdc\xad\xc1\xc2\xbc\xcb\xeb\x46\x2a\x13\xc0\xca\x6e\xa5\x29\xfc\xad\x72\x54\xc0\x9a\xa6\xe2\xa8\x81\x09\x90\xb4\xc0\x45\x09\x52\x00\x72\xb3\x41\x05\xa5\x62\xcd\x06\x8c\x62\x3b\x54\x9a\x55\x20\x15\xe8\x6f\x15\x68\xac\x30\x33\x52\x25\xbe\x79\x6c\x70\xb0\x54\xb4\x22\x0b\xbb\x0e\x78\x01\xa5\x81\xb0\x42\x01\xab\xe4\xc6\x48\xc5\x4a\x8c\xe0\x25\xf4\x3d\x17\x06\x55\xc1\x32\xec\xfa\xae\x03\xac\x34\xc5\xd0\x75\x10\x72\x91\xe3\xc3\x7c\x1a\x5e\x44\xc9\x9b\x96\x57\x64\xd5\x1e\x40\x91\x43\xdf\x47\x36\xa2\xf3\xe6\xa7\xa0\x3e\xa2\x7a\xc7\x19\x41\x84\x4c\x0a\x6d\x54\x9b\x19\x30\x1b\x84\xc0\x86\x08\x77\x8f\x01\x64\x15\x6b\x35\x42\x21\x8f\x82\xd4\x96\xee\x9c\x58\xc8\x07\x2b\x14\x65\xe2\x53\x80\x87\x0e\x28\x60\xc5\x44\x89\xb0\xe2\x31\xac\xf4\x10\xc0\xfa\x6a\x11\x8d\x0d\x81\x17\xb0\xe2\xd0\xf7\xf1\x14\x4e\x41\x09\xa6\xa5\x89\xb9\xf1\xfa\x22\xf8\x68\x8e\x7e\xa0\xb9\xf3\x3d\x85\xa6\x55\xc2\x7d\x0e\x2d\xaa\x70\x07\x0b\x72\x23\x3a\xe4\xe9\x7b\x6e\xb2\x0d\xec\x08\xcc\x2e\x09\x29\x06\xb7\xd1\x75\xcf\x2f\xc0\xec\x7b\x5e\x46\xb2\x3b\x8d\x6b\xed\x7b\x9e\x37\x45\x10\xee\xa2\xc1\xae\xc3\xea\x7b\x5e\x8e\x05\x6b\x2b\x63\xcf\x35\x4c\xf0\x2c\x2c\x6a\x93\xdc\x34\x8a\x0b\x53\x84\x41\x2b\xb6\x42\xde\x0b\xcb\xac\x4d\x82\xcd\xcc\x1a\x9e\x7d\x0a\x62\xd8\x45\x64\xae\xf7\xbd\x3e\xf2\xad\xc6\x07\xab\xfe\x4c\x76\x11\xc3\xca\x25\x73\x7d\xe5\xee\x5a\xb7\x04\xa8\x80\x2b\x68\x98\xce\x58\x45\xff\xd3\x6a\x9a\x82\xdb\xe8\xfb\x49\xef\x24\x87\x92\xef\x50\x40\xc1\xb1\xca\x35\x70\x41\x87\xda\xa6\x41\x35\x1c\xb5\x66\x13\xdf\xb3\x0c\x8f\x06\xc2\xe1\x78\x92\x24\xda\x50\xb5\x2c\xf2\xb2\x97\x98\xef\x4a\x75\x16\xd0\x14\x5d\x48\x4c\xcd\x01\xde\x9e\xcb\xcc\x73\x4b\xaf\x63\xfb\x9e\x9b\x0d\xe0\x83\x21\x0b\x53\x11\x7d\x90\x39\x6a\x78\x11\x41\x70\xdd\x8a\x2c\x20\xd8\x81\x45\x14\x8c\x94\x8d\x26\x2c\x5d\xa6\x6e\x2a\xf2\xe0\x32\x03\xc1\xa0\xf9\xf4\x99\x4e\xe5\x70\x4b\x2f\x45\x31\xb8\x7e\x98\x3a\x8b\xb3\x90\x90\xb6\x07\x60\x36\xa2\xc1\xc9\xde\xa7\xc8\xf7\xf6\xf2\x99\xa6\xf0\xba\x2c\x15\x96\x64\x67\xd1\x89\xd8\xb0\xc8\xa5\x00\x6d\xb0\xa1\x5a\xb4\x09\x53\xb2\x6d\x9e\xdf\x3d\xce\xc5\x9a\x1e\xb4\xa2\xd9\xdc\x50\xf6\x9d\x7f\x39\xa9\x4f\xd0\x61\xbd\xa7\x9a\x97\x82\x99\x56\xe1\x21\x31\xe7\x58\xf1\x97\x1c\xf4\xbe\x8b\x5a\x03\xd7\xc0\xa0\xd1\xd8\xe6\x72\x2f\x5e\x52\x9b\xfb\x47\x2a\x50\x28\x58\x4d\x2d\x99\x09\x69\x1b\xb2\xfb\x3b\x9e\xd1\x4e\x01\x59\xab\x8d\xac\x41\xb0\x1a\x75\x02\xd7\x52\x01\x3e\xb0\xba\xa9\x70\xed\xa7\xa9\x9f\xa6\xde\x9f\x84\xfc\xcd\xa3\xd3\xee\xcb\xd8\x49\xfe\x55\x94\xd0\xde\xc4\x58\x38\x0e\x9c\xbe\x4f\x5e\xeb\xe5\xa7\x9b\xb6\x1e\xae\x46\x31\x04\xba\xad\x6f\xdd\xa7\x20\x8a\xe1\x82\x5b\xaf\xf6\x6e\xbd\x0a\x22\xe7\xf8\x26\x63\x22\xcc\xcc\x43\x0c\xbf\xed\x22\x02\x6a\xeb\xec\xb5\x0e\x0b\x31\xa7\x31\xb6\xcc\x8d\x95\x36\x67\x77\xee\x82\xd3\x9a\x6b\x6d\x97\xd6\xcf\x45\xb9\x66\xfa\x48\xfd\x94\xe5\xa9\x1f\xbe\xcf\x51\x98\x0f\xac\xa6\xcd\x35\xb5\x88\x73\x55\xb1\xac\x02\x2b\x82\x19\x28\x65\x2d\x86\x15\x25\xf2\x9a\xf8\x21\x40\x6c\x8a\x73\x6a\x6a\xc2\x02\x1d\xda\x9a\x70\x2e\x7f\xb5\xb4\xed\xb0\x3c\x96\x35\xf5\xb1\x0d\xd3\x9f\xf6\x43\x9b\x68\x7c\xa2\x09\x11\x3d\xc1\x00\x79\xea\x48\x62\xd1\xc6\xce\x14\xcd\x44\xda\x88\x62\xfc\x7f\xd1\x3f\xa6\xce\x2e\x0e\x5b\x7b\xd7\xc1\xb7\x56\x1a\x9c\xb8\x3a\x5d\x63\xd2\x36\x7d\x9a\xcd\x33\xff\x7d\x7f\x30\x1b\x40\x16\x30\x39\x45\x96\x6d\x5c\x1f\xda\x9b\x0c\x04\x20\x3c\x61\xca\x19\x70\xfa\x5d\x8c\xf2\x3d\x21\x1f\x29\xd9\x2e\xfe\x4f\xb3\x40\x40\xf0\x79\xc4\x17\x2c\xb1\x5e\x3a\x14\x9c\x54\x0a\x67\xee\xd4\x64\xf8\xf1\xea\xf8\xee\xcc\xe8\x8f\x67\xc6\x1f\x4a\x7d\x90\xe6\x5a\xb6\x22\x07\xc7\x9d\x86\xfb\x0d\x0a\x30\xea\x91\x9a\xa5\x91\x50\x20\xbd\x7d\x18\xe8\x06\x33\x5e\xf0\x0c\x50\x18\x6e\x1e\x81\x89\x1c\xb8\x81\x7b\xa6\x41\x48\x03\x85\xb5\xc1\xdd\x74\xc9\x99\x61\xf4\xf4\x1b\x46\xc9\xd2\xcb\x3c\x4c\x2a\x76\x87\xd5\x90\x50\x7f\x82\x23\x15\x70\x6a\xb8\x35\x0a\xe3\x04\x88\x6e\x71\x7c\x94\x0d\xaf\xc7\x10\xe1\xf7\x85\xdd\xc8\xdd\x0d\xa3\xc1\xe0\xa2\xad\xed\xbd\x96\xe6\xae\xba\x86\x67\x0b\xe4\x41\x0c\x98\x58\x44\xd1\x80\xe5\xbd\x3e\x62\x86\xc1\x9d\x94\x15\x32\x01\x5c\xe4\x3c\x63\x86\x1c\xdd\x6f\xd0\x4e\x92\x05\x54\x3a\x39\x73\x62\x17\x07\xd4\xb3\xd1\x10\x95\x72\x5b\x91\xb5\x4a\x80\x6f\x63\x90\x5b\x12\x0b\x2a\x95\x84\x7b\xe1\x4d\xd1\xc8\xed\x80\xef\x2f\xa6\xb7\x13\xc2\x9a\xe9\x2d\x45\xa3\x4e\xf8\x5c\x1e\x5c\x7a\x75\x60\x3b\xdf\xe3\xc5\x01\xae\x68\x59\x4b\x82\x57\xa4\x9b\xf1\x23\x2a\xe5\x2f\xb5\x73\xc3\x45\xd9\x56\x4c\x3d\x29\x9f\xf1\xdc\x42\x3e\xb5\x54\x48\xbc\x51\xf7\x40\xab\xa4\xa7\x55\x34\xf9\xfb\xf5\x42\x1a\x4d\xff\x07\x2d\x8d\x51\x9e\x91\xd3\x11\x59\x3f\xaa\xa8\x99\xc5\x43\x51\x8d\xa6\x2f\xd6\xd5\x14\xed\x81\xb4\x06\xfa\xde\xda\xaf\x7b\x8c\x0b\x73\xcd\x78\x85\x67\xdb\x43\xa6\x90\x19\x4c\xdb\x26\xa7\x6e\x44\x79\x94\xca\x25\xd6\x26\xda\x3d\x43\x73\x32\xba\xdc\x93\x05\x45\xc7\xd5\xf0\xad\x92\xdc\x68\x28\xac\xa3\xbd\x67\x57\x0c\x3b\x2e\x2b\x37\x6a\x64\x01\x98\x97\xd6\x86\x9b\x05\xad\xe0\xdf\x5a\x14\xa8\xf5\xac\x90\x23\xd8\xb3\x4c\x6a\x5d\x8e\x22\xf1\xee\x15\x6b\x1c\x4b\x3f\x25\x98\x13\x8e\x7e\x46\x34\x2e\x80\x05\x07\x03\x05\x24\x27\xab\xa0\x5a\x97\xa3\x7e\xfe\x11\x16\xf3\x29\x84\x3a\xf9\xac\x98\xfd\xb6\x75\x46\xdb\xc7\x58\x9d\xb5\x70\xd1\x04\xc6\xf2\x4e\x68\x63\xd2\xec\xfe\xcd\x56\xe1\x4f\x29\xf7\x20\xc0\x56\xe1\xa4\xdc\x23\x07\x97\xe9\xf7\x28\xa2\x03\x11\x5f\x3a\xf1\x9f\x98\xd0\x8e\xde\x83\xe9\xfc\xdd\x67\xdc\x89\xd9\xbc\x3a\x78\x6b\x2d\x66\xb2\xfd\x65\x8a\xdb\x87\xea\xd1\x43\x23\x79\xff\x2e\xf9\x44\xaa\x76\x3f\xc7\x6c\xf1\x51\x4f\xe4\x13\xbf\xb4\x90\xf2\x5c\x43\xa1\x64\xed\x18\xa7\xea\xa8\x59\x33\x90\x4b\x07\xc2\x9a\x16\xbe\x0c\x6e\xfa\xfe\xab\x2b\x87\xae\x8f\xe0\xcb\xd7\x69\x95\x38\xd6\x04\xa2\x66\x5b\x0c\x17\x1b\x31\xbc\x88\xa1\x42\x11\xd6\x51\xe4\x7b\xf4\x35\x8a\xe7\x31\xdc\xd2\x51\x47\x6f\xed\x7e\x1f\x81\x2b\x7a\x32\xa2\xc8\x43\x1d\x03\xcf\xa3\xe5\xc0\xd0\x7b\x3f\x3c\xfc\x1b\x00\x00\xff\xff\xe8\xa7\x61\x42\xa0\x13\x00\x00") func templateBaseTmplBytes() ([]byte, error) { return bindataRead( @@ -109,12 +119,12 @@ func templateBaseTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/base.tmpl", size: 6951, mode: os.FileMode(420), modTime: time.Unix(1563979564, 0)} + info := bindataFileInfo{name: "template/base.tmpl", size: 5024, mode: os.FileMode(420), modTime: time.Unix(1564435014, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateBuilderCreateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x56\x4d\x6f\xdc\x36\x10\x3d\x4b\xbf\x62\x22\xa8\xc5\xca\xb0\xb5\xe8\x75\x0b\xf7\x50\x3b\x45\x0b\xa4\x6e\x03\xb7\x45\x80\xa6\x28\x68\x69\xa4\x25\xcc\xa5\x64\x92\x92\x6d\x08\xfa\xef\xc5\x90\xd4\x67\x9c\xed\xc6\x39\x99\xa6\x38\xef\x0d\xdf\x1b\xce\x6c\xd7\x41\x8e\x05\x97\x08\x51\xa6\x90\x19\x8c\xa0\xef\xc3\xae\x83\xb8\xbe\x2f\x61\x77\x09\x77\x4c\x23\xc4\xe9\x55\x25\x0b\x5e\xa6\xbf\xb3\xec\x9e\x95\xe8\xcf\x18\x3c\xd4\x82\x19\x84\x68\x8f\x2c\x47\x15\xb9\xa8\xbe\x0f\x97\x5f\xf9\xa1\xae\x94\x89\x20\x1e\x3e\xc5\x77\x0d\x17\x39\x2a\x22\xa8\x15\x97\x06\x36\x35\xd3\x19\x13\x10\xa7\x37\xec\x80\x09\x44\x57\xcb\x6c\x14\x66\xc8\x5b\x17\x31\xae\x47\x18\x82\xdd\x6e\x61\x8e\xdc\xf7\xc0\x35\x98\x3d\xc2\xb0\x53\x54\x0a\xec\x1d\xb9\x2c\x81\xd9\xc3\x96\x8c\x8e\xa2\x34\xdc\x3c\xa7\xa1\x79\xae\x71\x0d\xa3\x8d\x6a\x32\x03\x5d\x18\x64\x56\x84\x30\xe8\x3a\x50\x4c\x96\x08\xf1\xbf\xe7\x10\x17\x94\x53\x9c\xfe\xc4\x51\xe4\x9a\x52\x09\x82\xae\xbb\x80\xb8\x48\x6f\x6d\xa4\xfd\x40\x40\x67\x04\x5c\xa4\x7f\x10\x07\x1d\xeb\x3a\x40\x99\xfb\xe5\xc5\x1c\x12\x1d\xe4\xdb\xbc\xc4\x39\x22\xae\x11\x0f\xac\xfe\xdb\xde\xe3\x97\xeb\x01\xf6\x1f\x97\x6e\x37\xe1\x5f\xf4\x7d\xe8\x64\x7f\xe4\x66\x0f\xf8\x64\x68\x37\x86\xe8\x47\x77\xc7\x68\xa1\x63\xb0\x70\x4e\xa3\x31\x74\x22\xf5\x3e\xf8\x7c\x49\xec\x5b\xd6\xa2\xd3\x13\x9d\xce\x0b\x41\xb9\xb4\x7b\x39\x33\x8c\x2a\x28\x0d\x8b\x46\x66\xb0\x59\x58\x39\x48\x32\xb1\x27\x16\x75\x93\x99\x27\xc8\x2a\x69\xf0\xc9\x50\xe1\xd1\xdf\x04\x36\x67\x73\x82\x73\x40\xa5\x2a\x95\x90\x2d\xc7\xec\xb8\x18\xd5\xe3\x05\x54\x8a\xf4\xff\x99\xe9\x6b\x2c\x58\x23\x0c\x6c\x64\x65\x68\xeb\xb7\xda\xf0\x4a\x32\x91\xf8\xf3\x01\x2f\x60\x95\x6a\xea\xcc\x5b\x19\x70\x79\x09\x92\x0b\x4a\x22\x20\x16\x22\x59\x32\x78\xbc\x20\x68\x29\x2d\x7b\x83\xe9\x0d\x79\x4c\x7f\xf6\xaa\x92\xda\x30\x69\x60\x08\x39\x2d\x03\xf8\xb6\x1d\xd8\x51\x68\x9c\x18\x15\x9a\x46\x49\xca\xcf\x8b\xa5\xd3\x1b\x7c\xdc\x44\xc3\xe3\xee\xfb\x1d\x1c\xb8\xd6\xf4\x1c\x14\x3e\x34\x5c\x61\x0e\x85\xc5\xfd\x18\x39\x2e\x2f\xf6\xc7\x28\x4a\x46\x0e\x5f\x51\x41\x10\x38\x65\x67\x3b\x43\x89\xc5\x45\xfa\x17\x13\x3c\x67\xa6\x52\x83\x05\x41\xd7\x6d\xcf\x80\xe5\x39\xc8\x46\x08\x76\x27\x10\xb2\x3d\x66\xf7\x50\x49\xf1\x6c\xdf\x66\xe5\x4d\x70\x39\x68\x0b\x55\x35\x86\xfa\x93\x95\xb2\x65\xa2\x41\x38\xdb\x4e\x80\x10\x8f\x58\xbb\x4b\x60\x54\xd5\x93\x97\xa3\xb9\x93\x1b\xc9\x14\x6a\xeb\x61\x0a\xa7\x8a\x3d\xd1\xf2\x37\xde\x72\x58\x8a\x41\x25\x83\x4a\x7d\xde\xe5\x51\x11\xe8\x7b\x57\xcb\xff\x47\x95\x7c\x6f\x11\xdf\xcc\x6b\x6c\xe1\x6a\x71\x30\xe9\x5b\x72\xb6\x58\xba\xda\x8e\x54\x05\xe3\x82\x5c\xa5\xe5\xcb\xce\xee\xe0\x9b\x36\xb2\x05\xe2\x2c\xfe\xac\x3e\x3d\xcc\xfa\xd5\xc2\xf7\xe5\xfa\x84\x46\x46\xd0\x98\xfe\x29\xf9\x43\x83\xb3\x17\x27\x50\xae\x1b\x84\xd5\x65\xdd\xf6\x12\xf8\x01\xbe\xf3\x7a\x9c\x54\xe4\x8d\x30\xbc\x16\x08\x4c\x6b\x5e\xca\x03\x4a\xa3\xa1\x92\xc0\xa0\x71\x29\x60\x5e\xa2\x57\x06\xd7\x35\xff\x42\x91\xdb\x0b\xd8\xe2\xc2\xa9\xda\x8e\x37\x8e\x4f\x3a\xf7\xa2\x71\xbc\xea\xa5\x7e\x49\xd2\xf3\xb5\x7e\xe4\x26\xdb\x7f\x92\x65\xae\x68\x95\x5e\x73\x26\x30\x33\x1b\xdb\x58\x33\x9a\xfd\xb9\xdb\x49\x7f\x7d\xbe\x7d\xff\xee\x7c\xfc\xf7\xf6\xfd\x3b\x6e\x70\x17\x8e\xd9\xaf\x01\xf5\x83\x18\x9a\x79\xb2\x82\xba\xc1\xda\x34\xf2\x58\x70\xa9\xf0\x20\xb8\x9c\x01\xf8\x2e\x30\x8b\x39\x2a\x57\x23\x75\x53\xd3\xaf\x0e\xcc\x07\x5a\x92\xc6\x4e\x42\x3f\xbc\x3e\x40\xc6\x84\xd0\x6e\x90\x51\xf3\xa8\x99\xe4\x99\x26\x73\xed\x96\xa3\xd1\xc0\xa4\x63\xf9\xa2\x19\xf6\xe1\xe5\x21\xb6\x98\x61\x24\x71\x7b\x3e\xef\x1a\x73\x09\x66\x77\xf7\xad\x65\xd6\x08\x6c\xaa\x1b\xf7\x68\xfb\x70\x50\xa4\x7d\xf5\x9c\xf7\x12\x6d\xf5\x83\xd8\x0e\xbf\x03\xd7\x33\xff\xab\x80\xbd\xa1\xc7\xc0\xfd\xf2\xbf\x00\x00\x00\xff\xff\x44\xad\x3e\xa5\x92\x0a\x00\x00") +var _templateBuilderCreateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x56\x4d\x6f\xdc\x36\x10\x3d\x4b\xbf\x62\x22\x28\xc5\xca\xb0\xb5\xe8\x75\x0b\xf7\x50\x3b\x45\x7b\x49\x0b\xb8\x2d\x02\x34\x45\x41\x4b\xa3\x5d\xd6\x5c\x4a\x21\x47\xb2\x0d\x41\xff\xbd\x18\x92\xfa\xda\x38\xee\xa6\xa7\xe5\x52\xe4\x9b\xe1\x7b\x8f\x33\xec\x7b\x28\xb1\x92\x1a\x21\x29\x0c\x0a\xc2\x04\x86\x21\xee\x7b\x48\x9b\x87\x3d\xec\xae\xe1\x5e\x58\x84\x34\xbf\xa9\x75\x25\xf7\xf9\xaf\xa2\x78\x10\x7b\x0c\x6b\x08\x8f\x8d\x12\x84\x90\x1c\x50\x94\x68\x12\xbf\x6b\x18\xe2\xf5\x57\x79\x6c\x6a\x43\x09\xa4\xe3\xa7\xf4\xbe\x95\xaa\x44\xc3\x01\x1a\x23\x35\xc1\xa6\x11\xb6\x10\x0a\xd2\xfc\xbd\x38\x62\x06\xc9\xcd\x3a\x1b\x83\x05\xca\xce\xef\x98\xc6\x13\x0c\xc3\x6e\xb7\xb0\x44\x1e\x06\x90\x16\xe8\x80\x30\xce\x54\xb5\x01\x77\x46\xa9\xf7\x20\xdc\x62\x17\x8c\x97\xa2\x26\x49\xcf\x79\x4c\xcf\x0d\x9e\xc2\x58\x32\x6d\x41\xd0\xc7\x51\xe1\x48\x88\xa3\xbe\x07\x23\xf4\x1e\x21\xfd\xfb\x12\xd2\x8a\x73\x4a\xf3\x1f\x25\xaa\xd2\x72\x2a\x51\xd4\xf7\x57\x90\x56\xf9\x9d\xdb\xe9\x3e\x30\xd0\x05\x03\x57\xf9\x6f\x1c\x83\x97\xf5\x3d\xa0\x2e\xc3\xf0\x6a\x09\x89\x1e\xf2\x5d\xb9\xc7\x25\x22\x9e\x22\x1e\x45\xf3\xa7\x3b\xc7\xcf\xb7\x23\xec\x5f\x3e\xdd\x7e\xc6\xbf\x1a\x86\xd8\xd3\xfe\x28\xe9\x00\xf8\x44\x3c\x9b\x42\xf2\x83\x3f\x63\xb2\xe2\x31\x5a\x29\x67\x91\x88\x57\xe4\x41\x87\x90\x2f\x93\x7d\x27\x3a\xf4\x7c\xa2\xe7\x79\x45\xa8\xd4\x6e\xae\x14\x24\xd8\x41\x79\x5c\xb5\xba\x80\xcd\x4a\xca\x91\x92\x39\x7a\xe6\x50\x37\x05\x3d\x41\x51\x6b\xc2\x27\x62\xe3\xf1\x6f\x06\x9b\x8b\x65\x80\x4b\x40\x63\x6a\x93\xb1\x2c\xaf\xc9\x71\x35\xb1\x27\x2b\xa8\x0d\xf3\xff\x93\xb0\xb7\x58\x89\x56\x11\x6c\x74\x4d\x3c\xf5\x4b\x43\xb2\xd6\x42\x65\x61\x7d\x24\x2b\x38\x49\x35\xf7\xe2\x9d\x08\x70\x7d\x0d\x5a\x2a\x4e\x22\xe2\x28\x1c\x64\x1d\x21\xe0\x45\x51\xc7\x69\xb9\x13\xcc\x77\x28\x60\x86\xb5\x37\xb5\xb6\x24\x34\xc1\xb8\xe5\xbc\x0c\xe0\x9b\x6e\x8c\x8e\xca\xe2\x1c\xd1\x20\xb5\x46\x73\x7e\x81\x2c\x9b\xbf\xc7\xc7\x4d\x32\x5e\xee\x61\xd8\xc1\x51\x5a\xcb\xd7\xc1\xe0\xa7\x56\x1a\x2c\xa1\x72\xb8\x1f\x13\x1f\x2b\x90\xfd\x31\x49\xb2\x29\x46\x70\x54\x14\x45\x9e\xd9\xc5\xcc\x68\xb1\xb4\xca\xff\x10\x4a\x96\x82\x6a\x33\x4a\x10\xf5\xfd\xf6\x02\x44\x59\x82\x6e\x95\x12\xf7\x0a\xa1\x38\x60\xf1\x00\xb5\x56\xcf\xee\x6e\xd6\x41\x04\x9f\x83\x75\x50\x75\x4b\x5c\x9f\x1c\x95\x9d\x50\x2d\xc2\xc5\x76\x06\x84\x74\xc2\xda\x5d\x83\x60\x57\xcf\x5a\x4e\xe2\xce\x6a\x64\xf3\x56\xe7\x87\x79\x3b\x3b\xf6\x4c\xc9\xdf\x04\xc9\x61\x4d\x06\x5b\x06\x8d\xf9\xb2\xca\x13\x23\x30\x0c\xde\xcb\xff\x15\x2a\xfb\xce\x21\xbe\x59\x7a\x6c\xa5\x6a\x75\xa4\xfc\x1d\x2b\x5b\xad\x55\xed\xa6\x50\x95\x90\x8a\x55\xe5\xe1\xcb\xca\xee\xe0\x6d\x97\x38\x83\x78\x89\xbf\xc8\xcf\x00\x8b\x7a\xb5\xd2\x7d\x3d\x3e\xa3\x90\x31\x34\xe6\xbf\x6b\xf9\xa9\xc5\xc5\x8d\x53\xa8\x4f\x0b\x84\xe3\xe5\xb4\xec\x65\xf0\x3d\x7c\x1b\xf8\x38\xcb\xe4\xad\x22\xd9\x28\x04\x61\xad\xdc\xeb\x23\x6a\xb2\x50\x6b\x10\xd0\xfa\x14\xb0\xdc\x63\x60\x06\x4f\x3d\xff\x82\xc9\xdd\x01\x9c\xb9\x70\x76\xdb\xeb\x85\xe3\xb3\xca\xbd\x2a\x1c\xff\xeb\xa6\x7e\x4d\xd2\xcb\xb1\x7d\x94\x54\x1c\x3e\xcb\xb2\x34\x3c\xca\x6f\xa5\x50\x58\xd0\x26\x14\xd6\x95\x98\x96\x6a\xc3\x96\x76\x92\xde\x85\x3f\x0c\x59\xf0\x1b\xa1\xef\xe1\x9f\x5a\xea\x69\xd9\x08\x65\x21\xb9\x04\xee\xe3\xbb\x78\x3a\xe9\x4b\x14\xd9\x09\x70\xec\x01\x99\xcf\x60\xf4\x5c\xa8\x03\x0b\x98\x57\x09\x6b\xb5\x6d\x1b\x7e\x77\x60\x09\xa5\x4f\x85\xc9\x71\xbd\x30\xb4\xaf\x0f\x50\x08\xa5\xac\x6f\x65\x5c\x3e\x1a\xa1\x65\x61\x59\x5e\x37\xe5\xc3\x58\x10\xda\x47\xf9\xaa\x2e\xf6\xe1\xe5\x36\xb6\xea\x62\x4c\x72\x77\xb9\xac\x1b\x4b\x56\x16\x3c\x84\xe2\xb2\x28\x05\x2e\xd5\x8d\xbf\xb6\x43\x3c\x32\xd2\xf9\x4e\x7f\x9e\x6c\xe7\xbe\x08\x5c\xa5\xa5\x63\xa3\xa6\xe7\x5a\x05\x49\xa0\x74\xfb\xd6\x6e\xc7\x87\xe3\x42\x42\xbf\xe9\x69\x7a\x48\xf8\xed\xf9\xc9\xb3\x67\xf1\xa0\x98\x87\xff\x06\x00\x00\xff\xff\x60\x78\xed\xcd\x92\x0a\x00\x00") func templateBuilderCreateTmplBytes() ([]byte, error) { return bindataRead( @@ -129,12 +139,12 @@ func templateBuilderCreateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/create.tmpl", size: 2706, mode: os.FileMode(420), modTime: time.Unix(1558503319, 0)} + info := bindataFileInfo{name: "template/builder/create.tmpl", size: 2706, mode: os.FileMode(420), modTime: time.Unix(1564164430, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateBuilderDeleteTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x94\x41\x73\x9b\x3c\x10\x86\xcf\xe8\x57\xec\xc7\x70\x80\x6f\x32\xf2\x3d\x9d\x5c\xda\xf4\x96\xa6\x4d\x73\x68\x66\x3a\x3d\x28\xd2\x62\x6b\x82\x85\x22\x2d\xb5\x3d\x8c\xfe\x7b\x47\x60\x08\xb8\x76\xe2\x69\x7b\x02\x81\xf6\xd1\xfb\xae\x76\xb7\x6d\x41\x61\xa9\x0d\x42\xaa\xb0\x42\xc2\x14\x42\x60\x6d\x0b\x99\x7d\x5a\xc2\xe5\x15\x3c\x0a\x8f\x90\xf1\x0f\xb5\x29\xf5\x92\x7f\x11\xf2\x49\x2c\x71\xbf\x87\x70\x6d\x2b\x41\x08\xe9\x0a\x85\x42\x97\xf6\x51\x21\xb0\xf9\x5f\xbd\xb6\xb5\xa3\x14\xb2\xe1\x57\xf6\xd8\xe8\x4a\xa1\x8b\x07\x58\xa7\x0d\x41\x6e\x85\x97\xa2\x82\x8c\xdf\x8a\x35\x16\x90\x5e\xcf\xd5\x38\x94\xa8\x7f\xf6\x11\xe3\xfb\x88\x09\x81\x2d\x16\x30\x05\x87\x00\xda\x03\xad\x10\x86\x2f\x65\xed\xa0\xb3\xa8\xcd\x12\x44\xdc\x3c\x3b\x32\x46\xa0\x21\x4d\x3b\xce\x68\x67\xf1\x90\xe6\xc9\x35\x92\xa0\x65\x89\xec\x52\xc1\x12\xeb\x50\x69\x29\x08\x3d\x7c\xff\x31\x2e\x78\x8c\x1b\x88\x2c\x30\x16\x95\x7d\x5b\xa1\x43\x10\x4a\x79\x10\x60\x70\x03\xe3\xf6\x4e\xd6\x44\x26\x67\x65\x63\x24\xe4\x53\xcf\x21\xc0\xff\x73\x35\x45\x4f\xcc\xad\x07\xce\xf9\xf1\xb3\x8b\xc3\xa0\xa8\x7d\x8e\xe5\x13\x0b\x57\x20\xac\x45\xa3\xf2\x93\x5b\x2e\xc0\x7a\xce\x79\xc1\x12\x87\xd4\x38\x03\xb3\x7b\xe9\xcd\x2e\x16\xf0\x71\x8b\x12\x70\x8b\xb2\x89\xd8\x68\xad\xcf\x7a\x6d\xe0\xb9\x41\xb7\x3b\xd7\x61\xe4\xe4\x92\xb6\x20\x6b\x43\xb8\xa5\x58\x82\xf1\x59\x00\x3a\x57\xbb\xe8\xc6\x6f\x34\xc9\xd5\xa1\x0e\xae\x5c\x7c\xe3\xd7\x5a\x54\x28\x29\x2f\xba\x4b\x8b\x65\xac\xfa\x2f\xfc\xd3\xee\xfe\xee\xe6\x62\x5c\xde\xdf\xdd\x68\xc2\x4b\x96\x9c\x30\xc6\xfd\x73\x35\xa8\x29\x0e\x50\xb7\x68\xa9\x31\xaf\x05\x2f\x1d\xae\x2b\x6d\x26\x00\x85\xa5\x68\x2a\x9a\xc4\x74\x8e\x3c\xbf\xc5\x4d\x9e\x0e\xbd\x17\xc2\x25\x34\xc6\x37\x36\xf6\x0e\xaa\xe1\xc4\xb4\x60\xc9\x34\xd5\x0f\xb1\xce\x2b\xfd\x84\xdd\xea\x02\x1e\x1b\x02\x2b\x8c\x96\x1e\x74\x09\x62\xcf\x86\x5a\xca\xc6\xf9\x63\xb9\x87\x53\xc9\x7f\x38\x9e\xfd\x96\x25\xba\x8c\xd4\xd8\x8a\x87\x66\x47\x97\xef\xba\x1d\xff\x5d\x81\xd1\x55\x0c\x49\x3a\x4d\x39\x3a\x37\xe8\x6f\x5b\xd8\x68\x5a\x01\x6e\x09\x8d\x82\x0c\xd2\xf7\xbd\x80\x74\xd6\xd7\xc9\x6c\x92\xec\x93\xb0\xf0\xcf\xd5\x62\x98\x57\x7c\x3f\x23\x22\x25\xfc\x2d\x78\x7f\x5b\xaf\xc1\xb3\xda\xe0\x6f\xf3\x6b\x24\xa7\x9f\xcd\xcb\xd4\xaa\x0d\x7e\x3d\x3a\xb8\x26\x88\xd0\xdf\xe5\x01\xf8\xcd\xf9\xe5\xb5\x59\x56\xfd\x94\x3a\x3d\xbf\xe6\xc0\x97\x11\xf6\xc6\xfd\xff\x41\x27\x4f\x9d\x0e\xc0\xd9\xe9\x67\x35\xf4\xa4\x85\xe6\x40\x7e\xb2\xd0\xfe\x45\x2b\x9c\x29\xfe\x74\x43\x9c\x29\xf8\x61\x54\xfc\x52\x51\xbf\x02\x00\x00\xff\xff\x54\x0e\xa3\xed\x81\x07\x00\x00") +var _templateBuilderDeleteTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x54\x4f\x8f\xd3\x3e\x10\x3d\xc7\x9f\xe2\xfd\xa2\xfc\xa4\x04\x15\xf7\x5e\xd4\x0b\x2c\xd7\x05\xc1\x81\x95\x10\x42\x5e\x67\xd2\x9a\x4d\x9d\x60\x3b\xb4\xab\xc8\xdf\x1d\x39\x69\xd2\xa4\xb4\xda\x0a\x71\x6a\xd2\xcc\xbc\x79\x6f\xfe\xbc\xb6\x45\x4e\x85\xd2\x84\x38\xa7\x92\x1c\xc5\xf0\x9e\xb5\x2d\x92\xfa\x69\x83\xd5\x1a\x8f\xc2\x12\x12\xfe\xae\xd2\x85\xda\xf0\x8f\x42\x3e\x89\x0d\x1d\x63\x1c\xed\xea\x52\x38\x42\xbc\x25\x91\x93\x89\xfb\x2c\xef\xd9\xfc\xab\xda\xd5\x95\x71\x31\x92\xe1\x53\xf2\xd8\xa8\x32\x27\x13\x0a\xd4\x46\x69\x87\xb4\x16\x56\x8a\x12\x09\xbf\x17\x3b\xca\x10\xdf\xcd\xd9\x18\x92\xa4\x7e\xf5\x19\xe3\xf3\x08\xe3\x3d\x5b\x2e\x31\x05\xf6\x1e\xca\xc2\x6d\x09\xc3\x3f\x45\x65\xd0\x49\x54\x7a\x03\x11\x82\x67\x25\x43\x06\x69\xa7\xdc\x33\x67\xee\xb9\xa6\x73\x34\xeb\x4c\x23\x1d\x5a\x16\xc9\xae\x15\x2c\xaa\x0d\xe5\x4a\x0a\x47\x16\x5f\xbf\x8d\x2f\x3c\xe4\x0d\x88\xcc\x33\x16\x98\x7d\xd9\x92\x21\x88\x3c\xb7\x10\xd0\xb4\xc7\x18\xde\xd1\x9a\xd0\xe4\xac\x68\xb4\x44\x3a\xd5\xec\x3d\x5e\xcd\xd9\x64\x3d\x62\x5a\x5b\x70\xce\x2f\xd7\xce\xce\x93\x02\xf7\x39\x2c\x9f\x48\x58\x43\xd4\x35\xe9\x3c\xbd\x1a\xb2\x40\x6d\x39\xe7\x19\x8b\x0c\xb9\xc6\x68\xcc\xe6\xd2\x8b\x5d\x2e\xf1\xfe\x40\x12\x74\x20\xd9\x04\xd8\x20\xad\xef\x7a\xa5\xf1\xb3\x21\xf3\x7c\xab\xc2\x80\x93\x4a\x77\x80\xac\xb4\xa3\x83\x0b\x2b\x18\x7e\x33\x90\x31\x95\x09\x6a\xec\x5e\x39\xb9\x3d\xe7\xc1\x73\x13\x9e\xf8\x9d\x12\x25\x49\x97\x66\xbd\xf0\xd7\x30\x42\x6f\x08\xc9\xf7\x05\x12\xeb\x2a\x13\xf6\x78\xb5\x46\xc2\x3f\x1f\x5f\xbc\x67\x91\x0c\xeb\xde\xb6\xf8\x51\x29\x3d\x86\x0d\x50\x16\xf1\x02\x61\x25\x57\x2c\xba\xd2\x84\x6e\x04\x76\x04\x1c\x44\x64\x3d\x03\xd2\x79\x57\x25\xa7\x42\x34\xa5\x9b\xc0\x74\x9a\x2c\xbf\xa7\x7d\x1a\x0f\xd7\xe7\xfd\x0a\x8d\xb6\x4d\x1d\xae\x87\x72\xe4\x3d\x8b\x38\x63\xd1\xb4\xd9\x0f\x61\xd3\x4b\xf5\x44\xdd\xdb\x02\x8f\x8d\x43\x2d\xb4\x92\x16\xaa\x80\x38\x62\xa3\x92\xb2\x31\xf6\x52\xf7\x71\xad\xfd\x0f\x97\xfb\xdf\xb2\x48\x15\x01\x35\xb4\xef\x5c\xff\xa8\xf8\x4d\x17\xf1\xdf\x1a\x5a\x95\x21\x25\xea\x38\xa5\x64\xcc\xc0\xff\xd6\x99\xb4\x2d\xf6\xca\x6d\x41\x07\x17\x1a\x98\x20\x7e\xdb\x13\x8d\x67\x0e\x10\x75\xdb\xed\x76\x75\x39\xda\x4a\x81\xf8\xd8\xb4\xe5\xff\x76\x39\x18\xdc\x64\x3e\x7d\xd2\x61\xb4\xaa\x3e\x9d\x0f\x65\x8f\xf3\x3a\x3d\x75\x5e\x54\x69\xfa\xc3\xbf\x46\x22\xf1\x07\x7d\x72\xad\x4a\xd3\xa7\x8b\xc6\x35\x81\xf0\xfd\x24\xcf\x80\x5f\xf4\x2f\xab\xf4\xa6\xec\x5d\xea\xba\x7f\xcd\x01\x4f\x16\xf6\xc2\xf4\xff\xe2\x92\xa7\x4a\x07\xc0\x59\xf5\x9b\x0e\x7a\x72\x53\x73\x40\x7e\x75\xcd\xfe\xc5\x21\xdc\x48\xfe\xfa\x39\xdc\x48\xf8\x61\x64\x7c\xda\xa8\xdf\x01\x00\x00\xff\xff\x11\xc3\xec\x39\x81\x07\x00\x00") func templateBuilderDeleteTmplBytes() ([]byte, error) { return bindataRead( @@ -149,12 +159,12 @@ func templateBuilderDeleteTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/delete.tmpl", size: 1921, mode: os.FileMode(420), modTime: time.Unix(1563979564, 0)} + info := bindataFileInfo{name: "template/builder/delete.tmpl", size: 1921, mode: os.FileMode(420), modTime: time.Unix(1564193299, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateBuilderQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x5b\x6d\x6f\xdb\x38\xf2\x7f\x2d\x7f\x8a\x59\xc3\xff\xc0\x0a\x5c\xba\xc9\xee\xab\xfc\x91\x03\xba\x4d\x5b\xf8\xae\x6d\x76\x9b\xe2\x6e\x81\x20\xd8\x55\xa4\x91\xcd\x96\xa6\x14\x92\x72\x12\xb8\xfe\xee\x07\x3e\xe8\xd1\x92\x23\xa7\xbe\xeb\x2d\x10\xac\x29\xcd\x0c\x87\x33\x3f\xfe\x48\x8a\xd3\xf5\x1a\x22\x8c\x29\x47\x18\xde\x65\x28\x1e\x87\xb0\xd9\x0c\xd6\x6b\x18\xa5\x5f\xe7\x70\x76\x0e\xb7\x81\x44\x18\x91\xd7\x09\x8f\xe9\x9c\xfc\x16\x84\x5f\x83\x39\x3a\x19\x85\xcb\x94\x05\x0a\x61\xb8\xc0\x20\x42\x31\xb4\x5a\x9b\xcd\xa0\xfe\x96\x2e\xd3\x44\xa8\x21\x8c\xf2\x57\xa3\xdb\x8c\xb2\x08\x85\xee\x20\x15\x94\x2b\x18\xa7\x81\x0c\x03\x06\x23\xf2\x31\x58\xa2\x0f\xc3\xdf\x6b\xce\x08\x0c\x91\xae\xac\x42\xf1\xbb\xb0\xa2\xad\x4e\xa7\x50\x35\xbc\xd9\x00\x95\xa0\x16\x08\xf9\x93\x38\x11\x60\x46\x48\xf9\x5c\x8b\xd6\x3a\xd4\xf2\xc8\x15\x55\x14\x25\x19\xa8\xc7\x14\x9b\xd6\xa4\x12\x59\xa8\x60\x3d\xf0\x42\x13\x8a\x81\xc7\xe8\x92\x2a\xcf\x3b\xa6\x5c\x0d\xbc\x24\x8e\x25\x96\x2d\x11\xa1\xf0\xbc\xeb\x9b\x4b\xfd\x63\xe0\x65\x9c\xde\x65\xa8\x1f\x48\x25\x28\x9f\x0f\xbc\x54\x60\x44\xc3\x40\xa1\x04\xef\xfa\xa6\x68\x11\xdd\x6b\xee\xd1\xc0\x9b\x4e\x81\x72\x85\x62\x89\x11\xd5\x91\xd4\xfe\x1b\x0f\x3d\x79\xc7\x40\xff\x77\x2c\xef\x18\xb9\x42\x86\xa1\x4a\xc4\xc0\x9b\x0b\x5c\x32\xca\xe1\x38\x92\x8c\x7c\x16\xc1\x0a\x85\x0c\xd8\xc0\xc6\xe7\x5f\x0b\x14\x08\x41\x14\x49\x08\x80\xe3\x3d\x14\xdd\x9a\xe0\x54\x82\x45\x06\x71\xc6\x43\x18\xd7\x42\xbf\xd9\xc0\x71\x3d\x28\xbe\x35\x39\x4e\x25\x10\x42\xda\x07\xe1\x37\x95\x74\x08\xab\x76\x37\x1b\x52\x09\xc6\x39\x04\x69\x8a\x3c\x6a\x76\x5d\x91\x99\x40\x2a\x09\x21\xfe\xc0\x13\xa8\x32\xc1\xa1\x21\xea\x46\xfb\x5e\xa7\x27\x1f\xad\xc9\x15\x48\x85\x29\xa8\xc4\x8c\xd4\x40\xa1\xf7\x38\x8d\xb1\xb1\xb5\x42\xb9\x7a\x72\x50\xda\x63\x2b\x7d\x0e\x47\xe6\xc7\x13\xde\x5e\x1a\xfc\x38\x77\x39\x58\x38\x7d\x87\xc3\xd6\xde\xd8\xd9\xe9\xeb\xb2\x13\x3f\x87\x23\xfb\xeb\x29\xa7\x35\xba\x4b\x9f\x4d\xeb\x3b\x5c\xd6\xfa\xe3\x44\x43\xc9\xfc\xec\xe7\xb1\xe9\xb4\x13\x35\xe6\xf5\x04\x92\xa7\xf0\xb2\x5e\x4f\x8f\x41\x2d\xa8\x84\x30\x89\x10\x16\x81\x04\x49\x97\x94\x05\x82\xaa\x47\xb8\xa7\x6a\x01\x18\xcd\x8b\x09\x08\x94\x43\xc8\x28\x72\x45\xd4\x32\x65\x70\x3c\xb5\x3c\x25\x02\x3e\x47\x18\xfd\x39\x81\x11\x6a\xaa\x1a\x91\x37\xd1\x1c\xa5\x99\xcb\xba\x57\x6d\xe3\xcf\x6e\xee\x43\xf2\xf9\x31\xc5\x6d\x06\xd4\x3c\x60\x5a\x15\xda\xc2\x82\xb7\xc2\x45\x40\xb9\xe5\xba\x30\x13\x02\xb9\xb2\x81\x87\x84\x9b\x87\xa6\xe3\x92\xe5\xa2\x39\x92\x81\xd7\x33\x27\x9d\xbd\x8e\x5d\x76\x6a\x23\xb2\x29\xf2\x6c\xef\x67\xe7\x70\xd4\x22\xb1\xb6\xf4\x79\xd6\xcc\x02\xb1\xcf\x37\x03\xcf\x93\xf7\x54\x85\x8b\x2d\x81\x48\xe8\x5f\xe4\x82\x06\x9a\xed\xc6\xbe\xe9\x2b\xd4\xcb\x53\x64\x1f\x91\x0f\x8f\x57\xbf\xbf\x9f\x14\xcd\xab\xdf\xdf\x53\x85\x67\x03\xcf\xf3\xd6\xeb\x17\x40\x63\xed\xff\x87\xd3\x0f\x60\x62\x6a\x9e\xc2\x88\x6a\x47\x4f\xb4\x63\x6b\x18\x7d\xd1\x8d\x97\xa6\x91\xcb\xcf\xe4\x8c\x6b\x16\x45\x27\x42\x21\x97\xd0\xe2\x85\x2a\xf2\x08\x5e\x38\xb3\xea\x44\x9b\xd1\xc4\xfc\x39\xb8\x65\x38\xb6\x09\x30\xa9\x2d\xd7\x4f\xfb\xce\xb7\x0a\xa7\x5a\xa1\x39\x5e\x79\xc7\x4c\xf8\xc7\xb9\x90\xe3\xf9\xb1\x3a\x25\xaf\x8d\xd1\xaa\x39\xd3\x9e\x5d\xe8\x85\x5a\xaa\x80\x2b\x9d\x3e\xa7\xf8\xf3\xb6\x3b\x4d\x4d\xb4\xef\xaa\xca\x56\xf7\x97\x5c\x37\xef\xfb\xe7\x8e\xbe\x91\xfc\xf6\x8f\x8a\xfa\xb5\x8d\xd5\x66\x73\xe3\xfb\xc4\x98\xf2\xbc\xb7\x22\x59\x8e\xd5\xcf\x45\xfb\xef\x09\xe5\x63\x75\x5a\xb4\x2f\xf9\x7e\xe6\xbf\x18\xf3\x13\xd8\x33\x1e\x96\x95\xf4\x02\x5a\x1b\x59\xee\x86\xf5\xf2\x24\x6f\x5a\x27\x7f\xc9\x9b\xda\xc7\x13\xd7\xdd\x76\x4e\x2b\x4f\x1b\x5d\x4f\x40\xfd\xb2\x7f\xe4\x72\xe8\x22\x93\xa8\xf1\x98\x08\x0b\xe1\x4b\x18\x07\x3c\xd2\xbf\x2f\x4f\x2f\x6b\x28\xf5\x0d\x1c\xa7\xc7\xa0\x85\xbe\x7d\x83\xb1\x16\x30\xfc\x45\x1d\x8c\xf5\x7c\xf4\x2d\x63\xfd\x50\xb0\x22\x79\x9d\xb0\x6c\xc9\x7b\x27\x48\xc7\xdd\x68\xc8\x0e\x27\xdd\x5b\xcd\xf5\xe6\x6f\x47\x3e\x4f\x0f\x90\xcf\xbd\x07\x56\x64\xd2\xa5\xe8\xf2\xf4\x43\x3d\x45\x81\x94\x49\xf8\x3f\x93\xa0\xc3\xcd\x9e\xd6\x68\xf7\x09\xdb\xbe\x73\xdb\x44\x98\x47\x96\xdf\x6b\x4b\xc3\x47\x4c\x55\xc6\xed\x62\x90\x6f\x92\x5b\xa2\xe4\x5e\x55\x22\x55\xae\x04\x57\xc8\xe2\x4f\x18\xe7\x8b\x87\x0d\x44\x6e\xeb\x1c\xdc\x2f\xf2\x6b\xa2\x16\x9d\x03\xac\xd3\x6b\x75\x6a\x37\x96\x9a\x9d\x5d\xcc\xf8\x9b\x9d\x80\xad\xf6\x43\x2e\x33\xf5\xcf\x71\x13\x7f\x3b\xcd\x5f\x66\xea\x4d\x8f\x11\x90\x19\xaf\x1a\xce\xc3\xae\xff\xdc\x46\xcb\x74\x30\xf0\xcc\xd6\xc8\xbd\x37\xfb\xc6\x77\xa8\xc0\x8a\xe8\xbd\x79\xf5\xb4\x60\x0f\x61\x8f\x70\xfb\x08\x54\x49\xa0\x51\xef\xdd\xe3\x3b\x54\xe3\x50\x3d\x40\x98\x70\x85\x0f\x4a\x7b\xaa\xff\x3f\x01\x1a\x41\x8e\x17\x1d\x2d\x23\x3c\x3e\xae\x76\x3a\x01\x14\x22\x11\x66\x43\xd1\xbe\x45\x24\xf6\x9c\xd3\x8c\xc9\xec\x62\x4c\x23\xdf\x27\x97\x9c\x3d\xea\xce\x7d\xb7\x2f\x7e\x87\xea\x0f\x7d\xfc\x64\xf4\x2b\xea\xc6\x04\x6e\x33\x05\x69\xc0\x69\x28\x75\xae\x03\x6e\x7b\x84\x24\x0c\x33\x21\xf7\x19\xe3\x1f\xfd\x07\x59\x1b\x63\xbe\x77\x26\x9f\xca\x0e\xcc\xb8\xdb\x66\x81\x8b\xa5\x36\xeb\x0f\x3c\x1a\x1b\xb9\x9f\xce\x81\x53\x66\x36\x5d\x66\x24\x63\x14\xc2\xd7\xc9\xad\xc6\xac\x6a\xde\x05\xe3\x2d\x15\xb2\x4c\xb7\xde\x90\xc6\xe6\x49\x5b\xda\x29\xaf\x9c\x1b\xe0\x93\xd3\x39\x7e\x23\xc4\xc7\x44\xbd\x4d\x32\x1e\xc1\xfd\x02\x39\xf0\x44\xab\xb3\xe4\x1e\x45\xc5\xc8\x7d\x20\x21\xd6\x42\xbd\x03\x6a\x7c\x6b\x8b\xe8\x2e\x88\xe8\xed\x30\xcb\x84\xf9\x76\xd0\x27\x9a\xf6\xec\x78\xe2\x93\x57\x8c\x59\x94\xb4\x84\xd4\xc5\x90\x53\x66\xec\x98\xb8\xd2\x18\x18\xf2\x71\x47\x7f\x3e\x9c\xeb\x9d\x68\x53\xf9\xa8\x12\xac\x35\x34\x11\xfb\x3e\xb8\x45\xb6\x69\x64\xad\xcd\xfa\xf5\xcb\x9b\x89\x36\x58\x4d\x62\x89\x69\xd3\x3c\x14\xaa\xad\xed\xf6\x2c\x3c\x1f\xc3\x45\x6a\xb7\xc2\x7d\x74\x04\x3f\xcd\x64\x1e\x23\x03\xe3\x67\xa2\x7a\x76\xf1\x14\xae\x69\xb4\x0f\xa6\x69\xf4\x5c\x0c\xcf\x2e\x3a\x50\xbc\x4d\x0c\x36\x62\x25\x9c\x57\x81\x00\x1a\x49\xb8\xbe\x69\x08\x9a\xb8\xd1\x48\x5a\x85\x1d\xb8\x9e\x5d\x48\x13\xe8\xff\x6f\x07\x75\x15\xcb\x34\x92\x15\xdc\x5a\xbb\xfd\x10\x5b\x35\xe6\x52\x43\x23\xd9\x0a\xd3\xd9\x45\x1d\xa8\xb3\x8b\xc3\x42\xb5\x2b\xd8\x8d\xf8\xe9\x21\xd2\x68\x37\x40\xad\xa9\xef\x84\x28\x8d\xf2\xef\x31\x9c\x3d\xd6\x10\x99\xe8\x07\x4f\x11\xed\xa4\x5c\x8b\xf3\xb0\xd0\x18\x78\xa2\x00\x1f\x82\x50\xb1\x47\x48\x38\xe6\x8a\x1a\x9f\x56\x1c\xfb\x43\x34\x5f\x1f\xff\xf3\x2c\x7b\xba\x3f\xcb\xba\xaf\x0d\x3b\x99\x76\x3d\xb0\xbb\xc9\x93\xb3\xd2\xc8\x53\xc4\x69\x35\x5e\x9e\x3d\x8b\x9f\x23\x8c\x83\x8c\xa9\x0e\xe5\x2b\xca\xe7\x19\x0b\xc4\x2e\x7e\x2f\x11\x51\xd2\xb6\x6e\x1d\x6a\x2a\x18\xcb\x87\x26\xed\x72\x23\xf5\xbd\xbb\x0e\x6d\xa9\x41\xcf\xdb\x93\xa1\xc1\xce\xfd\x26\x82\x23\xe9\x67\x4d\x82\x1f\x47\xd3\xa7\xfd\x68\xba\x32\x19\x0c\x55\xd7\x80\x4f\x23\x38\x77\xa4\x5b\x45\xf7\x3e\x2c\x5e\xc1\x75\x4d\xad\x0f\xa2\x73\x3f\x2b\xc8\xae\x30\xbd\x0d\xef\x41\xd1\x7d\x18\x9e\x2f\xf3\xbe\x07\xaa\x0b\x4a\x7f\xc5\x18\xe0\x03\x86\x99\x42\x59\x22\x15\x02\x1e\x55\x4e\x50\x8c\x4a\x05\x49\x5c\xa3\x24\x87\xf1\xde\x23\x76\xb4\xd9\x82\xcd\xeb\x9b\x4e\x92\xde\xe3\x4b\x6d\xbf\x0f\xb5\x1d\xc7\x2f\x79\xc7\x4a\x5a\xef\x3a\xd7\x77\xe8\xba\x53\x6d\xa9\xdf\xc1\xad\x66\x54\x92\x7c\xc4\xfb\xf1\x70\xbd\xce\x6f\x32\xcf\x20\xe3\x32\x4b\xd3\x44\x28\x8c\xf2\x5e\x87\x7e\xc9\xb0\xaf\x18\x2b\x09\xf6\x15\x63\x87\x42\xa0\xb6\xdb\x9e\x90\x46\x3e\x9e\xb3\x58\xee\x5a\x23\x3b\x69\xb6\xad\x07\x17\x84\xd9\x85\xdc\x0b\xa5\x55\x0a\xee\x1f\x12\x47\x60\xad\x10\x6d\x63\xcf\xff\x3e\x48\x73\x8a\x7d\x2e\x48\x4b\xfd\xc3\x82\x74\x76\x21\x4b\x90\xce\x2e\xe4\xa1\x40\xaa\xed\x76\x81\xb4\x95\x25\x65\x27\x24\xcb\xa1\xf7\xe7\x48\xe9\x86\xf7\x3a\xc9\x78\xfd\x13\x43\x68\x9e\x24\xb1\x69\xcc\xe9\x0a\xf9\x9e\x97\x91\xc6\x64\xd7\x62\xcd\xd5\x0f\xc2\x57\xe1\xd5\xb3\x11\x56\xb5\xb0\x8d\xb1\x97\xcf\x46\x98\xb1\x5b\x62\xcc\x34\x0f\x85\x32\x6b\xbb\x3d\x19\x94\xbb\x9a\x8c\xcc\x25\xa5\x0d\x5b\xd5\x41\xf7\x45\x97\xb1\xe8\x06\xf7\xe6\x81\x56\x3f\x61\x89\xcc\x7c\xb1\x2d\x79\x6e\x11\x48\x40\x86\x4b\xe4\x4a\xe6\x3b\xca\xb9\x08\xd2\x45\xef\x21\x9a\x1e\x3a\xe0\x76\x9b\x24\xec\x07\xe1\xad\x70\xeb\xd9\x78\xab\x5a\xd8\xc6\x5b\x1c\x30\x89\xcf\xc6\x9c\xb1\x5d\x62\xce\x34\x0f\x85\x39\x6b\xbb\x3d\x23\x3a\x21\x3a\xba\x68\x3b\xec\x00\x5d\x75\xe4\x7d\x41\x67\x2c\xe6\x33\x8a\xe9\xd3\x46\xb9\x7c\x46\x59\xca\x6c\xb1\x4e\x52\xc5\x9e\x73\x7a\x02\x94\x87\x2c\x8b\x28\x9f\x43\xc0\x98\xbd\x4a\xa2\x81\x8e\x9c\x54\x98\x4a\x02\x33\x05\x61\xc0\xe1\x16\xb5\xf1\x4c\x62\x04\x2a\x81\x54\x60\x1a\x08\xcd\x97\xcb\x65\xc2\xeb\x26\xa5\x59\xbf\x33\x89\xba\xb7\x25\x44\x34\x8e\x51\x20\xd7\xe7\xa0\x20\x56\x68\x0b\x86\x42\xe3\x25\x95\xb0\x0c\x22\xec\x3f\xa3\xb5\xd6\xb8\xb5\xc0\xc3\x45\xe2\xa8\xfe\xc6\x5c\xf5\xbb\xc2\x81\xad\x1a\x10\xfb\x62\x32\xf0\x6c\x49\xd6\x19\x78\xed\xb5\x38\x5a\xc2\xd6\xb5\xb4\x18\xb1\x2f\x8c\x88\x88\x50\x68\x23\xae\xa6\xc4\x55\x71\xad\x37\x93\xad\x1c\x1b\x51\x42\x88\xaf\xf5\x6c\x91\xd7\x19\x94\x7a\xb6\xd8\xab\x4d\xd1\xca\xe6\x9a\x65\x6d\xd3\x19\x14\xca\xed\xe5\x54\x6d\xc6\x4a\xf5\xdc\xe0\x74\x9a\x27\xa6\xbd\x7a\xcc\x93\x77\xac\x2d\x4c\xf2\x8e\x11\x97\x1b\x6d\xc6\xcd\xe1\xb3\x66\xbd\x56\x7e\x51\x54\x8a\xba\x22\x1a\x18\xcd\x45\x92\xa5\xbf\x56\x2a\x5c\x6a\x55\x76\xdf\x6c\xc5\x4b\x0c\xc3\xff\x93\xef\x8c\xa4\x2d\x70\x31\x97\x26\xb6\x5d\x40\xd3\x58\x82\x15\x0a\x45\x43\x94\x70\x6b\x4f\xdf\x89\x80\x65\x22\x10\x62\x8a\x2c\x92\xd3\xd0\x5d\xf9\x9a\x4d\x8e\xd2\x38\x4c\x62\x85\xdc\x1a\xb1\x77\xaa\xf3\xb9\xc0\xb9\xa9\x71\xcb\x78\xa8\x68\xc2\xe5\xc4\xf0\x85\xa9\x40\xf9\x92\x50\x0e\xe3\xaf\xf8\x28\x4b\x41\x1f\x86\x13\x18\x9a\xb3\xd3\x7a\xfd\xc2\x5a\x61\xc8\x61\x44\xde\x9a\x4e\x6d\x4d\xe2\x0b\x18\xc5\x7a\x80\x94\x47\xf8\x50\xbe\x7b\xa9\xdf\x4e\xa7\x96\x9e\x82\x65\xca\xf0\xcc\x36\xcd\x01\x7e\x05\x06\x14\xb6\x90\x70\x3a\x35\x09\xc8\x23\x14\x97\x1b\xfa\xb5\x6e\xe5\xfb\xa6\xbf\x6c\xf3\xca\xa8\x7d\x0e\x34\x33\xfe\x65\x74\xed\xae\x47\x2f\x80\x7f\x7d\x91\x09\x3f\x1b\xda\x45\x30\x59\x52\x85\xcb\x54\x3d\x0e\x8d\x98\xf3\xc6\x73\xe5\x4a\x2d\x85\x8f\xc4\xdd\x76\x12\x63\xd5\xa5\xa1\xf5\xfe\x2f\xae\xdf\xff\x19\xf9\x57\x79\xd8\xc6\x25\x73\xbb\x05\xd7\x77\x22\x57\x61\xc0\xed\x7d\xd2\xd1\xca\xd7\xee\x54\xee\x0b\xfb\xde\x7c\x39\xaf\x4c\xda\xc1\xce\xab\x89\x03\x01\x10\x42\xec\x13\x47\x28\x35\x0c\x5a\x56\xb1\x60\xca\x4b\x92\x1a\x02\x4f\x97\x24\x19\x05\xe2\xba\x3b\x87\xe6\x04\x37\x2f\x36\xb9\x3f\xb6\xd6\xec\xe0\xab\xb4\xf5\xc1\x5e\xbc\xb7\xcc\xdb\xe2\xca\xba\x6b\x9d\xb6\xfa\xe5\x6d\x6f\xc7\x82\x5d\xd8\x29\x57\x25\xa3\xa9\x27\xb8\x9e\xe1\xb6\x16\xee\x41\xe9\xfc\x8d\x60\xe8\xa2\x38\x2c\xd3\x35\x74\xa0\x29\x8b\x81\xbd\x5a\x31\xb0\x73\x6d\x2a\xef\xd8\xd4\x55\x1c\x13\x57\xe6\x9b\xdf\x11\xf7\xe9\xa6\xd3\xae\x1b\x47\x97\xed\x92\xa5\x3e\xb5\xd6\x14\x37\xb0\xd1\xb3\xb0\xd8\x68\xbd\xb8\x7d\xec\x5b\x58\xdc\x84\xe8\x76\x75\xb1\x03\x5b\x59\x31\x1c\x73\x09\x00\x70\x7d\x53\xcc\xb8\x3e\xf5\xc1\x7b\x15\x08\x17\x96\x6d\x4d\x67\x79\x76\xca\xb9\x91\x26\xbc\xa4\xd1\xbc\xca\xb3\x18\xfb\xd6\x09\xab\x1e\xe6\x7c\x5e\x37\xc6\xee\x97\xdd\x8e\xf5\x18\x09\x21\xaf\x4a\x2a\xee\x9a\xd0\x6d\xe6\x89\x56\xaf\x95\x82\xb6\x49\x4c\x20\xe6\xdb\xf5\xc3\x4d\x49\x17\x11\x4d\x5d\xda\x20\xa3\xee\xc3\x46\x7d\xb0\x66\x87\x24\xb5\x8c\x7e\x27\x50\x66\xcc\x30\x72\x52\x89\xdd\x2a\x60\x19\x3e\x23\x2a\x39\x6b\x6e\x5f\xf6\xaf\x6c\xd2\xe3\x20\xc4\xf5\xc6\x77\xfb\xdb\xfa\xc1\x60\x6b\xe0\x07\x39\x1d\x6c\x59\x95\x77\xac\x24\xf7\x55\xbf\x43\xc2\x96\x11\x07\xc9\xba\xa1\xed\xb3\x42\xf3\x90\xd0\xb4\xf3\xe4\x71\x41\x77\x50\x9e\x16\x74\x6b\x8f\xc3\xc2\x1e\x49\xeb\x28\xd1\x68\x64\x6d\x5d\x9c\x0a\xdc\xd9\x61\x2b\x2e\xd5\x80\x6c\x7d\xb3\xaf\x9f\x1f\x2c\x67\x56\xaa\x8f\x95\xab\x2e\x5e\x52\x45\x57\x95\x02\xe4\xb8\xba\x27\x53\x7a\x3f\x66\x3f\xea\xb9\x22\x63\x2b\xb2\xd9\x14\xc7\x8e\x96\x2f\xcb\x7a\xed\x87\x58\x24\xcb\x62\x2e\x90\x7c\xeb\xc5\xf5\xd1\x80\xb1\xe4\x1e\xdd\x9d\x76\xf1\xef\x2d\x8a\x69\x63\x78\x5d\x6f\xe4\x0c\xbf\xd5\x0a\x91\x7b\x86\x38\xf7\x71\xe7\xa7\x40\xd5\xf8\x06\x58\xa9\xa5\x68\x21\x05\x43\xb5\x3e\xfc\x0d\x4e\x8c\x6c\xaf\x2f\x6e\x2d\xbe\x91\x22\x7c\x54\x9a\x6b\xa3\x20\x5c\x50\x5c\x05\xb7\x0c\x6d\x38\x8c\xbc\x0e\x87\xd9\xc2\xaa\x45\xc0\xe1\xc4\x06\x42\xe3\xd4\x54\x4e\xe5\xbb\xc4\x7c\x10\xd6\xf5\x7e\x30\x39\x6a\xc1\xc9\xf6\x95\x67\xb5\x40\x6b\xe5\xae\x2a\x37\x83\x5a\xfa\xcb\x59\x92\x3f\x79\x72\xa6\x3c\x3f\x8f\x3b\x3f\x20\xaa\xbc\xa6\x7c\x35\xd9\x19\x84\x2a\x28\xfc\x32\x66\xd5\x40\x54\x67\x4c\x2d\x06\x8d\x02\xb5\x5d\x9b\x8f\xe6\xe6\xa0\x7b\x67\x63\x24\xf7\xdb\xd9\xf4\x33\x9e\x6f\x6f\xba\x3b\x70\x3f\xff\x1d\x00\x00\xff\xff\x3d\xe7\xe3\x79\xd9\x35\x00\x00") +var _templateBuilderQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x5a\x5f\x6f\xe3\x36\x12\x7f\xb6\x3f\xc5\xd4\x70\x03\x3b\x70\xe8\xdd\x3e\xfa\x90\x03\xd2\xa6\x5d\x18\x28\xda\xbb\xdd\x02\x57\x20\x08\xba\x8c\x34\xb2\xd9\xa5\x29\x95\xa4\x9c\x04\x3e\x7f\xf7\xc3\x90\xd4\x5f\xcb\xb1\x92\x4d\x6f\xb1\x0f\x41\x4c\x69\x38\x1c\xce\xfc\xf8\xe3\x50\xc3\xdd\x0e\x62\x4c\x84\x42\x18\xfd\x95\xa3\x7e\x1c\xc1\x7e\x3f\xdc\xed\x60\x9c\x7d\x5a\xc1\xe2\x12\xee\xb8\x41\x18\xb3\x1f\x52\x95\x88\x15\xfb\x17\x8f\x3e\xf1\x15\x06\x19\x8b\x9b\x4c\x72\x8b\x30\x5a\x23\x8f\x51\x8f\x7c\xaf\xfd\x7e\xd8\x7c\x2b\x36\x59\xaa\xed\x08\xc6\xc5\xab\xf1\x5d\x2e\x64\x8c\x9a\x06\xc8\xb4\x50\x16\x26\x19\x37\x11\x97\x30\x66\xbf\xf0\x0d\x4e\x61\xf4\xef\x86\x31\x1a\x23\x14\x5b\xdf\xa1\xfc\x5d\x6a\x21\xad\xf3\x39\xd4\x15\xef\xf7\x20\x0c\xd8\x35\x42\xf1\x24\x49\x35\xb8\x19\x0a\xb5\x22\xd1\xc6\x80\x24\x8f\xca\x0a\x2b\xd0\xb0\xa1\x7d\xcc\xb0\xad\xcd\x58\x9d\x47\x16\x76\xc3\x41\xe4\x5c\x31\x1c\x48\xb1\x11\x76\x30\x38\x17\xca\x0e\x07\x69\x92\x18\xac\x5a\x3a\x46\x3d\x18\xdc\xdc\xfe\x4a\x3f\x86\x83\x5c\x89\xbf\x72\xa4\x07\xc6\x6a\xa1\x56\xc3\x41\xa6\x31\x16\x11\xb7\x68\x60\x70\x73\x5b\xb6\x18\x8d\x5a\x58\x34\x1c\xcc\xe7\x20\x94\x45\xbd\xc1\x58\x90\x27\xc9\x7e\x67\xe1\x60\xb7\xbb\x00\xcd\xd5\x0a\x61\xfc\xc7\x0c\xc6\xc6\xa6\x9a\xe2\xb2\xb8\x84\x31\xfb\x10\x1a\xa4\x61\x40\x0a\x4d\xf9\x00\x6a\x4d\xf6\xbd\x9f\x1d\x89\x91\x3a\x54\x31\x75\xf1\xbe\xfc\xcf\x1a\x35\x02\x8f\x63\x03\x1c\x14\xde\x43\x69\xa2\x73\x64\xcd\xb1\x6c\x98\xe4\x2a\x82\x49\x23\x4c\xfb\x3d\x9c\x37\x1d\x38\xf5\x2a\x27\x99\x01\xc6\x58\xf7\x84\xa7\xed\x4e\xe4\xee\xba\xde\xfd\x9e\xd5\x1c\x77\x09\x3c\xcb\x50\xc5\xed\xa1\x6b\x32\x33\xc8\x0c\x63\x6c\x3a\x1c\x68\xb4\xb9\x56\xd0\x12\x0d\xb3\xfd\x99\x42\x59\xcc\xd6\xc5\x15\x8c\xc5\x0c\x6c\xea\x66\xea\x60\xd3\x7b\x9e\x4e\xd9\xc4\x6b\x11\xca\x9e\x9c\x14\x59\xec\xa5\x2f\xe1\xcc\xfd\x38\x61\xed\xaf\x0e\x6b\xc1\x5c\x05\x1e\x7a\x9f\x61\xb0\xd7\x37\x09\x7a\xfa\x9a\x1c\xc4\x2f\xe1\xcc\xff\x3a\x65\x34\xad\x84\xca\x66\xd7\xfa\x0c\x93\xa9\xff\x24\x25\x28\xb9\x9f\xfd\x2c\x76\x83\x1e\x45\x8d\x7b\x3d\x83\xf4\x14\x5e\x76\xbb\xf9\x39\xd8\xb5\x30\x10\xa5\x31\xc2\x9a\x1b\x30\x62\x23\x24\xd7\xc2\x3e\xc2\xbd\xb0\x6b\xc0\x78\x55\x2e\x56\x10\x0a\x22\x29\x50\x59\x66\x37\x99\x84\xf3\xb9\xe7\xb4\xda\xea\x0d\xeb\xf6\xc7\x78\x85\x06\xfc\x72\x84\x31\xe9\xf8\xe3\x38\x4f\x22\xfb\xed\x31\xc3\x43\xb6\x24\xce\x70\xad\x1a\xc5\x61\xc9\x71\xd1\x9a\x0b\xe5\x79\x31\xca\xb5\x46\x65\xbd\xe3\x21\x55\xee\xa1\x1b\xb8\x62\xc4\x78\x85\x6c\x38\xe8\x19\x93\xa3\xa3\x4e\x42\x74\x1a\x33\xf2\x21\x1a\xf8\xd1\x17\x97\x70\xd6\x21\xb1\xf3\x54\xbb\x68\x47\x81\xf9\xe7\x44\x6f\xe6\x5e\xd8\x68\x7d\x20\x10\x6b\xfa\xc5\xae\x05\x97\x18\xd9\xc9\xd4\x8d\xd5\x87\x33\x2f\x1c\x69\x46\xb4\xe9\xed\x76\xf0\x67\x2a\x54\xc5\x97\x41\x9b\x81\xd1\x0c\xc8\xd7\x8b\xe1\xc0\x2b\xf5\x31\x7f\xb0\xc4\xa0\x63\x18\xbd\x0f\x86\x8c\x6a\x36\x8d\x28\xb8\x23\x0a\xb5\x1f\xc1\x13\xb3\x03\x44\x11\xdb\x04\x46\xb1\x1f\x61\xfe\xad\x99\x3b\xc7\xcc\x33\x6e\xd7\xa3\x3a\x81\x87\xae\x17\xf0\x50\x6e\xaf\x5e\x0b\x2b\x14\xef\x76\x8e\xc9\x2f\x0a\xf6\xaf\x1a\xf4\x17\x60\xed\xb4\x0f\x07\x0e\x88\x81\xf7\xdd\x2a\x7d\x87\x16\xbc\x08\x31\x61\x9d\x9b\xfd\xf6\xf8\x08\x77\x8f\x20\xac\x01\x11\xf7\x5e\xab\xef\xd0\x4e\x22\xfb\x00\x51\xaa\x2c\x3e\x58\x4a\x25\xe8\xff\x0c\x44\xec\x47\x58\x5e\x3b\x2c\x3b\xe1\xc9\x79\x7d\xd0\x19\xa0\xd6\xa9\x76\xe1\xeb\x5e\x90\xcc\xef\x2a\xae\x53\x95\x9c\xb0\xe5\xf5\x44\xc4\xd3\x29\xfb\x55\xc9\x47\x1a\x7c\x1a\x58\xe8\x1d\xda\xdf\x29\x31\x90\xe2\x13\x52\x63\x06\x77\xb9\x85\x8c\x2b\x11\x19\x10\x09\x51\x93\x1b\x11\xd2\x28\xca\xb5\x79\xce\x1c\x7f\xef\x3f\xc9\xc6\x1c\x0b\xa6\x62\xef\xab\x01\xdc\xbc\x09\x18\xed\xd9\x06\x5f\x92\xda\xe9\x70\x20\x12\x27\xf7\xcd\x25\x28\x21\x1d\xc4\xdd\x4c\x26\xa8\xf5\x94\x82\x5b\xf7\x59\x5d\x7d\x70\xc6\x4f\x42\x9b\x2a\xdc\xb4\xfc\x13\xf7\xa4\x2b\xec\x42\xd5\x58\x1a\xde\x87\x3e\xe7\x3f\x6a\xfd\x4b\x6a\x7f\x4a\x73\x15\xc3\xfd\x1a\x15\xa8\x94\xba\xcb\xf4\x9e\xf2\xb3\x52\xc9\x3d\x37\x90\x90\x50\x6f\x87\x3a\xdb\xba\x3c\xfa\x14\x44\x88\x7c\x64\xae\x5d\x56\xd7\xc7\x9b\x7e\xa7\x7e\x3b\x65\x57\x52\x7a\x94\x74\xb8\x34\xf8\x50\x09\xe9\xf4\x38\xbf\x8a\x04\x24\xaa\xc9\x91\xf1\xa6\x70\x79\x09\x6f\x0e\x3a\x9f\xd5\x9c\xb5\x83\x36\x62\x7f\xe6\x77\x28\xf7\xad\xa8\x75\x69\xbf\x79\x73\x3b\x23\x85\xf5\x20\x56\x98\x76\xcd\xd7\x42\xb5\xd7\xdd\x1d\x85\x97\x63\xb8\x0c\xed\x81\xbb\xcf\xce\xe0\x9b\xa5\x29\x7c\xe4\x60\xfc\x42\x54\x2f\xaf\x4f\xe1\x5a\xc4\xcf\xc1\xb4\x88\x5f\x8a\xe1\xe5\xf5\x11\x14\x1f\x12\x83\xf7\x58\x05\xe7\x2d\xd7\x20\x62\x03\x37\xb7\x2d\x41\xe7\x37\x11\x1b\xdf\xe1\x09\x5c\x2f\xaf\x8d\x73\xf4\x3f\xba\x41\x5d\xc7\xb2\x88\x4d\x0d\xb7\x5e\x6f\x3f\xc4\xd6\x95\x85\xd0\x88\xd8\x74\xc2\x74\x79\xdd\x04\xea\xf2\xfa\x75\xa1\x7a\xcc\xd9\x2d\xff\xd1\x14\x45\xfc\x34\x40\xbd\xaa\xcf\x84\xa8\x88\x8b\xec\x57\xc9\xc7\x06\x22\x53\x7a\x70\x8a\x68\x67\xd5\x5e\x5c\xb8\x45\x24\xa0\x52\x0b\xf8\xc0\x23\x2b\x29\x6d\xc3\xa2\x23\xe1\xd3\x8b\x63\x7f\x88\x16\xfb\xe3\xdf\xcf\xb2\xdf\x3d\x9f\x65\x43\x6e\xf7\x24\xd3\xd2\x79\x9c\x92\xb5\xb7\x8b\x4a\xc9\x29\xe2\xf4\x3d\xde\x2c\x5e\xc4\xcf\x31\x26\x3c\x97\xf6\x48\xe7\x0f\x42\xad\x72\xc9\xf5\x53\xfc\x5e\x21\xa2\xa2\x6d\x6a\xbd\xd6\x52\x70\x9a\x5f\x9b\xb4\xab\x44\xea\x73\xb3\x0e\xd2\xd4\xa2\xe7\xc3\xc5\xd0\x62\xe7\x7e\x0b\x21\x90\xf4\x8b\x16\xc1\x97\xa3\xe9\xef\xfa\xd1\x74\x6d\x31\x38\xaa\x6e\x00\x5f\xc4\x70\x19\x48\xb7\x8e\xee\xe7\xb0\x78\x0d\xd7\x8d\x6e\x7d\x10\x5d\xd8\x59\x43\x76\x8d\xe9\xbd\x7b\x5f\x15\xdd\xaf\xc3\xf3\x55\xdc\x9f\x81\xea\x92\xd2\xaf\xa4\x04\x7c\xc0\x28\xb7\x68\x2a\xa4\x02\x57\x71\xed\x04\x25\x85\xb1\x90\x26\x0d\x4a\x0a\x18\xef\x3d\xe3\x40\x9b\x1d\xd8\xbc\xb9\x3d\x4a\xd2\xcf\x38\x17\xf7\xfd\x94\xd8\xff\x50\x7c\xe4\xa8\xd6\xfc\x14\x59\xed\x06\xb5\x8f\x8f\xc7\xe8\xd5\x4d\xcc\xb0\x5f\xf0\x7e\x32\x2a\x3e\x4e\xef\xf7\x0b\xc8\x95\xc9\xb3\x2c\xd5\x16\x63\x08\x87\xe7\xd1\xb4\x22\xd9\x2b\x29\x2b\x8e\xbd\x92\xf2\xb5\x40\x48\x7a\xbb\x63\xd2\x0a\xc9\x4b\xf6\xcb\xa7\xb6\xc9\xa3\x4c\xdb\x35\x42\x70\xc2\xf2\xda\x3c\x0b\xa8\x75\x16\xee\xef\x92\xc0\x61\x9d\x28\xed\x22\xd0\xaf\x06\xa7\x05\x39\xff\x9d\x38\x5d\x5e\x9b\x0a\xa7\xcb\x6b\xf3\x5a\x38\x25\xbd\xc7\x70\xda\xc9\x95\xe6\x28\x2a\x2b\x37\xf4\x67\x4a\x13\xa6\xf7\x43\x9a\xab\xe6\x87\x86\xc8\x3d\x49\x13\xd7\x58\x89\x2d\xaa\x67\x7e\x00\x76\x2a\x8f\x6d\xd9\xca\x7e\x5d\x10\x2b\x27\x73\x12\x64\x6f\x5e\x0c\x31\x37\x46\x05\x32\xd7\x7c\x2d\x98\x79\xdd\xdd\xd1\x10\x2a\x14\xcd\xf2\x10\x95\x2e\x70\xd5\x1d\xd0\x17\x5e\x4e\x63\x98\xdc\x8f\x0f\xa2\xfe\x25\x4b\xe7\x48\xd3\xa9\xb8\x6e\xcd\x0d\xa0\xc4\x0d\x2a\x6b\x8a\xc4\x72\xa5\x79\xb6\xee\x3d\x45\x37\xc2\x11\xbc\xdd\xa5\xa9\xfc\xba\x00\x57\xce\xe6\x24\xe0\x12\x2e\x0d\xbe\x18\x74\x6e\x9c\x0a\x74\xae\xf9\x5a\xa0\xf3\xba\xbb\x43\x42\x11\x21\xf7\xa2\x1f\xf0\x08\xea\xea\x5e\xe8\x8b\x3a\xa7\xb1\x58\x52\x92\x4e\x1d\xd5\x1e\x1a\xe7\x99\xf4\x25\xd2\xb4\x0e\xbe\x60\xf4\x0c\x84\x8a\x64\x1e\x0b\xb5\x02\x2e\x25\x70\x63\xd2\x48\x70\xf2\x9c\xb1\x98\x19\x06\x4b\x0b\x11\x57\x70\x87\xa4\x3c\x37\x18\x83\x4d\x21\xd3\x98\x71\x4d\x8c\xb9\xd9\xa4\xaa\xa9\xd2\xb8\x4d\x3c\x37\x48\xa3\x6d\x20\x16\x49\x82\x1a\x15\x9d\x87\x78\x62\xd1\x97\x69\x23\x67\xa5\x30\xb0\xe1\x31\xf6\x5f\xd2\xd4\x6b\xd2\x59\x56\x0b\x9e\x38\x6b\xbe\x21\x97\x15\xe5\x9a\x83\xca\x9b\x7f\x31\x1b\x0e\x7c\xd1\x7c\x01\x83\xee\x0a\x28\x49\xf8\x6a\x62\x87\x12\xff\xc2\x89\xe8\x18\x35\x29\x09\x95\xbc\x50\x67\xdf\xed\x67\x07\x31\x76\xa2\x8c\xb1\x29\xf5\xf3\x65\xf8\x05\x54\xfd\x7c\x39\xbe\xab\xa3\x97\x2d\x7a\x56\x15\xe5\x05\x94\x9d\xbb\x8b\xd8\x5d\xca\xaa\xee\x85\xc2\xf9\xbc\x08\x4c\x77\x7d\xbf\x7f\x81\xbf\x55\xe1\x3f\x2c\x96\x35\xdf\xb3\x10\xd9\x59\x18\xa3\x58\xfa\xa1\xb4\x09\xe3\x95\x4e\xf3\xec\xfb\x5a\xdd\xb1\x71\x4f\xe2\xbf\x65\xad\xea\x5b\xf3\xce\x49\xfa\xb2\xa3\x2b\xae\xf8\x76\x09\x5d\xa7\x09\xb6\xa8\xad\x88\xd0\xc0\x9d\x3f\xa5\xa7\x1a\x36\xa9\x46\x48\x04\xca\xd8\xcc\xa3\x54\xe6\x1b\x65\x98\x4b\x83\x2c\xe1\x34\x4d\x2c\x2a\xaf\xc4\x15\xd6\xf8\x6a\xa5\x71\xe5\x6e\x1e\xe4\x2a\xb2\x22\x55\x66\xe6\xf8\x64\x51\x32\xe2\xe4\x13\x3e\x9a\x4a\x70\x5a\x10\x22\x1b\x96\xe5\x39\x89\x0a\xc6\xec\x27\x37\xa8\xbf\x55\x72\x01\xe3\x84\x26\x28\x54\x8c\x0f\xd5\xbb\x37\xf4\x76\x3e\xf7\xf4\xc5\x37\x99\xc4\x85\x6f\xba\x83\xfe\x16\x1c\x68\xfc\x55\x90\xf9\xdc\x79\xbf\xf0\x50\x52\x65\xfd\x3b\x6a\x15\x99\xd5\x47\xdf\xfc\xe0\xba\xfd\xc6\x89\x39\x3f\xba\xbe\x3e\x2f\xa2\x1d\xf2\xe3\x9f\x26\x55\x8b\x91\xdf\x25\xd3\x8d\xb0\xb8\xc9\xec\xe3\xc8\x89\x05\x6b\x06\xa1\x88\xdc\x71\x75\x85\xb9\xd2\xeb\x64\xca\x9c\xd6\x10\x86\x83\x9a\x98\xb7\xe2\x87\x54\x19\xcb\x95\xa5\x55\xee\xe5\xaf\x0a\xb7\x4d\x2a\x66\x0f\x3b\xf2\x34\x88\x7c\x88\xb8\xf2\x75\xa7\xb3\xed\x94\xcc\xa9\x21\xa7\x6f\x85\x2c\x58\xe5\xc2\x0e\x7e\xdd\xcd\x02\x08\x80\x31\xe6\x9f\x04\xc2\x69\x60\xd0\xb3\x8e\x07\x53\x51\x28\x6e\x09\x9c\x2e\x14\xbb\x0e\x2c\x0c\x77\x09\x6d\x02\x70\x2f\xf6\x85\x3d\xfe\x06\xc0\x17\xdd\xc6\xbd\xbd\xcd\xa5\xdb\xf1\x09\xa9\x29\x10\x60\x30\x6c\x2d\xec\x82\xb1\x9d\x4e\xbf\xcc\xfb\x99\xbb\xdb\xb5\x4b\xdb\xc1\xe5\xa3\x2a\xb6\xa3\x80\xb0\xea\xee\x57\xbf\xd2\x76\xbb\xaa\xbd\xdb\x75\x94\xb4\x83\x11\x61\x2a\xb5\x5a\x75\x89\x81\xf7\x9d\x17\xc3\x5a\xf0\xe8\x79\x3b\xcc\xf5\xba\xb8\x7b\xec\x7b\x3b\xac\x8d\xd2\xc3\x2b\x62\x01\x6f\xd5\xb5\xaf\x44\x19\x00\x80\x9b\xdb\x72\xd1\x7d\xc9\x4b\x5e\xa5\x11\xfe\x5e\x4e\x75\x16\x2b\x98\x54\xa4\xaa\x22\xdd\xe2\xa6\x4e\xe9\xa6\x83\x13\x5b\x33\x22\x05\x0b\xb4\xdc\x34\xad\x86\x9d\x90\x3b\x18\x63\x57\x15\x71\x1f\x5b\xfe\x5d\xea\x19\x75\x6f\x5c\xe7\xe9\x92\x98\x41\xa2\x0e\xef\x80\xb5\x25\x83\x47\x88\xe8\x48\xa1\x14\xe1\x5b\x49\x73\xb2\x2e\xdf\x32\x24\x43\xef\x34\x9a\x5c\x3a\xfe\x4e\x6b\xbe\xdb\x72\x99\xe3\x0b\xbc\x52\x70\xec\xe1\x15\x82\xad\xc7\x47\xc2\x23\xdc\xed\xa7\x21\x5b\x6e\x9e\x33\x0e\x26\xfe\x7f\x3f\x6c\x1c\x58\xd0\xc4\x64\xb5\x83\x6c\x4f\x9e\x39\xda\x87\x8d\xb6\xea\x93\xc7\x0e\x1a\xac\x3a\x75\x50\xeb\x19\x87\x8e\x67\x84\xeb\xc8\x95\x8f\x56\xbc\x76\xe5\xe9\x22\x9c\x41\x0e\x5c\x55\x77\xce\x41\x0d\xa0\x79\x0e\xf1\xdc\x57\x8b\xa2\x0d\x24\xbb\x11\x56\x6c\x6b\xd7\xc7\x92\x7a\xee\x66\x29\x6f\xf3\x5f\x08\xc3\x15\x31\x2f\xb2\xdf\x97\xc7\x97\x8e\x2f\xd5\x94\x23\x40\xa2\xd3\x4d\xb9\x0a\x58\x91\xa2\x29\x3a\x62\x48\x99\xde\x63\xa8\x91\x97\x37\x6b\xcb\x05\xe3\x76\x0e\x4a\xf8\x1c\x09\x36\xae\x91\xf5\x74\x71\x61\xe3\x93\xdf\x15\x6d\xeb\x83\x62\xed\x6e\x46\x07\x1d\x38\x3e\x9e\xc2\x3f\xe1\xad\x93\xed\xf5\xed\xae\xc3\x36\x56\xba\x4f\x18\x57\x86\xe2\xd1\x5a\xe0\x96\xdf\x49\xf4\xee\x70\xf2\xe4\x0e\x97\xea\xda\x35\x57\xf0\xd6\x3b\x82\x70\xea\x6e\x62\x15\xd9\x64\x31\x09\x6f\x7a\x3f\x98\x9c\x75\xe0\xe4\xb0\x84\x5a\xbf\xf0\xb5\x0d\xa5\xcf\xfd\xb0\x11\xfe\x6a\x95\x14\x4f\x4e\xae\x94\x97\xc7\xf1\xc9\x4f\x91\xb6\xb8\x11\xb8\x9d\x3d\xe9\x84\x3a\x28\xa6\x95\xcf\xea\x8e\xa8\xaf\x98\x86\x0f\x5a\x17\xde\x5e\x23\x0d\x6a\x67\x1a\x27\x93\x1f\xd7\xe1\xb3\x93\x9f\xf0\xf3\x7f\x01\x00\x00\xff\xff\x64\x0d\x66\xef\xbd\x2f\x00\x00") func templateBuilderQueryTmplBytes() ([]byte, error) { return bindataRead( @@ -169,7 +179,7 @@ func templateBuilderQueryTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/query.tmpl", size: 13785, mode: os.FileMode(420), modTime: time.Unix(1563979564, 0)} + info := bindataFileInfo{name: "template/builder/query.tmpl", size: 12221, mode: os.FileMode(420), modTime: time.Unix(1564244317, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -194,7 +204,7 @@ func templateBuilderSetterTmpl() (*asset, error) { return a, nil } -var _templateBuilderUpdateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x59\x5b\x6f\xe4\xb6\x15\x7e\x96\x7e\xc5\xa9\xa0\x04\x23\xc3\xe6\x24\xaf\x2e\xa6\x0f\x89\x37\xc0\x02\xe9\xa6\x59\x37\x69\x50\xaf\xb1\xe0\x48\x47\x33\xac\x35\x94\x4c\x52\x1e\xbb\xaa\xfe\x7b\xc1\x9b\x6e\xa3\x19\xdb\x0b\x17\x6d\xf3\xe4\x11\xc9\x73\xbf\x7c\x87\x74\xd3\x40\x86\x39\xe3\x08\x51\x5d\x65\x54\x61\x04\x6d\x1b\x36\x0d\xc4\xd5\xdd\x06\x2e\x57\xb0\xa6\x12\x21\x26\xdf\x97\x3c\x67\x1b\xf2\x17\x9a\xde\xd1\x0d\xba\x33\x0a\x77\x55\x41\x15\x42\xb4\x45\x9a\xa1\x88\x2c\x55\xdb\x86\xe3\x5d\xb6\xab\x4a\xa1\x22\x88\xfd\x56\xbc\xae\x59\x91\xa1\xd0\x02\x2a\xc1\xb8\x82\x45\x45\x65\x4a\x0b\x88\xc9\x07\xba\xc3\x04\xa2\x5f\xc6\xda\x08\x4c\x91\x3d\x58\x8a\xee\x77\xc7\xa6\x6d\xc3\xe5\x12\x86\x8c\xdb\x16\x98\x04\xb5\x45\xf0\x2b\x79\x29\xc0\x98\xc8\xf8\xc6\x1c\x35\x92\xf4\x41\xe4\x8a\x29\x86\x92\x84\xea\xa9\xc2\x29\x1b\xa9\x44\x9d\x2a\x68\xc2\x20\x35\x3e\x08\x83\xa6\xb9\x18\x18\x67\xdd\xb6\xcc\x19\x16\x99\xd4\x36\x5e\xb4\x6d\x18\x54\x02\x33\x96\x52\x85\x12\x6e\x6e\xbb\x0f\x32\x94\x1b\xb6\xa1\xd6\xfa\x6f\x5b\x14\x08\x34\xcb\x24\x50\xe0\xb8\x87\xee\xb4\x51\x79\x60\x02\x09\xf3\x9a\xa7\xb0\x18\xfa\xa3\x6d\xe1\x6c\xac\x70\x62\x39\x2e\x2a\x09\x84\x90\x79\xd1\xc9\x94\x48\x9b\x37\x66\x4b\x06\x16\xac\x80\x56\x15\xf2\x6c\x71\xf4\xc8\x39\x54\x92\x10\x92\x84\x81\x40\x55\x0b\x0e\xa3\x98\x59\x5b\x9b\x06\xf6\x4c\x6d\x01\x1f\x15\xf2\x0c\x62\x88\xbe\xb3\xf2\xa3\x51\x20\x83\x51\xea\x48\x54\x4a\x9f\x20\x2e\x11\x34\x65\xfb\xa5\xcc\x5c\xa8\x30\xdb\xa0\x3c\x64\xb9\x5c\xc2\x35\x7d\x40\xc0\x47\x4c\x6b\x6d\xb6\x76\xfd\x7d\x8d\xe2\x09\x28\xcf\xc0\x1a\x66\x57\x79\xbd\x5b\xa3\x80\x32\x07\x51\xee\xe5\xf2\x01\x85\x62\x29\x4a\xd8\x51\x95\x6e\x31\x83\xf5\x13\xa8\x2d\x93\x50\x56\x28\xa8\x62\x25\x9f\x0b\x1d\xcc\xc5\x4e\x6b\xb0\x48\xd5\x23\xa4\x25\x57\xf8\xa8\x74\xe1\xe9\xbf\x09\x2c\x18\x57\xe7\x80\x42\x94\x22\x71\xe1\x9a\x78\xe0\xa3\x63\x1c\x0d\x64\x44\xae\x62\x5d\x69\x46\x7f\x47\x51\xfe\x4a\x8b\x1a\x23\xf8\xc6\x66\xea\xac\x8b\x1e\x68\xc1\x32\xaa\x4a\xe1\xfd\x64\x92\x5e\xcb\x31\x34\x72\xcf\x54\xba\x9d\x06\x99\x64\x42\xff\x22\x57\x8c\x16\x98\xaa\x85\x51\x33\xd5\xfd\x23\xb3\x2b\xe4\xcf\x4f\xd7\x3f\xff\x78\xde\x7d\x5e\xff\xfc\x23\x53\x78\x19\x06\x47\xb2\x86\xc8\xfb\xc2\x3b\x24\x99\xb0\xfa\x80\x95\xaa\xb9\x21\xf6\xee\x37\xde\xd1\x0d\x62\xca\x66\x23\x70\x57\x30\x3e\x60\xe5\x05\x16\xc8\x17\x9e\x3c\x31\xf4\x61\x90\x61\x4e\xeb\x42\x0d\xd4\xfa\xc6\xf9\x5d\x92\x0f\xb8\x5f\x44\xbe\x3b\xb6\xed\x25\xd4\x5c\xd6\x95\xee\x6e\x98\x79\xd5\xa2\x24\x0c\x7c\x71\x6b\x91\xbf\xe9\x4e\x54\xb0\x3b\x34\x5f\xe7\xb0\xae\x15\x54\x94\xb3\x54\x02\xcb\x81\x72\xcb\x1b\xca\x34\xad\x85\x7c\x55\xa2\xfc\x36\x9f\x29\xba\x9f\x36\x61\x40\xf3\x1c\x53\x85\xd9\x51\xb7\x0c\xfc\xc1\x72\x73\xe8\x0f\x2b\xe0\xac\xd0\xc4\x81\xd1\x70\x81\x42\x18\x6b\xbc\x27\x3c\x4f\x67\xde\xbb\x47\x4c\x67\xea\xe5\xc5\x46\x68\xfa\x79\x1b\xac\x4f\x9a\x30\xf8\xfc\x12\xf5\x9d\x76\x3a\x7c\xbd\x62\xbd\xdf\xf5\xd7\x5b\xf9\xdd\x70\x9e\xd7\xb9\xe9\xfc\x38\xa3\xad\x37\x35\xf9\xe3\x69\x4f\xbf\xb0\xb7\x4d\xea\xfa\xa0\xd5\xb9\x5c\x5c\xca\xfb\x62\xe9\x81\xfd\x4d\x7a\xa8\x67\xec\x6a\xea\x14\xf3\xb8\xe4\x38\x05\xfa\x1c\xa2\xaf\xe4\x4f\x1c\xc7\x22\x46\xce\x1a\x02\xfc\x80\x83\x6b\xd1\x13\xbe\xcf\xe0\x3c\x05\xc9\xf8\xa6\xc0\x19\xc0\x7f\x1a\xc0\xfd\x98\xe1\x21\xe2\xb3\xcc\x32\x78\x7f\x45\xfe\xaa\x69\x7c\x43\x3c\x31\x05\x3c\x8f\x79\x63\xdb\x5e\x06\x7b\x5f\xcc\xf0\xcd\xa0\xcf\x32\xca\x3a\x1f\x9e\x28\x9b\xb1\x57\x4f\x62\xdb\xd9\x30\x3e\x6f\x8a\x72\x11\x67\x45\xf4\x7b\x41\xba\x23\xc4\x87\xf8\x76\x88\x61\x9c\x15\xff\x23\x28\x36\x4a\x8b\x93\x40\x36\xca\x0a\x3f\xa2\x92\x8f\x3d\xc3\xb7\x84\xb6\x29\xef\xd3\x10\x07\x25\x37\x1f\xaf\x2d\x83\xff\x1b\xcc\x9b\xd1\xfa\xbf\x08\x7b\x03\x6d\xfe\xd3\xc8\x77\xaa\x8b\xbe\x02\xfc\xfa\x9f\xcb\x33\x90\x5b\x2a\x30\xf3\xc0\x62\x41\x02\xd6\xa8\xf6\x88\x36\x8d\xd4\xbe\x72\x9d\x55\x48\x38\x5b\x5a\x6e\xe3\x8b\xb9\xc7\x16\xbb\x27\x28\xdf\x20\xc4\x9f\xcf\x21\xce\xb5\xdf\x63\xf2\x83\xe5\xea\x3b\x58\x9c\x93\x6b\x23\xce\xac\x77\x61\xcd\x3b\x00\xeb\x75\xd4\xc7\x07\xfc\xd0\xf2\x7b\xa7\xa1\xa2\x67\x87\x53\x76\x3b\x5a\xdd\x4c\x40\xf1\xd6\x1a\xd8\xbc\x9a\x79\xa5\x57\x23\x81\xbb\xf2\x01\x33\x7d\xe7\x6f\x1a\x9d\xaf\x31\x92\x5f\x38\xbb\xaf\xd1\xae\xc4\x15\xac\x20\x4a\x0b\xd4\xce\x74\xa7\x9c\x14\xc3\xc6\xbe\x24\xc4\x55\xff\x98\x80\xee\x35\x41\x77\x8f\x03\x8e\xeb\xb2\x2c\x34\x87\x42\xea\xaf\x53\xe6\x0c\xad\xe9\xa0\xe1\x48\x8c\x0d\xc2\x82\x31\x85\x16\x93\x18\x97\xcf\xc6\xd8\xe1\xb3\x1b\x89\x86\xc3\x93\xb5\x88\x5c\xa7\x65\x85\xe4\xbb\x23\xa3\xd3\xb1\xc7\x91\x49\xc6\xcc\x04\x61\xea\x1c\x8b\x96\xb1\x69\x10\xdd\x23\x4d\xf4\xbd\xf6\x7d\x34\xe7\xdf\x30\x08\xdc\x70\x66\x48\xda\x16\x4c\x9c\x6c\xc7\xd4\xcb\xd8\x4f\x5f\xd9\x06\x41\x95\x6e\x55\xfb\xda\x6f\x91\x30\x08\x5e\x38\x86\x0f\x24\x2d\x66\x5f\x33\x82\x60\xda\x8a\x5c\xe2\x34\x0d\x8c\xd5\xd7\x04\x2b\x50\xa2\x46\x4d\x75\xe4\xfd\x22\x08\xac\x9b\x5c\xb6\x38\xf7\x98\xbc\x2d\xca\x3d\x0a\x58\x74\xe3\x2d\xf9\x56\x0f\x80\x03\xcb\x12\x4f\xb0\x3c\xd3\x6e\x36\x0f\x08\x5a\x6e\x69\x7f\x57\x54\xd0\x1d\x2a\x14\xba\xb5\xe6\x05\x4b\x95\xb4\xdd\x49\x6f\x76\x3a\x18\x0a\x93\x35\x81\x0b\x17\xde\x6b\x05\x46\x6e\xea\x8a\xe4\x21\x72\x9f\xbe\x3e\x8c\xba\x2c\x93\x3f\x8c\x03\xfa\xd1\x94\x5c\x04\x0b\x3d\x26\xd7\x05\x15\x9d\x53\xfe\xe5\xbc\x94\x40\xf4\xfe\xca\xa6\x64\x17\x62\xcf\xa7\x6d\x6d\xa2\xe3\xeb\xc2\x0c\xeb\x27\x60\x99\x7c\x65\xb4\x7b\xa1\x0b\x96\x99\xb7\xad\x49\xb9\x1e\x49\x03\x96\x1f\x80\x92\x6b\x34\xf3\x99\xd0\x23\xd4\x61\x0a\x9d\x24\x84\x1d\xbd\xc3\xc5\xa9\x3e\x92\x68\xa6\xda\x8f\x81\xbe\xa4\x30\x53\xae\xa6\x2a\xb5\x41\xaf\x96\x78\xc3\x32\x79\xc3\x6e\x6f\x61\x05\x5d\xa3\x6a\x3b\x09\xa7\xf2\x78\xae\xb4\xbb\x4c\x78\x49\x6d\xfb\xa8\x1f\x46\x5c\xbe\x69\x65\xdb\x7c\x6e\x5b\x1d\xed\xb3\x43\xae\xc7\x22\x9e\x49\x6d\x98\x09\xc7\xcd\xed\x24\x18\xe7\xe6\xcd\xc7\x33\x4e\x12\xdf\x29\x4c\x34\x22\xd6\x83\x8f\x2e\x2f\x66\x4f\xd9\xfd\x15\x44\xff\x18\xa0\x8e\xbd\x52\x98\x48\xda\xfd\xb6\xed\x03\xda\x29\x6e\xa3\xaa\x23\xe5\x0f\xe9\x78\xf9\xed\x7e\x91\xbc\xbf\x7a\x26\x74\xe4\xb0\x08\xec\x8b\xab\xef\x4c\x23\x84\x3a\x0e\x50\x7e\x9a\x91\xe6\xa6\xdc\x5f\x7f\xc8\x31\x4c\x1a\xde\x90\x1c\xa0\xfb\x7f\x0e\x38\x38\xf2\xff\x15\xb8\xf0\xdb\xff\x44\x51\x0e\xf6\xbb\xeb\x58\x47\x3f\x44\x2c\x77\xa8\x1b\xbd\x2f\x0e\xa7\x86\xf1\x88\x73\xe1\x20\xcb\x34\xc9\x38\x27\xbf\x76\x0a\xba\xa0\xcc\x94\xbc\x9d\x7d\x26\x23\xcc\x60\x1a\x9d\x8c\xb0\x83\x7f\x74\x38\xd2\x4e\x88\xf6\xfd\xd9\x4b\xd8\x1f\x8e\xbc\xa3\xd0\x1a\x1f\xe9\x7c\xcc\x77\x8a\xbc\xd3\x63\x79\x3e\xbe\x94\x75\x7e\x87\x9c\xb2\x02\x33\x13\x2f\x33\x04\xc2\xa7\xc8\x0a\x74\x75\xf0\x29\xba\x84\xaf\x1e\x22\x73\x6b\xe8\x7a\x4c\x9f\x15\x17\xd3\xc1\xe5\xf9\x89\x6c\x34\x0d\x74\x4e\xf5\x95\x33\xb5\x7c\x3a\x1b\x26\xf0\x27\xf8\xd6\x5a\x3c\x67\xf0\xb1\x5b\xe8\xae\x2e\x14\xab\x0a\x04\x2a\x25\xdb\xf0\x1d\x72\x25\xf5\x3d\x8b\x42\x6d\x15\x31\x90\x62\x6d\xc7\xde\xf6\x28\xe9\xbb\x1a\xcb\x81\x97\x4a\x6f\xff\x54\x29\x56\x72\x5a\xf8\x3a\x9d\xc9\x89\x53\x03\xc1\xd7\x5f\xcf\xa6\xd0\xc1\x14\xbc\x7a\x2e\xba\xc7\x8c\x35\xc2\xed\x13\xd5\xf3\xd6\x79\xf3\xba\xbe\x73\x2c\xb2\xbe\xe2\xff\x1d\x00\x00\xff\xff\x93\xda\x81\x04\xd7\x1b\x00\x00") +var _templateBuilderUpdateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x59\x4b\x6f\xe4\xc6\x11\x3e\x93\xbf\xa2\x42\xcc\x1a\x43\x41\xe2\xd8\x57\x05\x93\x83\xbd\x6b\x60\x2f\x76\xb0\x1b\x3b\x46\x64\xc1\x68\x91\xc5\x51\x7b\x39\x4d\x6e\x77\x53\x8f\x30\xfc\xef\x41\xf5\x8b\x8f\xe1\x8c\x24\x43\x40\xb2\x80\x4f\x1a\xf6\xa3\xba\xaa\xbe\xaa\xfa\xaa\x5b\x5d\x07\x05\x96\x5c\x20\x24\x6d\x53\x30\x8d\x09\xf4\x7d\xdc\x75\xb0\x6a\x3e\xed\xe0\x72\x0b\x37\x4c\x21\xac\xb2\xef\x6a\x51\xf2\x5d\xf6\x77\x96\x7f\x62\x3b\x74\x6b\x34\xee\x9b\x8a\x69\x84\xe4\x16\x59\x81\x32\xb1\xbb\xfa\x3e\x9e\xce\xf2\x7d\x53\x4b\x9d\xc0\xca\x4f\xad\x6e\x5a\x5e\x15\x28\xe9\x80\x46\x72\xa1\x61\xdd\x30\x95\xb3\x0a\x56\xd9\x0f\x6c\x8f\x29\x24\x3f\x4d\xb5\x91\x98\x23\xbf\xb3\x3b\xc2\xef\x20\xa6\xef\xe3\xcd\x06\xc6\x82\xfb\x1e\xb8\x02\x7d\x8b\xe0\x47\xca\x5a\x82\x31\x91\x8b\x9d\x59\x6a\x4e\xa2\x85\x28\x34\xd7\x1c\x55\x16\xeb\xc7\x06\xe7\x62\x94\x96\x6d\xae\xa1\x8b\xa3\xdc\xf8\x20\x8e\xba\xee\x62\x64\x9c\x75\xdb\xa6\xe4\x58\x15\x8a\x6c\xbc\xe8\xfb\x38\x6a\x24\x16\x3c\x67\x1a\x15\x5c\x5d\x87\x8f\x6c\x7c\x6e\xdc\xc7\xa4\xf5\x3f\x6f\x51\x22\xb0\xa2\x50\xc0\x40\xe0\x3d\x84\xd5\x46\xe5\x91\x09\x59\x5c\xb6\x22\x87\xf5\xd8\x1f\x7d\x0f\x67\x53\x85\x53\x2b\x71\xdd\x28\xc8\xb2\x6c\xf9\xe8\x74\xbe\x89\xcc\x9b\x8a\xcd\x46\x16\x6c\x81\x35\x0d\x8a\x62\x7d\x74\xc9\x39\x34\x2a\xcb\xb2\x34\x8e\x24\xea\x56\x0a\x98\x60\x66\x6d\xed\x3a\xb8\xe7\xfa\x16\xf0\x41\xa3\x28\x60\x05\xc9\xb7\xf6\xfc\x64\x02\x64\x34\x09\x1d\x85\x5a\xd3\x8a\xcc\x05\x02\xed\xec\xff\xa8\x30\x07\x15\x16\x3b\x54\x87\x22\x37\x1b\xf8\xc8\xee\x10\xf0\x01\xf3\x96\xcc\x26\xd7\x7f\x6e\x51\x3e\x02\x13\x05\x58\xc3\xec\xa8\x68\xf7\x37\x28\xa1\x2e\x41\xd6\xf7\x6a\x73\x87\x52\xf3\x1c\x15\xec\x99\xce\x6f\xb1\x80\x9b\x47\xd0\xb7\x5c\x41\xdd\xa0\x64\x9a\xd7\x62\x09\x3a\x58\xc2\x8e\x34\x58\xe7\xfa\x01\xf2\x5a\x68\x7c\xd0\x94\x78\xf4\x37\x85\x35\x17\xfa\x1c\x50\xca\x5a\xa6\x0e\xae\x99\x07\x3e\x38\xc1\xc9\xe8\x8c\xc4\x65\xac\x4b\xcd\xe4\x5f\x28\xeb\x9f\x59\xd5\x62\x02\x5f\xdb\x48\x5d\x74\xd1\x1d\xab\x78\xc1\x74\x2d\xbd\x9f\x4c\xd0\xd3\x39\x66\x8f\xba\xe7\x3a\xbf\x9d\x83\x9c\x15\x92\x7e\x65\x6f\x39\xab\x30\xd7\x6b\xa7\xe6\x05\x48\x26\x76\x08\xab\xdf\xce\x61\xa5\x74\x2d\xa9\x80\x5c\x6e\x61\x95\x7d\x74\x1f\x24\x32\xa7\x3a\xd3\x75\xf0\x7b\xcd\x45\x58\xe6\x45\x29\x48\xce\x81\x6a\xc1\x65\x1c\x1d\x89\x30\x13\xdf\x2a\x08\xf4\x7e\x4c\x07\xcd\xe9\x94\x02\x4b\xd6\x56\x7a\x24\xe6\x6b\xe7\x53\x95\xfd\x80\xf7\xeb\xc4\x57\xbe\xbe\xbf\x84\x56\xa8\xb6\xa1\xca\x85\x05\x14\x56\x91\x24\x8d\x23\x9f\xb8\x74\xc4\x2f\x54\x65\x2a\xfe\x09\xcd\xd7\x39\xdc\xb4\x1a\x1a\x26\x78\xae\x80\x97\xc0\x84\x95\x0d\x75\x9e\xb7\x52\xbd\x28\x08\x7e\x59\x8e\x02\xaa\x95\x5d\x1c\xb1\xb2\xc4\x5c\x63\x61\x94\x27\x67\xce\xbd\x31\xb2\x9f\x97\x66\xd1\x5f\xb6\x20\x78\x45\x9b\x23\xa3\xe1\x1a\xa5\x34\xd6\x78\x4f\x78\x99\xce\xbc\x77\x0f\x98\x2f\xe4\xc2\xb3\x8d\xa0\xfd\xcb\x36\x58\x9f\x74\x71\xf4\xdb\x73\xd4\x77\xda\xa1\x94\x23\xc5\x06\xbf\xd3\xd7\x6b\xf9\xdd\x48\x5e\xd6\xb9\x0b\x7e\x5c\xd0\xd6\x9b\x9a\xfe\xf5\xb4\xa7\x4d\xdd\x7a\x5e\x3a\x3c\xa7\xbe\xcd\x72\xdb\x27\xf3\x4a\xef\x9b\x2a\x30\x6b\x09\x89\x8b\xdd\xcd\x1b\xb5\xf1\x1c\x3f\xca\x14\xbb\xe9\x21\x94\x00\xbb\xdd\x27\xbd\xcf\x9c\x69\xe9\x5d\xd5\x02\xe7\x14\x5e\x42\xf2\x46\xfd\x28\x70\x5a\x80\x27\xae\x1a\x53\xf7\x48\x82\x2b\xbe\x33\xb9\x4f\x30\x38\x03\xc5\xc5\xae\xc2\x05\x2a\x7f\x1c\x11\xf9\x54\xe0\x21\x97\xf3\xc2\x0a\x78\xff\x36\xfb\x07\xed\xf1\xa5\xee\x04\xbf\x3f\xcd\x66\x53\xdb\x9e\x47\x68\x7f\x58\xe0\xab\x91\x9a\x15\x54\x04\x1f\x9e\x48\x9a\xa9\x57\x4f\xb2\xd6\xd9\x18\x9f\x57\xe5\xaf\x44\xf0\x2a\xf9\x93\xc3\xa4\xa0\x6a\xf3\x7f\xc2\x62\x93\xc0\x38\x49\x64\x93\xb8\xf0\xed\x67\xf6\x61\x10\xf8\x9a\xd4\x36\x97\x7d\x9a\xe2\xa0\x16\xe6\xe3\xa5\x89\xf0\xc5\x70\xde\x82\xd6\x5f\x00\xed\x8d\xb4\xfe\xdf\x31\xdf\xf0\x73\x73\x06\xea\x96\x49\x2c\x3c\xab\x58\x86\x80\x1b\xd4\xf7\x88\x36\x82\xf4\x7d\xe3\xca\xaa\x54\x70\xb6\xb1\xd2\xa6\xf7\x6d\x4f\x2c\x76\x6e\xe4\xa3\xd2\x7a\xe7\x7b\x2b\xd5\x97\xaf\x55\x99\x7d\x34\xc7\x99\xf1\x80\x68\x19\xd8\x6b\xac\xf8\xc4\xe7\xce\xdb\xef\x88\x27\x06\x71\x38\x17\xb7\x67\xcd\xd5\x8c\x11\xaf\xad\x81\xdd\x8b\x85\x37\x34\x9a\x48\xdc\xd7\x77\x58\x50\xe9\xeb\x3a\x0a\xd5\x15\x66\x3f\x09\xfe\xb9\x45\x3b\xb2\x6a\x60\x0b\x49\x5e\x21\x39\xd3\xad\xf2\xb5\x8e\xc4\xd8\x07\x82\x55\x33\xbc\x11\xa0\x7b\x24\xa0\xc2\x71\x20\xf1\xa6\xae\x2b\x92\x50\x29\xfa\x3a\x65\xce\x01\xc6\x17\x73\xb8\x07\x8c\x0d\xbd\x82\x31\x85\x55\x33\x8c\xeb\x27\x31\x76\xe4\xec\xfa\xa1\x71\xe7\x64\x2d\xca\x3e\xe6\x75\x83\xd9\xb7\x47\xfa\xa6\x63\x6f\x1e\xb3\x88\x59\x00\x61\xee\x1c\x97\x27\xa6\x36\x84\xb7\x97\xe4\x3b\xf2\x7d\xb2\xe4\xdf\x38\x8a\x5c\x67\x66\xb6\xf4\x3d\x18\x9c\x6c\xb1\xa4\x61\x1c\x5a\xaf\x62\x87\xa0\x6b\x37\x4a\xbe\xf6\x53\x59\x1c\x45\xcf\xec\xc0\x47\x27\xad\x17\x1f\x29\xa2\x68\x5e\x85\x5c\xe0\x74\x1d\x4c\xd5\xa7\x0d\x5b\xd0\xb2\x45\xda\x75\xe4\x59\x22\x8a\x5c\xae\xdb\x68\x71\xee\x31\x71\x5b\xd5\xf7\x28\x61\x1d\x7a\xdb\xec\x1b\xea\xfe\x46\x96\xa5\x7e\xc3\xe6\x8c\xdc\x6c\xde\x05\xe8\xdc\xda\xfe\x6e\x98\x64\x7b\xd4\x28\xa9\xaa\x96\x15\xa7\x0e\xc0\xd4\x36\x9a\x0c\x3a\x98\x1d\x26\x6a\x22\x07\x17\x7e\x26\x05\x26\x6e\x0a\x49\x72\x97\xb8\x4f\x9f\x1f\x46\x5d\x5e\xa8\xef\xa7\x80\x7e\x30\x29\x97\xc0\x9a\x7a\xe4\xb6\x62\x32\x38\xe5\x3f\xce\x4b\x29\x24\xef\xdf\xda\x90\x0c\x10\x7b\x39\x7d\x6f\x03\x1d\x5f\x06\x33\xdc\x3c\x02\x2f\xd4\x0b\xd1\x1e\x0e\x5d\xf3\xc2\x3c\x59\xcd\xd2\xf5\x48\x18\xf0\xf2\x80\x8f\x5c\xa1\x59\x8e\x84\x81\x9c\x0e\x43\xe8\xe4\x46\xd8\xb3\x4f\xb8\x3e\x55\x47\x52\x12\x4a\x7e\x8c\xe8\x86\xc2\x4d\xba\x9a\xac\x24\x83\x5e\x7c\xe2\x15\x2f\xd4\x15\xbf\xbe\x86\x2d\x84\x42\xd5\x87\x13\x4e\xc5\xf1\x52\x6a\x87\x48\x78\x4e\x6e\x7b\xd4\x0f\x11\x57\xaf\x9a\xd9\x36\x9e\xfb\x9e\xd0\x3e\x3b\x94\x7a\x0c\xf1\x42\x91\x61\x06\x8e\xab\xeb\x19\x18\xe7\x50\xa1\x08\x82\xd3\xd4\x57\x0a\x83\x46\xc2\x07\xf2\xa1\xf4\xe2\x76\x95\x9d\xdf\x42\xf2\xfb\x88\x75\xec\x7d\xc2\x20\x69\xe7\xfb\x7e\x00\x34\x28\x6e\x51\x25\xa4\xfc\x22\xc2\xcb\x4f\x0f\x83\xd9\xfb\xb7\x4f\x40\x97\x1d\x26\x81\x7d\x48\x8d\x8e\x74\x21\x47\x08\xca\x77\x31\xca\x5c\x93\x87\xbb\x4f\x76\x8c\x93\xc6\xd7\x23\x47\xe8\xfe\xcd\xdf\xd1\x91\x7f\xec\xbf\xf0\xd3\xff\x46\x59\x8f\xe6\xc3\x5d\x2c\xec\x1f\x33\x96\x5b\x14\xba\xee\x8b\xc3\xae\x61\xda\xe2\x5c\x8c\x1b\xc0\x55\x99\xfd\x1c\x14\x74\xa0\x2c\xa4\xbc\xed\x7d\x66\x2d\xcc\xa8\x11\x9d\x75\xaf\xa3\xff\x5f\xb8\xad\xe1\x10\xf2\xfd\xd9\x73\xc4\x1f\x76\xbb\x13\x68\x8d\x8f\x28\x1e\xcb\xbd\xce\xde\x51\x47\x5e\x4e\xef\x63\xc1\xef\x50\x32\x5e\x61\x61\xf0\x32\x4d\x20\xfc\x9a\xd8\x03\x5d\x1e\xfc\x9a\x5c\xc2\x9b\xbb\xc4\x5c\x18\x42\x8d\x19\xa2\xe2\x62\xde\xb8\x3c\xdd\x91\x4d\xba\x81\xe0\x54\x9f\x39\x73\xcb\xe7\xbd\x61\x0a\x7f\x83\x6f\xac\xc5\x4b\x06\x1f\xbb\x80\xee\xdb\x4a\xf3\xa6\x42\x60\x4a\xf1\x9d\xd8\xa3\xd0\x8a\xae\x58\x0c\x5a\xab\x88\xa1\x14\x6b\x3b\x0e\xb6\x27\xe9\x50\xd5\x78\x09\xa2\xd6\x34\xfd\x63\xa3\x79\x2d\x58\xe5\xf3\x74\x21\x26\x4e\x35\x04\x5f\x7d\xb5\x18\x42\x07\x5d\xf0\xf6\x29\x74\x8f\x19\x6b\x0e\xb7\xef\x53\x4f\x5b\xe7\xcd\x0b\x75\xe7\x18\xb2\x3e\xe3\xff\x1b\x00\x00\xff\xff\xfb\xc4\x81\xd9\xae\x1b\x00\x00") func templateBuilderUpdateTmplBytes() ([]byte, error) { return bindataRead( @@ -209,12 +219,12 @@ func templateBuilderUpdateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/update.tmpl", size: 7127, mode: os.FileMode(420), modTime: time.Unix(1563979564, 0)} + info := bindataFileInfo{name: "template/builder/update.tmpl", size: 7086, mode: os.FileMode(420), modTime: time.Unix(1564232317, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateClientTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x58\x4b\x73\xdb\x36\x10\x3e\x93\xbf\x62\xcb\x71\x3a\xa4\x47\x81\x6a\x27\x27\x75\x7c\xa9\xe5\xce\xa8\x8d\xad\x38\x76\xd3\x43\xa7\x93\x81\x49\x90\x42\x42\x81\x32\x08\xd9\xf2\x30\xfa\xef\x9d\xc5\x83\x0f\xbd\x4c\x3b\x3d\x59\x78\xec\xee\xb7\xdf\x7e\x58\x80\xae\x2a\x48\x58\xca\x05\x83\x20\xce\x39\x13\x2a\x80\xf5\xda\xf7\xab\x0a\x8e\x16\xdf\x32\x18\x9d\xc1\x1d\x2d\x19\x1c\x91\xf3\x42\xa4\x3c\x23\x1f\x69\xfc\x8d\x66\x0c\x37\x55\x15\x28\x36\x5f\xe4\x54\x31\x08\x66\x8c\x26\x4c\x06\xc6\x0a\x3d\xf0\xf9\xa2\x90\x0a\x42\xdf\x0b\xf2\x22\x0b\x7c\xdf\x0b\xd0\xe9\xb6\x9f\xe1\x9c\x67\x92\x2a\x16\xf8\x5e\x55\x81\xa4\x22\x63\x70\xf4\x65\x00\x47\x02\xa3\x1f\x91\xab\x22\x61\x25\xba\xf4\x8c\x07\xb1\xc3\x85\x99\x6f\x26\xb4\xaf\xb7\xc0\x44\x82\x86\x91\xef\x0f\x87\x70\xae\xd3\x03\x5e\x82\x9a\x31\x30\xc9\x82\x9a\x51\x05\xb3\x22\x4f\x4a\xa0\x79\x0e\x38\x75\xb7\xe4\x79\xc2\x64\x49\x7c\xf5\xb4\x60\xce\xac\x54\x72\x19\x2b\xa8\x7c\x2f\xd6\xd1\x7d\x6f\x38\x84\x9b\x78\xc6\xe6\x74\xc3\x65\x5a\x48\x88\x25\xa3\x8a\x8b\x6c\x00\x26\x39\x2e\x32\xa0\x22\x81\x44\x16\x8b\x05\x0e\x4a\x6d\x49\x7c\xcf\xba\x38\xb6\x24\x10\x33\x3e\x48\xc5\x5b\xcd\xc5\x70\x08\x26\xeb\x2b\x3a\xc7\x94\x77\xa0\xe0\x42\x31\x49\x63\x1d\xfd\x91\xab\x99\x5e\xef\x1a\x35\xc9\x7a\x5e\x77\xe5\xb8\x33\x34\x2c\x68\x58\x96\xd4\xb5\x26\xf5\x8a\x3d\x5a\x82\x74\xca\xac\x04\x0a\x82\x3d\x3a\x14\x86\xab\xa5\x64\x49\x03\x20\xe3\x0f\x4c\x40\xb1\x50\xbc\x10\x25\xf1\xd3\xa5\x88\x1b\x37\x61\xb1\x50\x25\x10\x42\xa6\x7a\x3d\x82\x63\xeb\x1e\x89\x47\x12\x8c\xc7\x2a\x2f\xb2\x11\xe4\x45\x46\x3e\x4a\x2e\x54\x2e\xd6\xbe\x17\x13\xeb\x53\xfb\x20\x84\x44\xbe\x27\x99\x5a\x4a\x01\x3f\x1b\x27\x95\xef\xd9\xea\x8d\x20\x1e\xf8\x9e\x25\x7f\x04\x8e\xfc\x2b\xf6\x68\xa6\xc2\x98\x24\x92\x3f\x30\x19\x0d\x0c\x31\x87\x6b\xd1\xa5\x6e\x84\xe9\xec\x60\x2f\x8c\x9d\x37\xa4\x50\x5b\x3a\x1a\x6f\x57\x60\xa0\x3a\xfe\x94\xa4\xa2\xc4\xd2\x15\x82\xe6\x96\x4d\xcb\x55\x18\x3b\x52\x22\xb8\x5d\x85\xb1\x5a\x21\x29\x8a\xad\x14\x1e\x0c\xfc\x1b\x41\x78\x7c\xbb\x1a\x00\x93\xb2\x90\x11\x52\xc7\x53\xf8\x32\x80\xe2\x9b\x66\xd0\xa6\x46\xc2\x63\xb5\x1a\x9b\x2c\x7f\xc5\x35\xa4\xc7\x12\x26\x78\x3e\x80\x74\xae\xc8\x05\xba\x48\xc3\xc0\xf5\x03\xcc\x2e\xa6\x42\x14\x78\x22\xa8\x54\x40\xdb\x50\x75\x91\xb9\xe8\x4e\x06\x11\xe6\xe9\x29\x03\x08\x11\x08\xf6\x68\x80\x0f\x6a\x30\x91\xc6\x88\xeb\x3f\x9d\x61\xf4\xde\x60\x34\x0a\x7d\xbc\xda\x31\x47\xf0\xe6\x21\xd0\xf1\x4c\xf0\x38\xcd\x5a\xe2\x31\x21\x47\x80\x00\xb4\x90\x62\x92\x17\xd9\x00\x1e\x98\xbc\x2b\x4a\x86\x63\xfb\x73\xdd\x48\xe8\x76\xd5\x91\x4f\x9a\xfd\xaf\xca\x48\xb3\x6d\x6d\x0c\x30\x73\xdf\x34\xe3\x43\x51\xd0\xa1\x3d\x6f\xa3\x33\x58\xe0\x81\xa8\x23\x04\xe7\x4d\x53\xb7\x1d\xc3\x6e\x35\x1d\x83\xb6\xfb\xc5\x76\x7b\x70\x6d\x4a\x77\xc2\xae\xf1\x56\x43\xb4\xb7\x86\x64\xfa\x9c\x1e\x09\xf2\x89\xc5\x0c\x89\x86\xf5\xba\xaa\x00\xcb\x7b\x6f\x96\x83\x38\x30\x73\x7a\x64\x21\xa7\x10\xbc\x21\xa7\x65\x50\x87\xff\x0e\x79\xf1\xe8\xac\x6d\xd3\xb1\x2d\xa7\x8b\xa4\x39\x39\x07\x73\x49\x65\x31\x6f\x35\x20\x83\xba\xe9\x3f\x1d\x9f\x61\x6c\xd7\x23\xd3\x07\x9b\x60\x55\xa3\x88\xce\x42\x55\x2b\xc3\x9d\xe9\x73\xdd\x10\xdb\xe8\xcc\x84\x6d\xb9\x1a\x65\x07\x61\xeb\x7c\x77\x5c\x47\xd6\x55\x18\x6d\x36\x65\xe3\x70\x03\xd2\xc6\x72\x03\x8c\x98\x5f\x0e\xdf\x5f\x8b\xa4\x83\x4f\xc0\xd2\xcc\xbc\x02\xa0\xf1\xb5\x05\xd0\x86\xd8\x07\xd0\x2c\x3f\x03\x70\x2a\x9e\xc3\xd8\xd4\x94\x09\xc5\xd5\xd3\x73\x30\xa7\x82\x85\x4e\x7c\x5b\x17\xdd\xee\x14\x10\x44\x93\x45\x4c\xea\xd9\xc9\xb8\xe5\x8a\x4c\xc6\xd1\x26\xf6\xc9\xb8\x37\x7a\x9e\xf4\x40\x3e\x19\x87\x3c\xb1\x65\x99\x8c\xc9\x2d\x1e\xcc\x7e\xa8\x77\x71\x3f\x15\xdb\xf4\x0f\x80\x27\x23\xe0\x89\x2b\xc3\x98\xe5\xac\xa3\xe3\xc4\x4c\xbc\x42\x26\xc6\xd5\x96\x4c\x6c\x84\x7d\x50\xcd\xf2\x5e\x99\x98\xe5\x8e\x4c\x76\x41\xec\xaf\x92\xda\x61\x7f\x95\x34\x18\xda\x2a\xa9\x67\xf7\xa9\xa4\xb5\xa1\x2f\xf8\x43\x22\x69\xc7\xeb\x21\x92\x5d\xa0\x77\x31\xaf\x45\x42\x5c\xed\xc8\xdf\x33\x26\x0d\x35\xed\x17\x37\xd1\x31\xa3\x68\x6f\xf7\xbb\x5f\x32\xf9\xf4\x1a\xd1\x5c\xa3\xe1\x96\x66\xf4\xec\x5e\xe0\x7a\x75\xb7\x62\xba\x97\x29\xb3\x77\xd5\x45\x92\x99\x8f\x0c\x74\xe3\x40\xd6\xb7\x69\xb8\xa0\x65\x4c\x73\x38\x62\x9a\x4b\x1d\x25\x82\x40\x47\x71\x57\xab\x09\x59\x41\xb3\xd5\x5d\x3c\x98\x39\x67\x65\x7d\x25\x35\x2b\x2c\xc9\x18\x14\x29\xd0\x17\x71\xb1\x2b\xc8\xb3\x52\x75\x39\x99\x2b\xcc\x14\x63\x74\x66\x68\x6b\x65\x75\x80\x3b\xaf\x7c\xe4\x2a\x9e\x35\xef\xc7\x31\xa7\x39\x8b\x55\xa8\x5f\x98\x5e\x8c\x9f\x89\x89\x99\x22\x97\x4f\x37\xd7\x1f\x06\xf5\xf0\xe6\xfa\x03\x57\x6c\x84\xef\x21\x9e\x60\xd8\xd6\x69\xc0\xef\x34\x9e\x5a\xa5\x4e\xca\x1b\x25\xf1\x35\xb7\x5e\xf3\x24\x8c\xf0\xe2\xcf\x4b\x04\x35\x19\x37\x8f\x00\xfd\xaa\x32\x46\x8c\x5c\x9e\x5e\x82\x9d\xd4\x6f\x2d\x8e\xee\x4f\xec\xf3\xe2\x2b\x0e\x7e\xd1\x03\xb7\x7f\x52\x4e\xc4\x03\x93\xda\xa9\xd9\xef\x76\xe0\xf6\xda\xb4\x7e\x85\x79\x9e\xa7\x4e\xd0\x4d\x79\x9f\x93\x5b\x7a\x97\x1b\xe9\x5b\xca\x5a\xfa\xd7\x6b\x91\x31\x38\xdd\x36\x10\xfb\xf6\xbe\x7b\x66\xaf\x8d\x86\x8b\xe7\x85\x28\x15\x35\x52\x30\xc6\xef\x9d\xf1\x0d\xd3\xa5\x50\xef\xc8\xf9\x3e\x17\x1f\xff\x6c\xd9\xff\x63\x72\x5f\xaf\xff\x8d\x22\xa2\x7d\x79\xde\xef\xb2\x98\x87\xea\x5d\x3d\xfe\xa3\xe0\x22\x54\xa7\xf5\x78\x2a\x5e\xe8\xff\xab\xf6\x3f\x00\x75\xba\xcf\x4a\x17\xbd\x9d\x56\x1d\xcc\x74\x19\x4c\xed\xe2\x3a\x7c\x81\x03\xbc\xbd\x22\xc3\x8e\x16\x39\x29\xef\x73\xe8\x70\xe4\x42\x98\x74\x4f\xdc\xd0\x64\xfb\xde\x0d\x31\xd9\x13\x1b\x75\xbb\xd8\xad\xd9\xad\xf8\xea\xfd\x2b\x6a\xe0\x44\xad\xe5\xce\x53\x28\xa4\x11\xf7\x14\x42\x2a\x12\xfc\x3d\x3d\x9d\x76\xf4\x1b\x69\xa1\x0e\x8f\x01\x37\x7d\xff\x0e\x21\x6e\xd0\x1f\xd9\xdc\x0a\x1c\xbb\x4b\x04\xc7\xc3\x1f\x97\xb1\x65\x6e\x4f\x52\xe7\x45\xbe\x9c\x8b\x36\x09\x6d\x86\x5f\x2e\x6d\x67\xde\x91\x40\xaf\xea\xf7\x29\x7e\x5d\xf6\x5a\xde\x3f\x50\xea\xbd\xba\xdc\xc5\x4a\xb7\xc8\xb6\x7a\xd3\xd3\xcb\x6e\xf5\x68\x59\x16\xf1\x66\xed\x0e\x67\xd3\xaf\xa6\xfd\x69\xdd\x01\xbe\x61\xb6\xf5\x7f\xb5\x8d\xa6\x7f\xc5\x16\x6a\x29\x4c\x9b\x6f\x1a\xee\x0d\xcb\xd3\x4f\x2c\x85\x4e\x26\x99\x64\xf3\x9c\x0b\x38\x83\x8c\x7c\xde\x78\x1b\x91\xdf\x0a\x35\xdb\x0f\xac\xdb\x02\xdb\x67\x66\xa3\xbb\xf7\x0d\x37\x11\x17\x07\x4b\xdf\x11\xf6\x74\xa9\x3e\x87\x9b\x85\xec\x1b\x69\xba\x54\x17\x7d\x12\x23\x13\xd1\x0e\x62\xc9\x6e\xfe\x17\xa1\x43\xf9\xfa\xad\xe2\xbe\x8b\x9b\x9f\xad\xc9\xff\x02\x00\x00\xff\xff\x81\xbc\xee\x4b\xdc\x15\x00\x00") +var _templateClientTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x57\x4f\x6f\xe3\xb6\x13\x3d\x4b\x9f\x62\x7e\x82\xf7\x07\x29\x50\x68\xa0\x47\x17\x39\xc5\x7b\xc8\x25\xd9\x76\x53\xf4\xb8\x60\xa8\x91\xcc\x46\xa6\xb4\x14\x1d\x3b\x50\xfd\xdd\x0b\x72\xa8\x7f\xfe\x17\x37\xe8\xc9\x16\x29\xbe\x79\xf3\xf8\x38\x1c\xb5\x2d\x64\x98\x4b\x85\x10\x89\x52\xa2\x32\x11\xec\xf7\x61\xd8\xb6\x30\xab\x5f\x0b\x58\xdc\xc1\x0b\x6f\x10\x66\xec\xbe\x52\xb9\x2c\xd8\x37\x2e\x5e\x79\x81\xf6\xa5\xb6\x05\x83\xeb\xba\xe4\x06\x21\x5a\x21\xcf\x50\x47\xb4\xca\x22\xc8\x75\x5d\x69\x03\x71\x18\x44\x65\x55\x44\x61\x18\x44\x16\xf4\x18\x67\xbe\x96\x85\xe6\x06\xa3\x30\x68\x5b\xd0\x5c\x15\x08\xb3\x1f\x29\xcc\x94\x8d\x3e\x63\x8f\x55\x86\x8d\x85\x0c\x08\x41\x9d\x80\xa0\xf1\x61\xc0\x61\xdd\x02\xaa\xcc\x2e\x4c\xc2\x70\x3e\x87\x7b\x97\x1e\xc8\x06\xcc\x0a\x81\x92\x05\xb3\xe2\x06\x56\x55\x99\x35\xc0\xcb\x12\xec\xd0\xcb\x46\x96\x19\xea\x86\x85\xe6\xbd\xc6\x6e\x59\x63\xf4\x46\x18\x68\xc3\x40\xb8\xe8\x61\x30\x9f\xc3\x77\xb1\xc2\x35\x3f\x80\xcc\x2b\x0d\x42\x23\x37\x52\x15\x29\x50\x72\x52\x15\xc0\x55\x06\x99\xae\xea\xda\x3e\x34\x6e\x25\x0b\x03\x0f\x71\xe3\x45\x60\xf4\x7c\x51\x8a\x5b\xa7\xc5\x7c\x0e\x94\xf5\x23\x5f\xdb\x94\x4f\xb0\x90\xca\xa0\xe6\xc2\x45\xdf\x4a\xb3\x72\xf3\xd3\x45\x43\xb2\x41\x30\x9d\xb9\x99\x3c\x92\x0a\x8e\x96\x17\x75\xef\x44\x7d\xc4\xad\x17\xc8\xa5\x8c\x0d\x70\x50\xb8\xed\x58\x90\x56\x1b\x8d\xd9\x40\xa0\x90\x6f\xa8\xa0\xaa\x8d\xac\x54\xc3\xc2\x7c\xa3\xc4\x00\x13\x57\xb5\x69\x80\x31\xf6\xe4\xe6\x13\xb8\xf1\xf0\x56\x78\x2b\x02\x21\xb6\x65\x55\x2c\xa0\xac\x0a\xf6\x4d\x4b\x65\x4a\xb5\x0f\x03\xc1\x3c\xa6\xc3\x60\x8c\x25\x61\xa0\xd1\x6c\xb4\x82\xff\x13\x48\x1b\x06\x7e\xf7\x16\x20\xd2\x30\xf0\xe2\x2f\xa0\x13\xff\x11\xb7\x34\x14\x0b\x96\x69\xf9\x86\x3a\x49\x49\x98\xcb\x7b\x31\x95\x6e\x61\xd3\x39\xa1\x5e\x2c\x3a\x34\x2b\xa1\x5b\xd9\xc9\xf8\xbc\x03\xa2\xda\xe9\x67\x34\x57\x8d\xdd\xba\x4a\xf1\xd2\xab\xe9\xb5\x8a\x45\x27\x4a\x02\xcf\xbb\x58\x98\x9d\x15\xc5\xe0\xce\xd8\x83\x61\x7f\x13\x88\x6f\x9e\x77\x29\xa0\xd6\x95\x4e\xac\x74\x32\x87\x1f\x29\x54\xaf\x4e\x41\x9f\x1a\x8b\x6f\xcc\x6e\x49\x59\xfe\x6a\xe7\xac\x3c\x5e\x30\x25\xcb\x14\xf2\xb5\x61\x5f\x2d\x44\x1e\x47\x5d\x3d\xb0\xd9\x09\xae\x54\x65\x4f\x04\xd7\x06\xf8\x98\xaa\xdb\x64\xa9\xa6\x83\x51\x62\xf3\x0c\x0c\x11\xb2\x0c\x14\x6e\x89\x78\xda\x93\x49\x1c\x47\x3b\xff\xbf\x3b\x1b\xfd\x6a\x32\x8e\x85\x3b\x5e\xe3\x98\x0b\xf8\xf2\x16\xb9\x78\x14\x5c\xe4\xc5\xc8\x3c\x14\x72\x01\x96\x80\x33\x92\x60\x65\x55\xa4\xf0\x86\xfa\xa5\x6a\xd0\x3e\xfb\xbf\xfb\xc1\x42\xcf\xbb\x89\x7d\xf2\xe2\x3f\x75\x46\x5e\x1c\x7b\x23\xb5\x99\x87\x54\x8c\x2f\x45\xb1\x80\xfe\xbc\x2d\xee\xa0\xb6\x07\xa2\x8f\x10\xdd\x0f\x45\xdd\x57\x0c\xff\x2a\x55\x0c\x3e\xae\x17\xc7\xe5\xa1\x2b\x53\xae\x12\x4e\x17\x1f\x15\x44\x7f\x6b\x68\x74\xe7\x74\xa6\xd8\xef\x28\xd0\x0a\x0d\xfb\x7d\xdb\x82\xdd\xde\x9f\x34\x1d\x89\x88\xc6\xdc\x93\xa7\x9c\x43\xf4\x85\xfd\xd2\x44\x7d\xf8\xbf\xa1\xac\xb6\xdd\x6a\x5f\x74\x7c\xc9\x99\x32\x19\x4e\xce\xc5\x5c\x72\x5d\xad\x47\x05\x88\x58\x0f\xf5\x67\x82\x19\x0b\x3f\x9f\x50\x1d\x1c\x82\xb5\x83\x23\x26\x13\x6d\xef\x8c\xee\x4c\xdf\xbb\x82\x38\x66\x47\x03\xbe\xe4\x3a\x96\x13\x86\xa3\xf3\x3d\x81\x4e\x3c\x54\x9c\x1c\x16\x65\x02\x3c\xa0\x74\x30\x3d\x10\x63\xf4\xaf\xe3\xf7\x47\x9d\x4d\xf8\x29\xd8\xd0\xc8\x27\x08\x12\xd6\x11\x41\x1f\xe2\x1c\x41\x9a\xfe\x80\xe0\x93\xfa\x88\xe3\xb0\xa7\xa8\x8c\x34\xef\x1f\xd1\x7c\x52\x18\x77\xe6\x3b\xba\xe8\x4e\xa7\x60\x49\x0c\x59\x08\xd6\x8f\x3e\x2c\x47\x50\xec\x61\x99\x1c\x72\x7f\x58\x5e\xcd\x5e\x66\x57\x30\x7f\x58\xc6\x32\xf3\xdb\xf2\xb0\x64\xcf\xf6\x60\x5e\xc7\xfa\x94\xf6\x4f\xea\x58\xfe\x14\x64\xb6\x00\x99\x75\xdb\xb0\xc4\x12\x27\x3e\xce\x68\xe0\x13\x36\x21\xa8\x23\x9b\xf8\x08\xe7\xa8\xd2\xf4\x59\x9b\xd0\xf4\xc4\x26\xa7\x28\x5e\xef\x92\x1e\xf0\x7a\x97\x0c\x1c\xc6\x2e\xe9\x47\xcf\xb9\x64\xf4\xc2\xb5\xe4\x2f\x99\x64\x1c\xef\x0a\x93\x9c\x22\x7d\x4a\x79\x67\x12\xd6\xed\x1d\xfb\x73\x85\x9a\xa4\x19\x77\xdc\xcc\xc5\x4c\x92\xb3\xd5\xef\xe7\x06\xf5\xfb\x67\x4c\xf3\x9b\x5d\x78\xe4\x19\x37\x7a\x96\xb8\x9b\x3d\xed\x98\xe9\x65\x8a\xfe\xae\xfa\x9a\x15\xf4\x91\x61\x61\x3a\x92\xfd\x6d\x1a\xd7\xbc\x11\xbc\x84\x19\x3a\x2d\x5d\x94\x04\x22\x17\xa5\xbb\x5a\x29\x64\x0b\xc3\xab\xdd\xc5\x63\x33\x97\xd8\xf4\x57\xd2\x30\x83\x59\x81\x50\xe5\xc0\xff\x95\x16\xa7\x82\x7c\x68\xd5\x2e\x27\xba\xc2\x68\x33\x16\x77\x24\xdb\x28\xab\x0b\xda\x05\xcd\x56\x1a\xb1\x1a\xfa\xc7\xa5\xe4\x25\x0a\x13\xbb\x0e\xd3\x7d\x6f\x8d\x84\x6d\x4c\xa5\xad\x33\x5c\xaf\xf2\xdd\x3f\x50\x4f\x24\xec\x07\x65\xdb\xc2\x5f\x95\x54\xfd\x8b\x1d\x5a\x03\x51\x0a\x56\xd3\x05\x75\x4f\xb7\xf4\xe1\x80\x3b\x63\x5b\x80\x99\x82\xa8\x6b\x2b\x22\xdf\x4c\xd8\xad\x8b\xec\x4e\xfa\x8e\xcb\xb5\x5c\x66\x5d\x97\xfd\xfe\xe5\x10\x65\x84\x3e\xff\xd2\xcc\x5d\xee\x73\xdb\x0d\x44\x03\xcd\x7e\xe9\x2d\xec\xfa\x8f\x5a\x42\x61\xa3\x56\xae\x6f\xce\x0e\xba\xf8\xce\x85\x0e\x3b\x74\x2e\xea\x3a\x96\xe1\xef\x68\xf0\x9f\x00\x00\x00\xff\xff\x83\xce\xbd\x6a\x76\x0f\x00\x00") func templateClientTmplBytes() ([]byte, error) { return bindataRead( @@ -229,7 +239,7 @@ func templateClientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/client.tmpl", size: 5596, mode: os.FileMode(420), modTime: time.Unix(1558976196, 0)} + info := bindataFileInfo{name: "template/client.tmpl", size: 3958, mode: os.FileMode(420), modTime: time.Unix(1564245006, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -274,6 +284,26 @@ func templateContextTmpl() (*asset, error) { return a, nil } +var _templateDialectGremlinByTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x54\xc1\x8e\xe3\x36\x0c\x3d\xdb\x5f\x41\x04\x73\x88\x83\xc4\x06\x7a\x2c\x90\xc3\xb6\xc5\x16\x05\x16\x6d\x81\x6e\xdb\x63\x86\xb1\x68\x47\x18\x45\x72\x25\x3a\xdb\x81\xa1\x7f\x5f\x88\x4a\x1c\xef\xec\x2e\x66\x4e\x86\x49\x91\x7c\x24\x1f\xdf\x34\x81\xa2\x4e\x5b\x82\x95\xd2\x68\xa8\xe5\xa6\xf7\x74\x36\xda\x36\xce\x2b\xf2\x2b\xd8\xc5\x58\x16\xd3\xb4\x83\x07\x31\xc0\x8f\x7b\x78\xa8\xff\x6a\xdd\x40\xf5\x1f\x62\x90\x07\xdd\x68\xdb\x35\x7b\xd8\xa8\x60\xea\x8f\x1e\x2f\xe4\x03\x9a\x0a\xa6\xb2\x28\x3a\xe7\xe1\xb0\x85\x2e\x85\x7a\xb4\x3d\x41\xa7\xc9\xa8\x20\xce\x82\x7d\xfd\xd3\xf3\xba\xdb\x42\x8a\x9c\x26\x18\x30\xb4\x68\x6e\xd5\x62\xac\xca\xa2\x88\x65\x11\xcb\x84\x81\xac\x82\x18\xcb\x72\x9a\x9a\x0d\xb4\x63\x60\x77\x86\xa0\x7b\x8b\x3c\x7a\x82\x54\xa8\xf7\x6e\x1c\x76\xc7\x67\x48\x88\x58\x3b\x0b\x9b\x26\xa6\xe0\xef\xf6\x29\x11\xcd\x9c\xe5\xda\x71\xd3\xc0\xaf\xf9\x01\xf4\xc4\x01\xf8\x93\x03\x83\x47\x32\x01\x30\xc0\x80\x1e\xcf\xc4\xe4\x43\x0d\x1f\x4f\xa9\x21\x1f\x18\xc6\x40\x0a\xb4\x05\x3e\x11\x3c\xbe\x0b\x8f\x10\x98\x06\x41\x95\x2c\x83\x27\xa5\x5b\x64\xda\x4a\x76\xb4\x4a\xcc\x81\x5a\x67\x15\xe8\x00\x68\xc1\x0d\x09\x32\x1a\xb0\x78\xa6\x39\xd2\xd2\xff\x7c\x0f\x0f\xb0\x76\x5e\x7c\x06\x99\x3c\x8c\x01\x7b\xaa\xea\xb2\xb8\xe1\x95\x5d\x04\xf6\xda\xf6\x5b\xc8\xdf\x0a\x66\xc3\x8b\x0d\xbd\x18\xeb\x2b\x53\xc2\xb0\x5a\xec\x3b\x30\x7a\xde\xc2\xe1\xd5\x22\xb2\x69\x4f\x3c\x7a\x0b\x9d\xad\xaf\x40\x6f\xf1\x64\x55\xf5\xf5\x82\x5f\x41\x92\x00\x2c\xc9\xd9\xd9\x25\x33\xdf\x8f\xb6\x85\xd9\xf7\x49\xf3\xe9\x7d\xa2\xdc\xf2\xc9\xbf\xb3\xf1\x65\x3f\x09\xc3\x9b\x3a\xd2\x9d\xbc\xdd\xef\x61\xb5\xca\x64\x96\x5f\xf8\x85\x3a\x1c\x0d\x4f\x93\xc0\x8a\xf1\x43\xe2\x4d\xa6\xf1\x6d\x0a\x64\xd5\x16\x0e\x87\xfa\x5d\xc8\x55\xab\x44\x7d\xdd\x2d\xb1\xc6\xf8\xb7\xed\x9c\x51\xeb\xaa\xfe\x07\xcd\x48\x61\x2d\x67\x23\x2f\x73\xde\x75\x35\x4d\x40\x26\x10\xc4\x78\x37\x26\xa0\x1f\x5c\x8b\x46\xbc\x32\xcf\x54\xe6\xdb\x53\x6e\x36\x77\xce\xb5\xce\x06\x46\xcb\xe1\xcb\x43\x52\xb9\x1b\xb8\x08\x88\xfa\x8d\xf7\x24\xc9\xde\xba\x20\x61\xfb\xc2\xfb\x7b\xfa\x9f\xbd\xc3\x53\x9f\x9c\x47\x0c\x04\x0f\xf5\xcf\xce\x76\xba\xaf\xff\xc4\xf6\x09\xfb\xfc\xaa\x69\xbe\x3d\xf2\x74\x54\xe9\x7e\x6e\x1d\xc8\xfd\x7e\x79\x5a\x73\x00\x60\xdf\x7b\xea\x51\x24\xe3\xa6\x1d\xb5\xe4\xfe\x8d\x21\x9c\xdc\x68\x14\x1c\x29\xdf\x38\xe6\xbc\x81\xfd\xd8\xf2\x8e\xb1\x97\x7c\x8a\x5a\xa7\x84\x2c\xce\x03\xc2\x19\x07\x78\xa2\x67\x71\x69\xcb\xe4\x31\xeb\x51\xda\xb0\x84\x67\x2a\x90\x02\x4f\x61\x70\x36\xd0\xb5\x9c\x85\xac\x7d\xec\x12\xbc\xff\x46\xc7\x74\x1d\x51\x8c\xf0\x43\x4a\x7e\x76\x7e\x16\xd1\xa4\x23\x78\x71\x5a\xa5\xfd\x75\x46\xb7\x2c\x10\xc6\x40\x59\x87\x52\x87\x69\x82\x99\x05\x8b\xbf\x3b\x63\x32\xaf\xb6\xb0\xca\x8a\x7a\x48\xb5\x56\xd5\xa3\xa0\x99\x65\x54\x60\x5f\x25\x57\xc0\xe8\x05\x4e\x77\x21\xef\xb5\x22\xd0\x5c\x97\x85\xec\xfe\x3b\x2b\xd9\x7f\xdd\xd3\x82\x92\x9f\x03\x00\x00\xff\xff\x56\xd6\xdf\x2a\x8f\x06\x00\x00") + +func templateDialectGremlinByTmplBytes() ([]byte, error) { + return bindataRead( + _templateDialectGremlinByTmpl, + "template/dialect/gremlin/by.tmpl", + ) +} + +func templateDialectGremlinByTmpl() (*asset, error) { + bytes, err := templateDialectGremlinByTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template/dialect/gremlin/by.tmpl", size: 1679, mode: os.FileMode(420), modTime: time.Unix(1564430374, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _templateDialectGremlinCreateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x56\x4b\x6f\xe3\x36\x10\x3e\x4b\xbf\x62\x6a\x78\x17\x54\xa0\x32\xe9\x35\x85\x0f\xdb\xd4\x8b\x35\xd0\x66\x1f\x49\x73\x59\x04\x01\x43\x8e\xb4\x44\x64\x4a\x4b\x52\xde\x04\x82\xfe\x7b\x31\x94\x6c\xc9\xb2\x5d\xf4\xb5\x27\x8b\xe4\x3c\xbe\xf9\xe6\x1b\xd2\x4d\x03\x0a\x33\x6d\x10\x66\x4a\x8b\x02\xa5\x3f\xcf\x2d\xae\x0b\x6d\xce\xa5\x45\xe1\x71\x06\x6d\x1b\x37\x0d\xcc\x1f\x6b\x5d\x28\xb4\x70\xb9\x80\x4a\x38\x29\x0a\x98\xf3\x1b\x59\x56\xc8\x7f\xe9\x4f\x7a\x43\x8b\x12\xf5\xa6\xb3\xdc\x7d\xef\xdc\xdb\x36\x8e\xb3\xda\x48\x60\x7b\xb6\x6d\x0b\x67\xe3\x2c\x6d\x9b\x40\x0f\xe4\x46\x6c\x90\x49\xff\x0c\xb2\x34\x1e\x9f\x3d\xbf\xea\x7e\x13\x60\xc1\x85\x5f\x8b\x35\x42\xdb\xa6\x80\xd6\x96\x36\x81\x26\x06\x00\xb0\xe8\x08\xc1\xeb\x3e\x0a\xff\x84\xae\x2a\x8d\xc3\xa6\x0d\xc7\x5f\x6b\xb4\x2f\x29\x3c\x6a\xa3\xb4\xc9\x83\xe9\x04\x10\xef\x3d\x59\xc2\x3f\x92\x31\x4b\xe2\x48\x67\x94\xe4\x98\xb1\xb2\xf4\xc5\x97\xcf\x28\x09\x6c\x3a\x4d\x90\x12\xa0\xe4\xe7\xe0\xfe\xc3\x02\x8c\x2e\xa0\x89\xa3\xc8\xa2\xaf\xad\xa1\x65\x80\x1f\x47\xed\x36\x49\x0a\xe5\x13\x25\xd2\xee\xaa\x34\xce\x0b\xe3\x97\x54\x1e\xeb\xc2\x94\x4f\x27\xdd\x03\x27\x9f\x46\xc4\x12\x0b\x63\xa2\x1a\x59\x9a\x4c\xe7\x97\x07\x35\x74\xfb\xed\xb4\xcc\x71\x30\xfe\xd6\x96\xeb\x2d\x95\xec\x6f\x97\xd4\xef\x4d\xa3\xa5\x64\x15\xff\x63\x45\xb0\x04\xce\x94\x2b\xf8\xad\x15\x1b\xb4\x4e\x84\xbc\x4d\xf3\x23\x7c\xd3\xfe\x0b\xf0\xeb\x7a\x1d\x28\xb3\x42\x1b\x4f\x82\x8b\x22\xff\x52\x21\xe9\x67\xbb\xe9\xbc\xad\xa5\x0f\x70\xa3\xca\xa2\x9a\xc6\x3b\x3f\x1f\x5b\x93\x85\x96\xc2\x23\x27\x7b\x8f\xce\x1f\xb1\x0f\xdb\x6b\xe1\xe5\x17\x74\x20\x8c\x02\xed\x5d\x17\x44\x18\x4f\x8e\x84\x63\x08\x1a\x14\xb7\x16\x4f\xc8\x3e\xdf\x9f\x0d\xdb\x29\x5c\xa4\x44\x13\xa7\x7a\xbb\xa2\xd0\xa8\x50\xc4\x86\x3c\x72\xfe\x46\xa9\xbb\xc0\x14\xff\x20\xe4\x93\xc8\xa9\xa3\xfc\x37\xf1\x88\x45\x6f\x6f\x85\xc9\x11\xe6\x0f\x29\xcc\x33\x72\x99\xf3\xb7\x1a\x0b\xe5\x3a\x26\x74\x76\xd0\x76\x72\x9a\x67\xfc\x26\x70\x12\x6c\x89\xfc\x51\x47\x43\x58\x9d\x91\xd1\x1f\x46\x7f\xad\xb1\x0b\xb5\x5f\xce\x02\x44\x55\xa1\x51\x6c\xb4\x99\xc2\xeb\x61\x15\x22\x75\x74\x5f\x42\xce\xef\x58\xc2\xdf\x09\x77\xbc\x94\x14\xa6\xdb\xb4\xce\xf8\x76\x14\x82\x76\xce\x0e\x0b\x39\xac\x23\xe1\x57\x65\x6d\x3c\x4b\xd2\x2e\x3d\xb5\xe9\x12\x1e\x1e\xf8\xca\xb1\x8a\x5f\x2f\x3f\xb2\x8b\x24\xd9\xc5\x65\xd7\xf8\x6d\x69\x6d\x57\x65\x08\xf1\xdd\xf1\xf5\xc0\xa8\xdb\xd1\x5e\xbf\xa3\x68\xc3\x3f\xd8\xb2\x42\xeb\x5f\x18\xc9\xed\x46\x9b\xbc\xc0\xff\x31\x75\x27\xca\x71\xce\x89\x7e\xb0\xd3\xcf\x52\xe5\xd8\xcb\x27\x68\x45\x69\x8b\xd2\xeb\xd2\xd0\xf1\x6c\x65\x66\xa3\x33\x43\x77\x0c\xbd\x11\x56\x1b\x9f\xc1\xec\x95\xe3\xaf\xdc\x6c\x04\x78\x8e\x63\xa8\x71\x14\x65\xa5\x05\xad\xc2\x6b\x11\x32\x1f\x83\x8e\x53\x75\xee\xc9\x12\xf9\xca\xad\x0c\x8d\xe2\x4e\x99\x13\x9c\x0b\x98\xbd\xaf\xfd\x6c\xef\x34\x20\x3d\x04\x8a\xfc\xf6\xa5\xc2\xd3\x70\xa9\x2d\x6f\x94\x5a\x06\x61\x98\xee\x46\x4d\xc2\xb5\xc8\x48\xd4\x5a\x25\x09\x5f\x99\x3b\x36\xf4\xb3\x18\x60\x1d\x73\xbd\x2d\x07\xc7\xf7\xb5\x1f\x7b\xee\x94\x30\x54\xfa\x4e\xb8\xe9\xe5\xf6\xdf\xe6\x70\xd9\xcd\x61\x90\xf5\x3e\x30\x5a\x0c\x14\xb6\x6d\x3f\xb1\xab\x5f\x09\xeb\xbf\x1f\x2b\x52\xd3\x5f\x4d\x95\xd9\x3e\xe7\xc4\xc8\xc9\xe1\x38\x22\xdc\x93\xb7\xbf\xce\xa0\x40\x33\x26\x24\x81\xc5\x02\x2e\x3a\x15\xf5\x6f\xd3\x86\xdf\x89\xa2\xc6\xdf\x45\xc5\xbc\xad\xb1\x1f\x8e\xc8\x87\x67\x70\xe4\xfa\xf9\xe2\x9e\x13\x77\xfc\xaa\x14\x05\x3a\x89\x6c\x72\x48\x54\xa4\x07\xe1\x92\x5e\xe9\x0f\x29\x48\x3b\x88\x7d\xec\xfb\xd3\xe5\x7d\x87\xc8\x5b\x58\x80\xb4\xd3\x34\xb6\x0f\xed\xed\x16\x5c\x0f\xdd\xdb\x78\xa2\xb4\x93\x35\x8d\x38\x0b\xff\xd6\xfa\xef\x3f\x03\x00\x00\xff\xff\xf5\x30\xf6\x67\x07\x0a\x00\x00") func templateDialectGremlinCreateTmplBytes() ([]byte, error) { @@ -294,6 +324,26 @@ func templateDialectGremlinCreateTmpl() (*asset, error) { return a, nil } +var _templateDialectGremlinDecodeTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x94\x41\x6f\x9c\x3c\x10\x86\xcf\xf8\x57\xcc\x87\x50\x04\x11\xeb\xfd\x0e\x55\x0f\x5b\xed\x0d\x45\xe2\xd0\x1c\x92\xb4\x97\xaa\x4a\x5c\x18\x52\x57\xc6\x20\xdb\x8b\x1a\x59\xfe\xef\x95\x0d\xac\xd8\x2d\xca\x56\xed\xa9\x52\x6f\x78\x66\xfc\xce\xcc\x03\x2f\xd6\x42\x8d\x0d\x97\x08\x71\xcd\x99\xc0\xca\x6c\x9f\x15\xb6\x82\xcb\x6d\x8d\x55\x57\xe3\xb6\x93\x18\x83\x73\xc4\x5a\x48\x14\x56\xc8\x07\x54\xb0\xdb\x43\x42\xef\xe6\x93\x73\x84\x6c\xb7\x70\xa3\xba\xf6\x0e\x75\xdf\x49\x8d\xa0\x2b\x26\x35\x98\xaf\x08\x93\x1e\xa8\x39\x55\x33\xc3\x80\x4b\xd3\x81\xd7\xa4\xb7\xac\x45\x70\x8e\x92\xe6\x20\x2b\x48\x4f\xfa\x38\x07\xd7\xcb\xa2\xec\xa4\x49\xaa\x50\xc3\xf5\xa4\x4f\xe7\x68\x06\xa8\x54\xa7\xc0\x92\x68\x68\x59\x9f\xfb\xa3\x1f\x58\xa1\xa6\x77\xc8\xea\x8f\x4c\x1c\xf0\x3d\xeb\xd3\x8c\x44\xbc\x09\xd9\xff\xf6\x20\xb9\xf0\x37\x22\x85\xe6\xa0\xa4\x8f\x92\xc8\x91\xc8\xda\x0d\x24\x7e\x17\xaf\xd0\x2b\x2e\x0d\xc4\x43\x7c\x32\x21\x89\x06\xa6\xc2\x2a\xa1\xce\x39\xd0\x46\x1d\x2a\x13\xe4\xca\x02\x60\x5c\xb3\x2c\xe8\xc3\x4b\xef\x97\x00\x78\xfa\xa6\x3b\xb9\x8b\x79\x9d\x77\x2d\x37\xd8\xf6\xe6\x25\x7e\x22\x51\x64\x2d\x28\x26\x9f\x11\x92\xc7\x1c\x92\x66\xc4\x7c\xc3\x51\xd4\x3a\x34\x8a\xc2\x3c\x3d\xd3\x15\x13\x90\x34\x33\x15\xdf\x80\x37\x3e\x50\xea\x07\x1e\x42\x5c\x9a\xb7\x6f\xac\x05\x14\xda\x1f\x8f\x05\xb7\x07\x21\xd8\x17\xe1\x63\x1e\x2c\xca\x7a\xcc\x26\xcd\x3c\xdd\x31\x3a\x4f\x39\x66\xa7\x56\x3f\x0f\x3c\x16\x07\x58\x13\xcd\xdd\x1e\x3c\x78\x5a\x84\x0f\x28\xbd\x5a\xa0\xc9\xde\x5d\xe4\x7d\xc2\x96\x96\x05\xec\x97\x6c\x69\x59\x90\xcb\x98\xc2\x5b\x5b\xca\x58\xbb\x42\xcd\x0b\x6f\xce\xc1\x19\xde\x22\xfd\x20\xf9\xf7\x74\xd9\x75\x15\x7b\x0e\xff\x67\xb0\x64\xbc\xb9\x70\x61\x41\x6b\x7a\xdc\xf8\xe7\x09\x81\xe4\x82\x04\x9b\x4d\x35\xe4\xb2\x37\x5b\x26\x5f\x7e\xc1\x9c\x61\x13\xc1\x2b\x1c\x53\xf7\x55\xd7\x23\xbd\x0f\x81\x3f\xb2\xae\x9e\x24\x5e\xb5\xee\x5c\xf4\x77\x58\xf7\xd3\xe7\x7f\xe6\xfd\x6d\xf3\x36\x9d\x82\xc7\x1c\x86\xf0\xca\x02\x8a\x25\x5a\x7f\xe1\xfa\xfc\x13\xd9\x03\xeb\x7b\x94\x75\x7a\x9e\xc9\xe1\x6a\xf9\xe3\xf7\x97\xa3\xb2\xd8\xc1\x40\xcb\x22\x1f\x61\x5e\xc2\xbd\xce\x7b\xf7\xba\xeb\x87\xd5\x7f\xc5\x99\xd5\xd7\x8b\x8e\x3c\xe7\xf9\x8e\x0e\x8f\x5c\x16\x00\xad\x3b\xfd\x47\x00\x00\x00\xff\xff\x5e\x9a\x20\xa9\x84\x07\x00\x00") + +func templateDialectGremlinDecodeTmplBytes() ([]byte, error) { + return bindataRead( + _templateDialectGremlinDecodeTmpl, + "template/dialect/gremlin/decode.tmpl", + ) +} + +func templateDialectGremlinDecodeTmpl() (*asset, error) { + bytes, err := templateDialectGremlinDecodeTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template/dialect/gremlin/decode.tmpl", size: 1924, mode: os.FileMode(420), modTime: time.Unix(1564245606, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _templateDialectGremlinDeleteTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x90\x4f\x4b\x2b\x31\x14\xc5\xd7\x93\x4f\x71\x29\xe5\x91\x94\x21\xdd\x3f\x78\x9b\xa7\x82\x0b\x17\xfe\xc3\xad\xa4\xc9\xed\x10\x8c\x99\xf1\x26\x53\x2a\xe1\x7e\x77\xc9\x74\x2c\xd5\x8a\xab\x5c\x92\x73\xce\xfd\x9d\x94\x02\x0e\xb7\x3e\x22\x2c\x9c\x37\x01\x6d\x5e\x77\x84\xaf\xc1\xc7\xb5\xc3\x80\x19\x17\xc0\x2c\x4a\x81\xe5\x66\xf4\xc1\x21\xc1\xdf\x7f\x30\x98\x64\x4d\x80\xa5\x7e\xb0\xfd\x80\xfa\xff\xfc\x32\x0b\x09\x2d\xfa\xdd\x41\x79\x9c\x8f\x76\x66\x21\xb6\x63\xb4\x20\x4f\xb5\xcc\xb0\x3a\x5d\xc2\xac\x60\xe6\xb8\xda\xa3\x95\x36\xef\xc1\xf6\x31\xe3\x3e\xeb\x8b\xc3\xa9\x00\x89\x7a\x82\x22\x1a\xc2\x54\x97\xfd\x99\x1d\xfa\x1e\xd3\xd0\xc7\x84\x85\x45\xf3\x36\x22\xbd\xb7\xb0\xf1\xd1\xf9\xd8\x4d\xba\x2f\x90\xcc\x7a\xb6\x49\xa5\xef\xaa\x58\xaa\x9a\x98\x47\x8a\x67\x4a\x47\x75\xd2\x9f\x48\x2d\x7c\x4b\x6f\x81\x30\x29\xc1\xe2\xa7\x8e\xf0\x4b\x49\xa9\x60\xe5\x52\xd0\x8f\x64\x76\x48\xc9\x84\x5a\x2b\x57\xd8\x4e\x3f\x49\xa5\xaf\x4d\xba\x31\x1b\x0c\x53\xa0\xbe\x35\xf6\xc5\x74\x58\x89\xa6\x5b\x25\x9a\x6d\x4f\xf0\xdc\xc2\x30\x7d\xba\x89\x1d\x9e\xb1\x0f\x84\xce\x5b\x93\x31\xd5\xec\x66\x90\x59\x89\x86\x8f\x55\xb3\xbe\xa4\x7e\x90\x15\xbe\x14\xc0\xe8\x80\xf9\x23\x00\x00\xff\xff\x3a\xf8\xa3\x55\x1d\x02\x00\x00") func templateDialectGremlinDeleteTmplBytes() ([]byte, error) { @@ -314,6 +364,26 @@ func templateDialectGremlinDeleteTmpl() (*asset, error) { return a, nil } +var _templateDialectGremlinErrorsTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x54\x4d\x6f\xe3\x36\x14\x3c\x47\xbf\x62\xa2\xc6\x81\xe4\x0a\x52\x7b\x75\xe1\x93\xeb\xb4\xa7\x20\xfd\xc8\xc9\xf0\x81\x16\x9f\x64\x22\x14\xe5\x90\x94\xd2\x42\xd0\x7f\x5f\x90\x94\xbc\xd9\xc4\xc1\xe6\xb0\x37\x81\x7c\x9c\x79\x33\x6f\xf4\x86\xa1\x58\xa2\xec\x8c\x6d\x1b\x90\xd6\xad\x36\x60\x8a\xcf\x9f\x47\xa6\xb8\x24\x6d\x50\xe9\xb6\x81\x79\x96\xe0\x82\x49\x2a\xad\xc1\xb2\x18\xc7\x68\x18\xc0\xa9\x12\x8a\x10\x4f\x17\x45\xad\xa9\x91\x42\x15\x01\x21\x46\xa8\xba\x39\x3d\xd5\x58\xad\x71\x60\x86\x70\x93\x6f\x5a\x55\x89\x3a\x7f\x60\xe5\x13\xab\xc9\xd5\x44\x45\x81\x4d\xcb\x09\xa2\x39\x49\x6a\x48\x59\x03\x7b\x24\x70\x23\xf3\x7b\x7f\xae\x2c\xe9\x8a\x95\x94\x47\x55\xa7\x4a\x24\x84\xad\xd6\x9b\x56\x19\xab\x99\x50\xf6\x8e\x09\x49\x3c\xf5\x20\x49\x8a\xc4\x58\x2d\x54\x9d\x61\xb7\x3f\xbf\x1c\xc6\x14\x43\x74\xa5\xc9\x76\x5a\xc1\x58\x5d\xb6\xaa\xcf\xff\xea\x5a\x4b\x09\xe5\x27\x4d\x95\xf8\x2f\x49\xf1\x33\x28\x6f\x4c\x9d\x66\x50\x42\x46\x63\x74\xe6\x5b\x5e\x24\x7c\x54\x0d\xd3\xe6\xc8\xe4\x1f\x9a\x9d\x8e\xa6\x55\xc9\x01\xbb\xfd\xe1\x7f\x4b\x69\xb0\xd1\x71\xf6\x4c\xa3\xc7\xee\xd7\xfd\x32\xf4\x15\x5d\x89\xca\xdd\x3a\x4f\xea\xe9\x5d\x7e\x46\x4a\x0e\x19\x6e\xfb\xf4\x37\x5f\x71\xbd\x76\x7d\x38\x90\xb9\x73\xd2\x3a\xba\x1a\x3d\x44\xbf\xfb\x65\x8f\xf5\xbb\x8a\xaa\xb1\xf9\xd6\x71\x57\x49\x3c\xbb\x3f\x8e\x2b\x34\xc2\x18\xa1\x6a\x84\x26\xd0\x33\xd9\x51\x9c\xce\x60\xd7\xe1\xd8\xe4\x7f\x32\xf3\x10\xdc\x58\x3a\x82\x0c\x5f\xdd\x49\x3f\x43\x23\x54\xcf\xa4\xe0\x33\x4d\xd5\xea\xe0\xc4\x0a\x0b\x13\x67\xf0\xa0\x81\xd5\x3b\x8d\x35\x66\xe6\x7f\xb5\x68\x3e\xa4\x3e\x8f\x6e\x9a\x4b\x51\x20\xdc\x21\x9c\x87\xc4\x4c\x47\x9d\x21\xee\x99\xa7\x40\xa2\x74\x93\x63\xca\x9a\x39\x40\x17\xa7\x79\x4e\xc1\xd4\xfb\x30\x61\x23\xde\x06\x05\x31\x02\xf3\x3d\xbd\x6c\xb5\x7e\x54\xe2\xb9\xa3\x3b\x41\x92\xa3\xd4\xc4\x2c\x19\xb0\x40\xe5\x61\xa7\x04\xb8\x3e\x3a\x5f\x8a\xca\xd5\xce\x3d\xbc\x03\x49\x24\x3b\x90\xcc\x42\x15\xe6\x0c\xf7\xf8\x26\xc3\x97\x72\xf8\x2a\xd8\xb7\x17\xae\x87\xc6\xd4\x2b\x3f\xaf\x7f\x4e\x5a\x28\x5b\x25\x71\xa0\x58\x98\x7c\x61\xf0\x22\xec\x31\xa4\x61\x85\xc5\x4f\x7d\x9c\xe1\x75\x1f\x19\xfa\x74\x8c\xde\xcb\xde\xf2\x9a\x3e\xa9\x9a\x78\x4d\x97\x44\x3b\x88\x59\xb3\xab\xc9\x70\x8e\xcd\x8f\xd2\xe9\x60\x5f\xcb\x14\xfc\x8d\xc6\x99\xf7\xac\x51\x98\xcd\x94\x15\x3f\x73\x08\xc5\x45\xe9\x45\x8a\xca\x47\xac\x16\x3d\x29\x68\x32\xa7\x56\x19\xc2\xb1\x95\xdc\x19\xf0\x36\x69\xee\xc3\x32\xa1\x5c\x8e\x98\x0a\xa6\x4c\x1e\xbc\xa1\x48\x34\x96\xd3\xeb\xfc\xef\x09\x36\x45\x72\xc9\x80\x0c\x87\xb6\x95\xfe\x37\x24\xb7\x3d\x2e\xba\x30\x7e\x67\xbf\x68\xc7\xd2\x49\x9b\xff\xce\x2c\xcb\x40\x1f\xae\x1a\x25\x5c\x08\x98\x34\xe4\x7f\xd7\x79\x01\x65\xb0\xba\xa3\xc8\xaf\x76\x52\x1c\xe3\xf8\x25\x00\x00\xff\xff\xa8\x32\x39\x7d\x48\x06\x00\x00") + +func templateDialectGremlinErrorsTmplBytes() ([]byte, error) { + return bindataRead( + _templateDialectGremlinErrorsTmpl, + "template/dialect/gremlin/errors.tmpl", + ) +} + +func templateDialectGremlinErrorsTmpl() (*asset, error) { + bytes, err := templateDialectGremlinErrorsTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template/dialect/gremlin/errors.tmpl", size: 1608, mode: os.FileMode(420), modTime: time.Unix(1564431021, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _templateDialectGremlinGroupTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x54\xcd\x6e\xdc\x2c\x14\x5d\xc3\x53\xdc\xcf\x8a\x3e\x41\x6a\x11\x75\xdb\x6a\x16\x4d\x7f\xb2\x4a\xa5\x66\xda\x6e\xaa\x6a\x44\xe0\x32\xb5\xe4\xc1\x2e\x60\x6b\x22\x8b\x77\xaf\xc0\xcc\xc8\x99\x99\x54\xea\x0a\xb8\x3f\xe7\x9c\xcb\xc1\x9e\x26\xd0\x68\x1a\x8b\x50\xe9\x46\xb6\xa8\xc2\xcd\xd6\xe1\xae\x6d\xec\xcd\xd6\x75\x43\x5f\x41\x8c\x74\x9a\xe0\xea\x71\x68\x5a\x8d\x0e\xde\xac\xa0\x97\x5e\xc9\x16\xae\xc4\x5a\x75\x3d\x8a\xdb\x92\x29\x85\x0e\x15\x36\xe3\x5c\x79\xdc\x1f\xdb\x63\xa4\xd4\x0c\x56\x01\x7b\x56\x1b\x23\x5c\x2f\x59\x62\xe4\x50\x74\xac\x95\xb4\x4c\x85\x3d\xa8\xce\x06\xdc\x07\xf1\x7e\x5e\x6b\x18\xa1\xb1\x01\x9d\x91\x0a\xa7\xc8\x01\x9d\xeb\x1c\x4c\x94\x38\xf4\x89\xfc\xff\x02\x20\x1e\xd0\xf7\x9d\xf5\x38\x45\x4a\x7e\x0f\xe8\x9e\x6a\x78\x6c\xac\x6e\xec\x36\xd7\x9d\x08\x11\xa5\xed\x4b\xaa\x64\x5c\x94\x95\x92\xc6\x24\x8a\x4b\x1d\xda\xa5\x9d\xf8\xb8\x47\x95\x94\xd6\x70\xc2\x52\x83\x43\xcf\xdf\xe6\xf6\xff\x56\x60\x9b\x36\xc9\x24\x0e\xc3\xe0\x6c\x8a\x52\x12\x33\x7e\x8b\xf6\xf4\x5e\x84\x69\xb0\xd5\x9e\xbf\xba\x98\xb3\x9e\xc3\x6a\x05\xaf\x97\x78\x0e\xbd\x78\x40\xa9\xbf\xcb\x96\x8d\x3c\x43\x8f\xbb\xfa\xa0\x7d\x91\x1d\xf0\x5e\xf6\x8b\xc9\x5e\x96\x56\x8e\xe3\x4e\x7c\x40\xd5\x69\x4c\xb8\x91\xfe\xab\x93\xe5\x26\xe1\x5a\xfb\x56\x7c\x75\x72\x44\xe7\x65\xe6\x1b\xa5\x03\x46\x09\x09\xce\xc3\x8f\x9f\x0b\x57\x29\x21\x56\xee\xf0\x2c\xca\x29\x31\x9d\x83\x4d\x0d\xc6\xe6\xa9\xa4\xdd\xe2\x99\x2f\xc6\xfa\x3c\x4d\x82\xa8\x21\xe4\xf9\x8d\x15\x77\xb3\x1c\x56\xf5\x55\x0d\x55\xc5\x0b\xf1\x0a\x64\xdf\xa3\xd5\x2c\x38\x9f\xaa\xf9\x91\xfc\x98\xc9\xc7\x1a\xd2\x32\x5f\xec\x41\xc4\x5f\x34\x64\xfb\x8e\x32\xce\xc1\xcc\x65\xfe\xcd\x46\xbc\xf3\x49\x22\x17\xdf\xac\xe9\x5a\xcd\xb8\xc8\x9e\x79\x66\x78\x4a\x19\xce\x97\xde\xbc\xf0\x8a\xc5\x5d\xfa\x8a\x19\x17\x94\x10\x42\x6e\x9f\xd8\x66\x73\x80\xb9\xac\x54\x08\xc1\xc5\xa7\xcc\xf7\xac\x69\x0e\x89\x7b\x19\xd4\xaf\xa4\x30\xd7\xad\x31\xfd\x31\xe6\x49\x52\xa0\x74\x94\x70\xb2\x79\xe6\x2a\xf1\xcf\xb8\x0f\x2c\xbd\x9c\x69\x02\xb4\x1a\x62\xfc\x13\x00\x00\xff\xff\x26\x8f\xb5\xb6\x7f\x04\x00\x00") func templateDialectGremlinGroupTmplBytes() ([]byte, error) { @@ -334,7 +404,47 @@ func templateDialectGremlinGroupTmpl() (*asset, error) { return a, nil } -var _templateDialectGremlinQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x56\x5d\x4f\xdb\x4a\x10\x7d\xb6\x7f\xc5\x5c\x84\x90\x9d\x6b\x2d\x3c\x5c\xdd\x07\x50\xae\x74\xf9\x68\x1b\x09\x68\x9b\x22\x5e\xaa\xaa\xda\xd8\xe3\xb0\x62\xb3\x6b\x76\xd7\x69\x50\xb4\xff\xbd\xda\x0f\x87\x90\xc6\xe2\x43\x82\x27\x2f\xb3\x73\xe6\x9c\x39\x1e\x0f\x59\x2e\xa1\xc2\x9a\x09\x84\x9d\x8a\x51\x8e\xa5\xd9\x9f\x2a\x9c\x71\x26\xf6\xef\x5a\x54\xf7\x3b\x60\x6d\xba\x5c\xc2\xee\xa4\x65\xbc\x42\x05\x87\x43\x68\xa8\x2e\x29\x87\x5d\xf2\xad\x94\x0d\x92\xe3\x78\x13\x13\x15\x96\xc8\xe6\x21\x73\x75\x5e\xc1\xad\x4d\xd3\xba\x15\x25\x64\x8f\x72\xad\x85\xc1\x3a\x8b\xb5\x39\x44\x1d\xa3\x53\x9d\x95\x66\x01\xa5\x14\x06\x17\x86\x9c\x84\x67\x0e\xd9\xf7\x1f\x0e\x42\x46\xa7\xe4\xea\xbe\x41\xb0\xb6\x00\x54\x4a\xaa\x1c\x96\x69\xa2\x50\x3b\x05\x7b\xb1\x0a\x19\xa3\x6e\xa4\xd0\xb8\xb4\x69\xe2\x3b\x2b\x60\xc2\x44\xc5\xc4\xd4\xe7\x6d\xa8\x21\x11\xf6\xd5\x65\x66\x39\x89\xcf\x34\x61\xb5\xe3\xd8\x86\xa8\x94\x3b\x91\xb3\x05\x96\x4e\x6f\x01\x1b\x2c\x05\x28\xd4\xf9\x91\x87\xff\x35\x04\xc1\xb8\x93\x99\x28\x34\xad\x12\xee\x4f\xaf\x3e\x4d\x6c\x9a\xcc\x51\x19\x56\xa2\x2e\x3a\x2e\x85\x9a\x8c\x91\x56\xd7\xf1\x62\x4d\xc9\x13\xa5\x58\xe5\xdb\x9b\xd1\x5b\xdc\xe6\xd7\x41\x01\x1c\x45\xd6\x11\xe6\x79\x9a\xd4\x52\xc1\xcf\x02\x5c\x08\x17\x9e\x9c\x8a\x29\x42\x97\xe2\x99\x5c\xd5\x21\xd0\xa6\x41\x51\x65\xac\xd2\x5d\xba\xab\x9d\x6d\x90\xb8\x9a\x36\xed\xc4\xf9\x64\xc1\x78\xfa\xe2\x39\xf8\x9f\xf3\xde\x39\xf0\x18\x72\x49\x67\x6f\x3b\x05\xd7\x94\xb7\x78\x41\x9b\xcc\xa8\x16\xdf\x7d\x28\xa8\x72\xe5\x1b\xde\x2a\xff\xf1\x8d\xd7\x3c\x5b\x8f\x7b\x17\xdc\x77\xf6\x58\xd6\x36\x1c\xf9\xa0\xe4\xac\xb3\x24\x7b\xb6\x92\xbe\x6a\xa5\x14\x35\x9b\x6e\xbe\xd0\x18\xce\x57\x23\xd0\x03\x7f\xe5\x58\x9c\xc8\x56\x98\x9e\xc1\x60\xc2\xbc\xdd\x30\x04\xe2\x77\x98\x82\x83\x07\xe7\x63\xa4\x5b\x07\x23\x27\xe0\xe5\x96\x9d\x2d\x98\xee\xb3\x6c\x22\x25\x7f\x3b\xcf\x3e\x51\x7d\x89\x8b\x77\x71\xad\xa6\x5c\x63\xaf\x73\xc7\x52\xf2\xd7\x58\x17\x65\xc3\xa0\xd2\x9c\x5c\x29\x3a\x47\xa5\xa9\xe7\x9d\xbb\x16\xa6\xe4\x3a\x74\x79\x4e\x27\xc8\xc3\x26\xfc\x42\xcb\x5b\x3a\x75\x8b\x89\xf8\x68\xe8\xb9\xc7\xa8\xf5\x46\xe6\xd0\xeb\x27\x39\xe1\x52\x60\x16\x36\x6b\x5c\xd8\xcd\xc3\xae\xde\x44\x35\x0a\x2b\x56\x52\x13\xb7\x77\x93\xcd\x03\x92\xd5\x7e\xfb\x6f\xa6\x4b\x55\xa1\xca\xe1\x3f\x38\x08\x3a\xc8\x67\x17\x70\x6c\xcf\xe0\xf2\x60\x8f\x4b\x1a\xf2\x31\xc8\xf5\x7c\x8e\xd0\xa6\x89\xfe\xc5\x4c\x79\x03\x9c\xcd\x98\x29\x40\xd6\xb5\x46\xb3\xed\xed\xc7\x84\x3f\xca\x7b\xc0\x91\x23\x28\xa9\xc6\x50\xa7\x73\x6d\x6f\xaf\x2b\x18\x02\x87\x5e\xfd\xd8\xe9\xcc\x06\xe1\xa6\x80\x78\x80\xbf\x61\xe0\xc1\x79\xac\xf4\x34\x72\x46\xcd\x0d\xb9\xa0\x8b\x91\x30\xff\xfe\x93\x6f\x11\x10\x50\xe7\x2e\x92\xad\x8a\x07\x9f\x5b\xc1\xee\x5a\xdc\xd6\x68\xb8\x39\xf2\x6f\x22\x9c\x73\x18\x0e\x57\xde\x9f\x62\xd5\x36\xd9\xa3\xff\xa1\xf3\xd4\xff\xd2\x42\x51\x81\xb5\xbf\x03\x00\x00\xff\xff\x1c\xc0\xa1\x1c\xc1\x09\x00\x00") +var _templateDialectGremlinMetaTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x90\xc1\x4a\xc4\x30\x18\x84\xcf\xdb\xa7\x18\x4a\x4f\x8b\xdb\xdc\x85\x3d\x89\x87\x05\xf1\x15\x24\xbb\x99\x76\x03\xe9\x1f\x49\x82\x22\x21\xef\x2e\xe9\x46\x2b\x5e\xbc\x78\xeb\x3f\x33\xdf\x4c\x49\xce\x6a\x8f\x8b\x97\x98\xb4\xa4\x08\x21\x0d\x0d\x26\x1f\x30\x07\x2e\xce\x0a\x8c\xd5\x8e\x97\x14\x47\xec\x55\x29\x5d\xce\x30\x9c\xac\x10\x7d\x73\x54\x4b\xaa\x85\x49\xab\xef\xae\x1e\xa5\x74\xbb\x9c\x11\xb4\xcc\xc4\xf0\x72\x87\x81\xb8\x3f\x62\x18\x1f\xcd\xcc\x88\x52\x72\xc6\xe0\xf4\x99\x6e\x95\x39\x3e\x34\x16\x87\x8a\x56\xd6\x4e\x55\x3f\xc5\x93\xbc\x31\x44\xae\xcc\xe1\x0b\x5a\x99\xe6\xfc\x42\x77\x4a\x61\x6b\x2f\x05\x57\xef\x4c\x44\xba\x12\x31\x05\x2b\x33\x6e\x8e\xa1\xf8\x54\xcf\xea\xe4\x0c\xe7\xdf\x19\x6a\xed\xb3\x5e\xea\x1a\x6c\x1b\xa6\x99\x89\xf4\xf1\x4a\x58\x59\xc3\x46\x27\x7d\xd6\x91\xe3\xed\x47\xe9\x22\xff\x7b\xfb\xcf\x4d\x31\xdb\x4b\x6d\x73\x47\xf4\xf5\xe6\xf8\xd4\x94\xbe\xfb\x99\x6e\x9f\xa5\x74\x9f\x01\x00\x00\xff\xff\x2a\x1e\xb2\xc6\xfc\x01\x00\x00") + +func templateDialectGremlinMetaTmplBytes() ([]byte, error) { + return bindataRead( + _templateDialectGremlinMetaTmpl, + "template/dialect/gremlin/meta.tmpl", + ) +} + +func templateDialectGremlinMetaTmpl() (*asset, error) { + bytes, err := templateDialectGremlinMetaTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template/dialect/gremlin/meta.tmpl", size: 508, mode: os.FileMode(420), modTime: time.Unix(1564435028, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _templateDialectGremlinPredicateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x56\xdf\x6b\xdb\x30\x10\x7e\x76\xfe\x8a\x23\x14\x66\x07\x57\xde\xf3\x20\x0f\xfb\xd1\x6d\x81\xd1\xb2\x75\x74\x0f\xa5\x04\xd5\x3a\x27\xa2\xae\x64\x24\xd9\x7d\x30\xfa\xdf\xc7\x59\x4e\x9c\x5f\x5d\x43\xc3\xb6\xa7\x98\xdc\xa7\xbb\xef\xbe\xfb\x0e\xa9\x6d\x41\x60\x21\x15\xc2\x58\x48\x5e\x62\xee\xb2\x85\xc1\xc7\x52\xaa\xac\x32\x28\x64\xce\x1d\x66\x52\x8c\xe1\xdc\xfb\x51\x54\xd4\x2a\x8f\x1d\x4c\x84\x2d\xd9\x4f\xc3\x1b\x34\x96\x97\x09\xb4\xa3\x28\x72\xec\x2b\xb7\xb3\x4f\xb1\x14\xc9\x28\xf2\xa3\xb6\x3d\x07\x54\x02\xbc\x1f\x8d\x8e\xac\x91\xe9\xca\x86\x3a\x74\xf8\x4c\x57\xf0\x6e\x0a\x67\xec\x3a\xd7\x15\xb2\xab\x6a\x88\x70\xb3\xd8\x0c\xbd\x37\x8b\x17\xd9\xd1\x39\x59\x50\x52\x76\xc3\x8d\xe4\x42\xe6\x44\x2d\x8a\xa2\x86\x52\x3d\xf2\x07\x8c\x6f\xef\xa4\x72\x68\x0a\x9e\x63\xeb\x53\x28\x51\xc5\x6d\x1b\xaa\x79\x9f\x24\x04\x2e\xb4\x01\x49\x07\x0c\x57\x0b\x84\xa6\xcb\x1d\x45\xcd\xad\xbc\x83\x29\x0c\xe8\x5b\x79\x47\x01\xdf\x57\xee\x85\x18\x44\xaa\x18\x61\x75\xc5\xbe\x04\x1d\xc0\x7b\xaa\xb5\xcf\xb0\x61\x8c\xa0\x58\x5a\x04\xef\x87\x02\xf4\x5f\x97\x34\x79\x9d\xda\x85\xc4\x72\x35\xd4\x4e\xd3\x62\x53\xd1\xcf\x14\x3d\x6e\xe2\xf1\x37\x7e\x8f\x65\xda\xf5\x5e\xb0\x8f\x5a\x59\xc7\x95\x03\xef\x53\xa8\xd8\xc5\xf7\xb8\x39\x85\xe0\xe0\x88\x3f\x93\x7c\xde\x2f\xa7\xf1\xdf\x1f\x52\x73\x70\x4a\xfd\x90\x4e\x19\x08\x8a\x05\x66\x4b\xbe\xd5\x2e\x6e\x36\x74\x21\x16\xb8\x11\x2b\x89\x76\x17\xc7\x81\xf5\x10\x16\xd2\x60\xee\xa4\x56\x04\x19\x5f\xd5\x6e\x23\x2f\xf1\x47\x36\xb3\x33\x45\x6a\xf4\x49\x77\x8f\x4d\x61\x3c\x53\xe3\x75\x2c\x9b\x00\x6f\xb4\x14\x90\x4b\x93\xd7\x25\x37\x20\xb0\x42\x25\x30\x97\x68\x61\x92\x0d\x29\x02\xb1\x8e\x57\x5f\x60\x9f\x1e\x29\x73\xcc\xc6\x66\x13\x22\x2b\xdd\x1b\x0b\x5c\x01\x49\x04\x4f\xd2\x2d\xc1\x62\x59\x9c\x1b\x2c\xd0\xa0\xca\x31\x05\xc7\x1f\x10\xdc\x12\xc1\x3d\x69\x68\xd0\x38\x99\x6f\xb3\x0a\x2d\x5f\x63\x59\xfc\xc0\xa2\x5f\x7c\xc7\x3e\x68\xb7\xec\x56\x3c\x70\xf6\x3e\x59\xed\x6b\x58\xb7\x80\x22\xc0\xa0\x8b\xf7\x17\xdb\x47\xf6\xe2\x37\x71\xb2\xb3\xf6\x27\xd8\x81\xda\xfd\x07\x96\x38\x93\x61\x54\xf3\x6d\xd0\xda\x01\xaf\xb5\xcd\xc1\xcc\x5b\xd5\xff\x9b\xb7\x76\x2d\xd1\xf1\x20\x63\x19\x2c\xe0\x11\xb9\xb2\x20\x1d\xd8\xa5\xae\x4b\x01\xf7\x08\xce\xd4\x08\x52\x81\x56\x08\xba\xe8\xdc\xb6\x6e\x69\xcd\x32\x92\x2a\x05\x5d\x3b\x52\x6f\x3e\x67\x33\x75\x13\x27\x29\x7d\x5d\xd5\x2e\xf8\xa2\xbb\x42\xe6\x29\x54\xc3\x2d\x42\x53\xb7\xfd\x4d\x52\xc5\x52\x25\xfd\x97\xae\x5d\xb2\xba\x45\x22\xc7\x7e\x2d\xd1\x60\xdc\xc5\x28\xa1\x09\x9f\x51\x48\xbe\x6b\xca\x00\x96\x2a\x49\xd7\xa8\x99\x3a\x0c\xa2\x32\x01\x15\x7e\x0e\x2d\x81\xe9\x1b\xa2\xf3\xfb\x03\x5d\x79\xfe\xc5\xde\x9c\xd9\x6c\xe8\xa5\xc5\x0a\xf4\x9c\xf9\x4b\x2b\xa6\xcd\xd6\xa3\xc6\x1c\xbe\x23\x8c\x7d\xee\x7d\xf0\x36\x3c\x11\xd6\x09\x6d\xf7\x44\x38\x2c\x41\x00\x04\x1d\x56\xe6\xb8\xc4\xa7\xa0\x5a\x15\x87\x39\x53\xad\x29\xf0\x8a\xbc\x1f\x3b\x63\x53\xe8\xfe\xef\xde\x0d\xa6\x57\x23\x4c\xde\x19\xcb\x18\x7b\xe5\x4d\xa3\xb4\x3b\xa6\xf1\x1d\x96\x3d\xc9\x4d\x22\x97\xda\xc5\x6e\x97\xc4\xef\x00\x00\x00\xff\xff\x6c\xd5\xa9\x59\x50\x0a\x00\x00") + +func templateDialectGremlinPredicateTmplBytes() ([]byte, error) { + return bindataRead( + _templateDialectGremlinPredicateTmpl, + "template/dialect/gremlin/predicate.tmpl", + ) +} + +func templateDialectGremlinPredicateTmpl() (*asset, error) { + bytes, err := templateDialectGremlinPredicateTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template/dialect/gremlin/predicate.tmpl", size: 2640, mode: os.FileMode(420), modTime: time.Unix(1564400962, 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\x6f\xdb\x36\x10\x7e\x96\xfe\x8a\x5b\x11\x14\x92\xe7\x31\x79\x18\xf6\xd0\xc0\x03\x96\xc4\xc3\x0c\xb4\xcd\xe6\x16\x7e\x19\x86\x81\x91\x4e\x32\x51\x9a\x54\x49\xca\x75\x21\xe8\x7f\x1f\xf8\x43\x8e\xec\x58\xb6\x5b\x2c\x79\xb2\x4c\xde\x7d\xdf\xc7\xd3\xc7\xd3\x35\x0d\xe4\x58\x30\x81\xf0\x2a\x67\x94\x63\x66\x2e\x4b\x85\x2b\xce\xc4\xe5\xe7\x1a\xd5\xd7\x57\xd0\xb6\x71\xd3\xc0\xc5\x43\xcd\x78\x8e\x0a\xde\x4c\xa0\xa2\x3a\xa3\x1c\x2e\xc8\x87\x4c\x56\x48\x6e\xc2\x4e\x08\x54\x98\x21\x5b\xfb\xc8\xed\xf3\x36\xbd\x6d\xe3\xb8\xa8\x45\x06\xc9\x4e\x6c\xdb\xc2\xa8\xcf\xd2\xb6\x29\x04\x1d\xb3\x3b\x9d\x64\x66\x03\x99\x14\x06\x37\x86\xdc\xfa\xdf\x14\x92\xbf\xff\xb1\x29\x64\x76\x47\x3e\x7e\xad\x10\xda\x76\x0c\xa8\x94\x54\x29\x34\x71\xa4\x50\x5b\x05\xaf\x03\x0a\x99\xa3\xae\xa4\xd0\xd8\xb4\x71\xe4\x4e\x36\x86\x07\x26\x72\x26\x4a\x17\xb7\xa7\x86\x84\xb4\xbf\x6c\x64\x92\x92\xf0\x1b\x47\xac\xb0\x1c\x87\x32\x72\x65\x9f\xc8\x74\x83\x99\xd5\x3b\x86\x3d\x96\x31\x28\xd4\xe9\xb5\x4b\xff\x61\x02\x82\x71\x2b\x33\x52\x68\x6a\x25\xec\x5f\xa7\x3e\x8e\xda\x38\x5a\xa3\x32\x2c\x43\x3d\xee\xb8\x14\x6a\x32\x47\x9a\x2f\xc2\x46\x4f\xc9\x09\x28\x96\xbb\xe3\xad\xe8\x27\x3c\x54\xaf\xab\x31\x70\x14\x49\x47\x98\xa6\x71\x54\x48\x05\xff\x8e\xc1\x2e\xe1\xc6\x91\x53\x51\x22\x74\x21\x8e\xc9\xa2\x4e\x80\x56\x15\x8a\x3c\x61\xb9\xee\xc2\x2d\x76\xb2\x47\x62\x31\xdb\xb8\x13\xe7\x82\x05\xe3\xf1\x37\xfb\xe0\x37\xce\x07\x7d\xe0\x72\xc8\x7b\xba\x7a\x5e\x17\x2c\x28\xaf\xf1\x1d\xad\x12\xa3\x6a\x7c\x71\x53\x50\x65\xe1\x2b\x5e\x2b\x77\xf9\xe6\xbd\x9a\xf5\xd7\x5d\x15\xec\x3d\xdb\x95\x75\x28\x8f\xfc\xae\xe4\xaa\x2b\x49\x72\xb6\x92\x21\xb4\x4c\x8a\x82\x95\xfb\x2f\x34\x2c\xa7\x5b\x0b\x0c\xa4\x7f\xa7\x2d\x6e\x65\x2d\xcc\x80\x31\x98\x30\xcf\x67\x06\x4f\xfc\x02\x2e\xb8\x7a\xac\x7c\x58\xe9\xda\xc1\xcc\x0a\xf8\xf6\x92\x4d\x37\x4c\x0f\x95\xec\x41\x4a\xfe\x7c\x35\xfb\x83\xea\xf7\xb8\x79\x91\xaa\x15\x94\x6b\x1c\xac\xdc\x8d\x94\xfc\x7b\x4a\x17\x64\xc3\x28\xd7\x9c\x7c\x54\x74\x8d\x4a\x53\xc7\xbb\xb6\x47\x28\xc9\xc2\x9f\xf2\x2d\x7d\x40\xee\x3b\xe1\x9f\x34\xfb\x44\x4b\xdb\x98\x88\x5b\xf5\x67\x1e\x28\x54\xff\x20\x6b\x18\xac\x27\xb9\xe5\x52\x60\xe2\x3b\x6b\x68\xd8\xd5\x63\xaf\xde\xcf\xaa\x14\xe6\x2c\xa3\x26\x74\xef\x2a\x59\xfb\x4c\x56\xb8\xee\xbf\x1f\x2e\x55\x8e\x2a\x85\x5f\xe1\xca\xeb\x20\xf7\x76\xc1\xb2\x9d\xc1\xe5\x92\x5d\x5e\xe0\xb1\x44\x6d\x1c\xe9\x2f\xcc\x64\x4b\xe0\x6c\xc5\xcc\x18\x64\x51\x68\x34\x87\xde\x7a\x08\x78\x02\xeb\x12\xae\x2d\x70\x46\x35\x7a\x9c\xae\x5a\xaf\x5f\x77\x80\x7e\xe1\x8d\x53\x3d\xb7\xfa\x92\x91\xdf\x19\x43\x78\x80\x1f\x61\xe4\x92\xd3\x80\x74\x3a\x73\x45\xcd\x92\xbc\xa3\x9b\x99\x30\xbf\xfc\x9c\x1e\x10\xe0\xb3\xde\xda\x95\x64\x0b\xee\xeb\x5b\x0b\xf6\xb9\xc6\x43\x07\xf5\x3b\xd7\xee\x0d\xf8\xe7\x14\x26\x93\x6d\xcd\xef\x30\xaf\xab\x64\xe7\xdb\xb9\x8e\xdd\x84\x85\x22\x77\x63\x54\xd3\x5c\x8e\xfc\x9d\xb8\xac\xa8\x59\x86\x39\x4e\x83\x59\xa2\x5f\x86\x12\x05\x2a\x6a\x98\x14\x60\x5f\x9c\x8b\x92\x05\x50\x28\xd9\x1a\x05\x60\x5e\x22\x81\xd1\xa5\x1f\xdc\x8e\x8e\x81\x8e\xc1\xcd\x82\x51\xd3\xfc\x04\x17\xee\x44\xdd\x00\x38\xcd\x9d\xbd\xc1\x09\xb2\xec\x16\x18\xbe\x20\x08\xc4\x1c\x8c\x74\x3a\x4a\x45\x0d\xba\x5d\x27\xc3\xc8\xc0\xec\xf1\xfa\x43\x63\x07\xdb\xfb\x36\xc4\x51\x77\x3f\x4e\xf6\x18\x0f\xc8\x0a\xb8\x40\xf2\x01\x79\x31\xc7\xc2\x01\xf8\x6e\xb5\xbd\x67\x93\xee\x46\x93\x1b\x69\x96\x4f\x6e\xaa\xfd\x8f\xb6\x2d\x6a\x43\x85\xb1\x1d\xc0\xe3\x22\xd7\x18\xc0\x67\x7a\x26\xec\xf5\xc7\xe3\xf0\x33\x31\x4d\x3c\x9a\x9d\x87\x8e\x73\x90\xfb\xda\x2c\x92\x3e\xd5\x51\xe8\xfb\xda\x4c\xcf\x50\x4e\x66\xe2\x11\xd4\x7b\xa7\xe7\xa2\xbe\x8d\x0a\x25\x57\xa7\x6d\x44\xbd\x73\xc2\xa6\xcb\xe9\x1c\x25\x64\x7e\xb6\xa3\x6c\x62\xcf\x51\xee\xd5\x5e\xec\xd8\xc8\xa2\x59\x1b\x69\x43\x95\xe9\xe9\xb1\x99\x3b\xee\x79\x69\x37\x9e\xef\x31\xb2\x78\xd2\x5d\x67\x77\xe9\xa3\xe7\xc4\xff\x6c\xba\x01\xbe\xe7\x30\xe1\x00\xd5\xd6\x94\x27\x8e\x76\xcc\x95\xff\x05\x00\x00\xff\xff\x29\x3f\x5f\x1e\x95\x0e\x00\x00") func templateDialectGremlinQueryTmplBytes() ([]byte, error) { return bindataRead( @@ -349,12 +459,12 @@ func templateDialectGremlinQueryTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/query.tmpl", size: 2497, mode: os.FileMode(420), modTime: time.Unix(1563979564, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/query.tmpl", size: 3733, mode: os.FileMode(420), modTime: time.Unix(1564425528, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateDialectGremlinUpdateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x58\xdf\x6f\xdb\x36\x10\x7e\x96\xff\x8a\x9b\xe1\x16\x52\xa0\x31\xe9\x6b\x86\x0c\x58\x53\x77\xf5\xb0\x25\x6d\x93\x75\x0f\x41\x10\xb0\xd2\xc9\x26\x22\x53\x2a\x49\xb9\x29\x0c\xfd\xef\xc3\x91\xd4\x4f\x3b\x69\xd3\xb5\xeb\x4b\x6b\x91\xc7\xef\xbe\xbb\xfb\x78\x24\xb3\xdd\x42\x8a\x99\x90\x08\xd3\x54\xf0\x1c\x13\x73\xb8\x54\xb8\xce\x85\x3c\xac\xca\x94\x1b\x9c\x42\x5d\x4f\xb6\x5b\x98\xbd\xaf\x44\x9e\xa2\x82\xe3\x13\x28\xb9\x4e\x78\x0e\x33\x76\x91\x14\x25\xb2\xe7\x7e\xc6\x1b\x2a\x4c\x50\x6c\x9c\x65\xfb\xbb\x5d\xee\x8d\x0a\x89\x34\xbf\xe2\xfa\xa2\xca\x32\x71\xd7\x19\x4c\xcf\xa5\x73\x3a\xc9\x2a\x99\x40\x38\x80\xac\x6b\x38\xe8\x93\xa9\xeb\x08\x3c\xdf\x0b\xbe\xc1\x30\x31\x77\x90\x14\xd2\xe0\x9d\x61\xa7\xee\xff\x88\x20\x7e\x06\x91\x81\x2c\x8c\x73\x5c\xd7\x57\xd7\xdb\x2d\xa0\x4c\xa1\xae\x2d\x1e\x3b\xe3\x6b\x1a\x8f\x01\x95\x2a\x54\x04\xdb\x49\xa0\x50\x13\xc5\xa7\x1e\x9f\xbd\x45\x5d\x16\x52\xe3\xb6\x9e\x04\x1f\x2a\x54\x9f\x62\x78\x2f\x64\x2a\xe4\xd2\xda\x8d\x78\x32\xbf\xac\x71\xee\x1d\x8f\xad\x44\xda\x12\x89\xd8\x1b\x42\x0d\xa3\x49\x20\x32\xe2\xb1\x0f\x35\x55\xf4\x8b\xcd\xef\x30\xa1\x60\x63\x18\x31\x89\x41\xa1\x8e\x7e\xb1\xcb\x7f\x3a\x01\x29\x72\x0a\x25\x50\x68\x2a\x25\xe9\xd3\x46\x38\x09\xea\xc6\x49\x0c\xc5\x2d\x39\x12\xfa\xb4\x90\xda\x70\x69\xe6\x94\x81\xd0\xc1\x14\xb7\xf7\x2e\xa7\xb8\x66\x4e\x0e\x79\xa5\xac\x1c\xde\x76\x44\xdd\x7c\x17\xf7\x24\x68\x16\x9c\x8c\x0d\x03\x1b\x23\x95\x96\xb2\xdd\xaf\xc6\x36\x29\x64\x26\x96\xc7\x3b\x59\x70\xe3\xde\x09\xe6\xda\x7b\xd8\x70\x05\x2d\xd8\x76\xdb\x11\xf3\x78\x3d\x5f\x1e\x62\xac\x2e\x3f\x1c\x79\x64\x5b\x97\x9d\x72\x90\xdd\x4b\x55\xac\x1b\x41\x84\x5f\x9c\x72\x3f\xd6\xa0\xc4\x34\x3b\x79\xb4\xd2\xc9\xb0\xcb\xac\x48\x2d\x1e\x5b\xbc\x60\x97\x9f\x4a\xaf\x31\xaf\x28\x38\x48\x75\xce\x2e\x15\xdf\xa0\xd2\xdc\xf2\xa2\xb8\x3e\x0a\xb3\x02\x76\x56\xad\x6d\xc9\x15\x17\xd2\xb8\xec\x18\x02\x48\xba\x41\x6d\x54\x95\x18\x1b\x4e\x50\x2a\x4c\xc7\x78\x87\x87\x7d\x6b\xb2\x10\x09\x37\xc8\xc8\xde\xa0\x36\x7b\xec\xed\xf0\x9a\x9b\x64\x85\x1a\xb8\x4c\x41\x18\xed\x40\xb8\x34\xb4\x90\x78\x74\xa0\x76\x6b\xad\xf9\x2d\x86\x57\xd7\x07\xdd\x70\x0c\x47\x31\x85\xcd\x28\xca\x61\xb1\xe8\xf7\xe1\x01\x24\x5c\x23\x14\x19\xb8\x2e\x06\xba\xc4\x44\x64\x22\x81\x0d\x2a\x83\x77\x70\x70\xb8\x57\xa3\x1b\x72\xb7\x64\xef\x42\x91\x46\x2d\xd4\x12\x25\x92\x8e\x3c\x54\x56\x28\x38\xb3\x38\x22\x41\xdd\x43\xea\x09\xb1\x81\x89\xd8\x2b\xae\xff\xe4\xef\x31\xb7\xd5\x65\xaf\x79\x72\xcb\x97\x64\xc5\xec\x68\x34\x09\x02\xc2\xbb\x89\xa1\xb4\xfd\x92\xcb\x25\xee\xc8\xbd\x4d\xac\xf6\xa5\x08\x37\x91\xcb\x54\x3f\x70\x52\x7f\xe8\x24\x2e\x32\x28\xd4\xb8\xc2\x61\x8e\x12\x66\x6c\x9e\x2e\x51\x47\x50\xd7\x6a\x03\x27\xb0\x61\xa7\x79\x21\x31\x8c\x5a\xd1\x90\x0c\x94\x86\xab\xeb\x61\xed\x26\x81\x4f\x88\xa3\x38\xbb\x89\x61\x96\x11\xe5\x19\x7b\x29\x30\x4f\x75\xb3\x53\xc6\xe4\xe9\x3b\x63\x17\x56\x49\xd6\x92\xa4\xdd\xdb\x27\x4d\x0d\x32\xf6\xb7\x14\x1f\x2a\x9f\xc1\x81\x04\x4e\x80\x97\x25\xca\x34\xec\x0d\xc6\xf0\xb4\xfb\xb2\x59\xb1\x0a\x3d\xee\xd2\xbe\x3f\xe3\x31\x8c\x87\x1d\xc1\xa6\xfb\xd9\x6d\x79\xf0\x25\x41\x44\xec\xb4\xa8\xa4\x09\xa3\xd8\x7a\x27\x61\x1f\xc3\xcd\x0d\x5b\xe8\xb0\x64\x67\xf3\x37\xe1\x51\x14\xb5\xb0\xe1\x19\x7e\x9c\x2b\xe5\x42\xb4\x08\xdf\x9d\x9e\xe3\x45\xdb\x63\x20\x93\x60\xc3\x5e\xab\xa2\x44\x65\x3e\x85\x54\xe1\x0b\x21\x97\x39\x7e\x43\xbf\x93\xb1\x30\x47\xaa\x41\xa7\x1a\xab\xc3\xde\xc9\x90\x0a\x85\x89\x11\x85\xa4\xe9\xe9\x42\x4e\x7b\x73\x92\xfa\x37\x9d\x34\x4a\x48\x93\xc1\xf4\x89\x66\x4f\xf4\xb4\xc7\x77\x86\x7d\xa6\x3d\x55\x21\x5b\xe8\x85\x24\x09\x37\xc2\x1a\x39\x3b\x81\xe9\x79\x65\xa6\xfd\x49\xeb\x6d\xd7\x19\xda\xfe\xfa\xb0\xcb\x36\xc9\xbe\x75\x28\x5c\x17\x1b\x04\xb4\xb1\xba\x4e\xd1\xa3\xd6\x17\xfc\x9e\x9d\x93\xe4\xc8\x15\xd2\x05\xa1\xb9\x70\x61\x73\x92\xb5\x3b\xa7\xeb\x39\xd4\x46\x44\x7a\x7f\x13\x71\x54\x3e\x83\xd6\xa7\xef\x38\x5e\x60\x9e\xbd\xc5\xcc\xe7\xc7\xb8\x5b\x5d\xdb\x35\xd8\xf3\xc2\xac\xe6\x56\xca\xd2\x61\x45\xae\xfd\xd8\xbb\x56\x2f\x42\xf6\xcf\x0a\x15\x86\x37\x37\xec\x5c\xd1\xbf\x0b\xe9\x77\xe9\xe2\x05\xf5\xda\x98\x36\xce\x79\x65\x06\x83\x51\xd7\x94\xd8\x0b\x55\x94\x61\xc4\x16\x06\x15\x37\x18\x46\xfd\xf0\xf7\xd7\x79\x87\xea\x42\x3e\x92\xa8\x59\xa1\x1a\x12\xfa\x32\x3e\xf7\xf8\x3f\xaf\xcc\xff\x40\xa0\xa9\xa0\x6d\xe2\x6d\xe3\x34\x4a\xc7\x60\x94\x3f\x35\x1a\x75\xfa\x03\x6d\xa0\xce\xcf\xc9\x88\xbe\x71\xdc\xce\xb7\x0f\xee\xb8\x0d\xfb\x2d\x4d\x87\xa1\xdb\xfb\x53\xe8\x0f\xda\xc8\xa9\x61\x37\x85\xfb\x16\x5e\x16\xdd\x32\x27\x98\xfb\xb5\xfb\x8a\xeb\xf1\x0d\xe7\x5e\x65\x7f\xcd\x81\xe3\x4f\x9c\xd1\x76\x18\xf2\x1d\x9c\x11\x8f\x39\x24\xa8\x3f\x3e\x74\x46\xc8\xe6\xc5\x42\xa9\x70\xf0\xb6\xd7\xff\x97\x48\x96\x6c\x3e\xbe\xb2\xb4\x81\x7c\xd5\x06\xfe\x01\xe1\x8f\x34\xf4\x9d\xb2\x41\x1f\xdd\x21\x52\xd7\x83\xb8\x7f\x54\xd4\xfd\x1d\xd0\x7e\x8c\x6f\x89\xec\x1d\xcf\x2b\xfc\x8b\x97\xa1\x51\x15\x46\x9f\x79\x11\x88\x0c\x72\x94\xfd\x7c\x45\xf0\x2b\x1c\xb9\x7b\xa8\x6f\x23\x74\x3d\x07\x5d\x29\x04\xb3\x42\x30\xed\x6d\x3f\x2d\x50\xdb\xf6\x46\x2f\x72\x2e\x24\xac\x0b\x6b\xc3\x25\xd0\x85\xdb\xdf\xc4\x45\x06\x1f\x11\x56\x7c\x33\x78\x79\xf8\x6e\x14\xec\x3e\xdd\xbf\xc1\x66\x7d\xa0\x3a\xbf\x5f\x86\xcf\xfa\xc5\x79\x3a\x57\xaa\xcb\xc9\x4b\x2e\x72\x4c\xb7\x6b\xbd\x3c\x86\xa9\xef\x9e\x5d\xbc\x3e\x4c\xbd\x37\xce\x69\x7d\x7f\xbd\x02\xba\x89\xf7\xd8\x5f\x1d\x5d\xdb\x3b\x3f\x3b\x2d\x78\x8e\x3a\xc1\x70\x34\x49\x9c\x63\xb0\x8f\x80\xe6\xf9\x90\xa8\xae\x67\xf7\xad\x9f\x1d\x5f\xbb\x62\x39\x27\x6a\x0c\xac\x06\x60\x7b\x04\xb3\x7b\x8e\x90\xa9\x7f\xc9\xd2\x05\xf2\x8f\x42\x48\x9a\x60\x8c\x45\x13\xfb\xd7\x1d\xbf\xf4\xdf\x00\x00\x00\xff\xff\x33\x13\xe2\x0e\x5c\x12\x00\x00") +var _templateDialectGremlinUpdateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x58\xdf\x6f\xdb\xb6\x13\x7f\xb6\xff\x8a\xfb\x1a\x6e\x21\x05\xfa\x32\xe9\x6b\x86\x0c\x58\x53\x77\xf5\xb0\x25\x6d\x92\x75\x0f\x45\x10\xb0\xd2\xc9\x26\x22\x53\x2a\x49\xa9\xe9\x0c\xfd\xef\xc3\x91\xd4\x4f\x3b\x69\xd3\xae\xeb\x4b\x6b\x91\xc7\xbb\xcf\xe7\x7e\xf1\x98\xed\x16\x12\x4c\x85\x44\x98\x25\x82\x67\x18\x9b\xc3\x95\xc2\x4d\x26\xe4\x61\x59\x24\xdc\xe0\x0c\xea\x7a\xba\xdd\xc2\xfc\x7d\x29\xb2\x04\x15\x1c\x9f\x40\xc1\x75\xcc\x33\x98\xb3\xcb\x38\x2f\x90\x3d\xf7\x3b\x5e\x50\x61\x8c\xa2\x72\x92\xed\xef\xf6\xb8\x17\xca\x25\xd2\xfe\x9a\xeb\xcb\x32\x4d\xc5\x5d\x27\x30\x3b\x97\x9d\xd1\xbf\x51\xe5\x24\x77\x04\x75\xbd\xdd\x82\x48\xdd\x49\xfb\xe1\x36\x4f\x60\x26\x45\x36\x73\x4b\x28\x13\x3a\x39\x4d\x4b\x19\x43\x30\x00\x53\xd7\x70\xd0\xa7\x51\xd7\x21\x78\xa6\x97\xbc\xc2\x20\x36\x77\x10\xe7\xd2\xe0\x9d\x61\xa7\xee\xff\x90\x54\xfc\xbf\x67\xd4\x2a\x60\x67\x7c\xe3\x11\x60\xa6\xe9\x97\x90\xa6\xb5\x1d\x01\x2a\x95\xab\x10\xb6\xd3\x89\x42\x4d\xd8\x9f\x7a\x33\xec\x02\x75\x91\x4b\x8d\xdb\x7a\x3a\xf9\x50\xa2\xfa\x14\xc1\x7b\x21\x13\x21\x57\x56\x6e\x04\x97\xf9\x63\x23\x0c\x63\x29\x91\xb4\xb6\x43\xf6\x86\xb4\x06\xe1\x74\x22\x52\xc2\xb1\x4f\x6b\xa2\xe8\x17\x5b\xdc\x61\x4c\x9c\x23\x18\x21\x89\x40\xa1\x0e\x7f\xb2\xc7\xff\x77\x02\x52\x64\x44\x65\xa2\xd0\x94\x4a\x42\xeb\x76\xcf\x74\x3a\xa9\x1b\x63\x11\xe4\xb7\x64\x50\xe8\xd3\x5c\x6a\xc3\xa5\x59\x90\x27\x02\xa7\x2e\xbf\xfd\xac\x9a\x21\xcf\xe9\xc4\x2e\xcc\x2d\x89\x39\xbb\xe8\x28\xd8\x1d\xda\xa8\x6b\xeb\xde\x41\x50\xe2\x5c\xa6\x62\x75\xbc\x43\xdb\xad\xd3\xd9\x91\x6b\x68\xf3\xa5\xca\x37\x4d\x70\x82\xbd\xf4\x1b\xe0\x52\x64\x1e\x30\x21\xee\xd3\x51\x96\x8b\x14\x99\x23\xe2\x53\xa3\x93\x51\xa8\xd9\x05\xf2\x64\x29\x0d\x05\xc8\xca\xb8\x6c\x7d\x74\xbe\x06\x83\x4a\x10\x89\xb5\xcf\x96\x2f\xd8\xd5\xa7\x02\xfb\x85\x10\xc2\x41\xa2\x33\x76\xa5\x78\x85\x4a\x73\x4b\x85\x0c\x7f\x14\x66\x0d\xec\xac\xdc\xd8\x48\x29\x2e\xa4\x71\x58\x0d\x29\x88\xbb\x45\x6d\x54\x19\x1b\xe7\x81\x42\x61\x32\xd6\x77\x78\xd8\x97\x26\x09\x11\x73\x83\x8c\xe4\x0d\x6a\xb3\x47\xde\x2e\x6f\xb8\x89\xd7\xa8\x81\xcb\x04\x84\xd1\x4e\x09\x97\x86\x79\xbf\x76\x4a\x6d\x65\x6c\xf8\x2d\x06\xef\xae\x0f\xba\xe5\x08\x8e\x22\xa2\xcd\x88\xe5\xc0\x9b\xf6\xf7\xe1\x01\xc4\x5c\x23\xe4\x29\xb8\x2e\x06\xba\xc0\x58\xa4\x22\x86\x0a\x95\xc1\x3b\x38\x38\xac\xf7\xa5\x5c\x45\xe6\x56\xec\x6d\x20\x92\xb0\x55\xb5\x42\x89\x8a\x67\x8d\xaa\x34\x57\x70\x66\xf5\x88\x18\x75\x4f\x53\x17\xf3\x56\x4d\xc8\x5e\x71\xfd\x3b\x7f\x8f\x99\x8d\x2e\x7b\xcd\xe3\x5b\xbe\x22\x29\x66\x57\xc3\xe9\x64\x42\xfa\x6e\x22\x28\x6c\xbf\xe4\x72\x85\x3b\xc9\xdb\x3a\x56\xfb\x50\x04\x55\xe8\x3c\xd5\x27\x5e\x71\x05\x81\x2b\x0e\x91\x42\xae\xc6\x11\x0e\x32\x94\x30\x67\x8b\x64\x85\x3a\x84\xba\x56\x15\x9c\x40\xc5\x4e\xb3\x5c\x62\x10\x76\xdd\x73\x32\x31\x4a\xc3\xbb\xeb\x61\xec\xa6\x13\xef\x10\x07\x71\x7e\x13\xc1\x3c\x75\xb5\xf9\x52\x60\x96\x68\x7b\x54\xa4\x3b\xe0\xe9\x3b\x65\x97\x36\x93\xac\x24\xa5\x76\xaf\xb4\x9a\x18\xa4\xec\x4f\x29\x3e\x94\xde\x83\x83\x14\x38\x01\x5e\x14\x28\x93\xa0\xb7\x18\xc1\xd3\xee\xcb\x7a\xc5\x66\xe8\x71\xe7\xf6\xfd\x1e\x8f\x60\xbc\xec\x00\x36\x4d\xcb\x96\xf1\xc1\x97\x90\x08\xd9\x69\x5e\x52\x35\x47\xd6\x3a\x25\xf6\x31\xdc\xdc\xb0\xa5\x0e\x0a\x76\xb6\x78\x13\x1c\x85\x61\xab\x36\x38\xc3\x8f\x0b\xa5\x1c\x45\xab\xe1\xbb\xc3\x73\xb8\xa8\x3c\x06\x69\x32\xa9\xd8\x6b\x95\x17\xa8\xcc\xa7\x80\x22\x7c\x29\xe4\x2a\xc3\x7f\xd1\xee\x74\x9c\x98\xa3\xac\x41\x97\x35\x36\x0f\x7b\x8d\x3e\x11\x0a\x63\x23\x72\x49\xdb\xb3\xa5\x9c\xf5\xf6\x24\x75\x77\x1a\x3c\x94\x90\x26\x85\xd9\x13\xcd\x9e\xe8\x59\x0f\xef\x1c\xfb\x48\x7b\x59\x85\x6c\xa9\x97\x92\x52\xb8\x49\xac\x91\xb1\x13\x98\x9d\x97\x66\xd6\xdf\xb4\xd6\x76\x8d\xa1\xed\xaf\x0f\x9b\x6c\x9d\xec\x5b\x87\xc2\x4d\x5e\x21\xa0\xe5\xea\x3a\x45\x0f\x5a\x3f\xe1\xf7\x54\x4e\x9c\x21\x57\x48\xf7\x7b\x33\x70\x61\x73\xcf\xb5\x95\xd3\xf5\x1c\x6a\x23\x22\xb9\xbf\x89\x38\x28\x9f\xd1\xd6\x87\xef\x30\x5e\x62\x96\x5e\x60\xea\xfd\x63\xdc\x54\xd7\x76\x0d\xf6\x3c\x37\xeb\x85\x4d\x65\xe9\x74\x85\xae\xfd\xc8\xdc\x0c\x18\xb2\xbf\xd6\xa8\x30\xb8\xb9\x61\xe7\x8a\xfe\x5d\x4a\x5f\xa5\xcb\x17\xd4\x6b\x23\x2a\x9c\xf3\xd2\x0c\x16\xc3\xae\x29\xb1\x17\x2a\x2f\x82\x90\x2d\x0d\x2a\x6e\x30\x08\xfb\xf4\xf7\xc7\x79\x07\xea\x52\x3e\x12\xa8\x59\xa3\x1a\x02\xfa\x32\x3c\xf7\xd8\x3f\x2f\xcd\x7f\x00\xa0\x89\xa0\x6d\xe2\x6d\xe3\x34\x4a\x47\x60\x94\xbf\x35\x9a\xec\xf4\x17\xda\x20\x3b\x3f\x97\x46\xf4\x8d\xe3\x76\xbe\x7d\xb0\xe2\x2a\xf6\x4b\x92\x0c\xa9\xdb\x91\x2b\xf0\x17\x6d\xe8\xb2\x61\xd7\x85\xfb\x0e\x5e\xe5\xdd\x31\x97\x30\xf7\xe7\xee\x2b\xae\xc7\x13\xce\xbd\x99\xfd\x35\x17\x8e\xbf\x71\x46\xe5\x30\xc4\x3b\xb8\x23\x1e\x73\x49\x50\x7f\x7c\xe8\x8e\xf0\x16\x22\x20\x57\x38\xf5\xb6\xd7\x7f\x0b\x93\x15\x5b\x8c\x47\x96\x96\xc8\x57\x15\xf0\x0f\xa0\x3f\xca\xa1\xef\xe4\x0d\xfa\xe8\x2e\x91\xba\x1e\xf0\xfe\x51\xac\xfb\x15\xd0\x7e\xec\x5c\xc6\xbd\x89\xb7\x62\x6f\x79\x56\xe2\x1f\xbc\x08\x8c\x2a\x31\xec\xde\xb4\x55\xc3\xa1\x37\x17\x3e\xf8\x74\x10\x29\x64\x28\xfb\x8e\x0d\xe1\x67\x38\x72\x03\xab\xef\x37\x34\xc7\x83\x2e\x15\x82\x59\x23\x98\xf6\x59\x90\xe4\xa8\x6d\x1f\xa4\x07\x38\x17\x12\x36\xb9\x95\xe1\x12\x08\xa7\x1f\xd9\x45\x0a\x1f\x11\xd6\xbc\x1a\x3c\x51\x7c\xdb\x6a\xea\xda\x76\xd3\x76\x9c\xff\xd6\xaa\x7e\x20\x8c\xbf\x5e\x05\xcf\xfa\x51\x7c\xba\x50\xaa\xf3\xc9\x4b\x2e\x32\x4c\xb6\x1b\xbd\x3a\x86\x99\x6f\xb3\x1d\x5f\x4f\x53\xef\xe5\x39\xab\xef\x0f\xec\x84\x46\xf6\x1e\xfa\x77\x47\xd7\xf6\x71\xc0\x4e\x73\x9e\xa1\x8e\x31\x18\x6d\x12\xe6\x08\xec\x6b\xa1\x79\x67\xc4\xaa\x6b\xee\x7d\xe9\x67\xc7\xd7\x2e\x58\xce\x88\x1a\x2b\x56\x03\x65\x7b\x32\x6b\xf7\xc2\x21\x51\xff\xfc\xa5\x49\xf3\xb7\x5c\x48\xda\x60\x8c\x85\x53\xfb\xf7\x1d\x7f\xf4\x9f\x00\x00\x00\xff\xff\x51\x89\x59\x59\x85\x12\x00\x00") func templateDialectGremlinUpdateTmplBytes() ([]byte, error) { return bindataRead( @@ -369,7 +479,27 @@ func templateDialectGremlinUpdateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/update.tmpl", size: 4700, mode: os.FileMode(420), modTime: time.Unix(1563979564, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/update.tmpl", size: 4741, mode: os.FileMode(420), modTime: time.Unix(1564232679, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _templateDialectSqlByTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x92\x31\x6b\xfb\x30\x10\xc5\x67\xe9\x53\x1c\x26\x83\x6d\x12\x7b\xff\xc3\x7f\x48\x0b\x99\x52\x4a\xf0\xd0\xb1\xa8\xf6\x49\x11\x38\x92\x23\xc9\x0d\x41\xe8\xbb\x17\xc9\xad\x9b\x26\x25\xd4\x93\xd1\xdd\xd3\xef\xdd\x3b\x79\x0f\x1d\x72\xa9\x10\xb2\x4e\xb2\x1e\x5b\x57\xdb\x63\x5f\x6b\xd3\xa1\xc9\x60\x15\x02\x25\xde\xaf\x60\xc1\xe1\xdf\x7f\x58\x54\x4d\xab\x07\xac\x36\xa3\x6a\xa7\x1a\x1f\x55\x9b\x5b\x28\xed\xb1\xaf\x1a\x8c\x72\x6d\x0a\xf0\x94\x10\xae\x0d\xbc\x2e\x21\xe9\x0c\x53\x02\x81\x4b\xec\x3b\x9b\x8a\xc4\x56\xcf\x91\xf0\x70\xce\xa3\xd2\xfb\x08\x08\x21\xe7\x45\x41\x09\x09\x94\x04\x1a\xa9\xa8\x3a\x08\x81\x52\xef\xeb\x12\xda\xd1\x3a\x7d\x00\x2b\x85\x62\x6e\x34\x08\x91\x20\x8c\x1e\x87\xd5\xdb\x19\xa2\x11\x27\xb5\x82\xb2\x0e\x51\xfc\xeb\x54\xa9\xbb\x9e\x6f\xf8\x9c\xaf\xae\xa1\xd9\x6d\xc1\xed\x11\x5a\xdd\x8f\x07\x05\x27\xc3\x86\x01\x3b\x38\x49\xb7\x4f\xe7\x4c\x08\x83\x82\x25\xc0\x17\xa9\xa2\x24\xca\xe2\x97\x52\xb8\xca\xc0\x3a\x23\x95\xb8\x1a\xe3\x8e\x2b\x66\xb3\x7b\x91\x4e\xd7\x4d\xe1\x19\x74\xa3\x51\x10\x1b\xd6\x36\xe7\xaa\x6a\x76\xdb\xdc\x16\xcb\x08\x2a\x6e\xb3\xbb\x03\x8d\xac\x1f\x5b\x56\x37\x6b\x9e\x6b\x31\x8c\x4d\x5c\xe1\x65\xcb\xcb\x7c\xf8\x27\xeb\x17\xce\xbd\x07\xc9\x01\x8f\x09\x9a\x3d\x21\x53\x19\x84\xb0\x7e\x17\xde\x03\xf6\x16\x21\x84\xf4\x2c\xd4\xf4\x33\x8d\x93\x4f\xaa\x0b\x2f\x21\xd8\xea\x31\x4f\x4f\xab\xf8\x56\x66\x65\x36\x6b\xae\x12\xf9\x08\x00\x00\xff\xff\x4b\x3b\xbc\x12\xf1\x02\x00\x00") + +func templateDialectSqlByTmplBytes() ([]byte, error) { + return bindataRead( + _templateDialectSqlByTmpl, + "template/dialect/sql/by.tmpl", + ) +} + +func templateDialectSqlByTmpl() (*asset, error) { + bytes, err := templateDialectSqlByTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template/dialect/sql/by.tmpl", size: 753, mode: os.FileMode(420), modTime: time.Unix(1564430114, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -394,6 +524,26 @@ func templateDialectSqlCreateTmpl() (*asset, error) { return a, nil } +var _templateDialectSqlDecodeTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x55\xcb\x6e\xdb\x3a\x10\x5d\x4b\x5f\x31\xd7\x50\x2e\xa4\x20\xa5\xf6\x29\xbc\xaa\x11\x40\x9b\xb4\x88\x83\x6e\x1b\x46\x1a\x25\x44\x69\x52\x21\x69\xa7\x01\xcb\x7f\x2f\x48\x49\x31\xe5\x38\xb1\xd0\xee\xf8\x18\xce\x9c\x73\xe6\x41\x6b\xa1\xc1\x96\x09\x84\x45\xc3\x28\xc7\xda\x94\xfa\x89\x97\x0d\xd6\xb2\xc1\x52\x0a\x5c\x80\x73\xa9\xb5\x90\x29\xac\x91\xed\x50\xc1\xe5\x12\x32\x72\x33\xee\x9c\x4b\xd3\xb2\x84\x2b\x25\x37\x37\xf2\x59\x83\xae\xa9\xd0\x60\x1e\x11\xf4\x13\x07\x85\xba\x93\x42\x23\x34\xd4\x50\x60\xc2\x48\xf0\xbe\xc8\x35\xdd\x20\x38\x47\xd2\x76\x2b\x6a\xc8\x27\xfe\x9d\x83\xf3\xd8\xa8\x78\x75\x9e\x2b\x1f\xe1\x5c\x3f\x71\xe2\xb7\x05\xa0\x52\x52\x81\x4d\x13\x6b\x3f\x41\xe6\x43\x7b\x74\x9d\x62\xc2\xc0\x62\xb7\x98\x38\x4d\x93\x1d\x55\x21\x7a\xb0\x73\x0e\xb4\x51\xdb\xda\xf8\xe7\x49\xb5\x02\xf0\x77\xac\x85\x8c\x54\x2b\x52\xe9\xb5\x51\x4c\x3c\x80\x73\x4c\x18\x6b\x01\xb9\xf6\x58\x02\xae\x6a\x45\x6e\x5f\xba\x61\x8b\xa2\x09\xce\x13\x6b\x41\x51\xf1\x80\x90\xfd\xb8\x80\xac\xed\x65\xba\x62\xc8\x1b\xdd\x1b\x04\x90\x1d\xd5\x35\xe5\x90\xb5\x23\xbb\x21\xaa\x54\xe1\x6c\xcb\x39\xbd\xe7\xe8\xd7\x5f\x3b\xc3\xa4\xa0\x7c\x88\xda\x5f\x46\x71\xf7\x80\xda\x77\xe0\x8c\x6b\x97\x26\x65\x19\x52\x22\x55\x83\x0a\x1e\x51\x21\xe8\x47\xb9\xe5\x0d\xdc\x63\x9f\x2b\x0f\x86\x6a\x60\x22\x6c\xef\x02\xcf\x6f\xb4\xfe\x49\x1f\x42\x9e\xbe\x48\xbe\xdd\x08\x7d\x47\xd2\x84\xb5\x5e\x76\x4f\xcf\x67\x83\xac\x6b\x2a\x72\xcf\xee\xff\x48\x5a\x52\xad\x2e\x46\xc6\x27\x44\x99\xbe\x3b\x2a\xd1\xab\xab\x91\x50\xf1\x39\x40\xf8\x6f\x09\x82\xf1\x90\x3f\x85\x66\xab\x84\x3f\x0d\x74\x0f\xea\x89\x54\x2b\x58\xbe\x93\x5e\x6d\x54\x2d\xc5\x8e\x54\x46\xd2\x7c\x4a\xa1\x98\xca\xbc\xbf\x88\xb4\x3d\xcd\xd0\x5b\xf8\xb8\x51\x76\xf7\xe5\xd0\x5f\x54\xfa\x96\x6d\xc6\xe3\x37\xe0\xad\x3d\x52\x35\x4b\x38\xd0\xed\xad\xcd\xab\x6a\x3d\x85\xe0\x9b\xb5\x70\x52\x6e\xf2\x9d\x72\xd6\x04\x59\xe7\xa3\x11\xf8\x9c\x4f\x6a\xb1\xe8\x9f\x9f\xcf\x7c\xef\x8f\x7d\xdb\xb6\xb0\x38\xd3\xe4\x4c\x2f\x06\x90\xf9\xd4\xb8\x80\xdf\x71\x2b\x04\x9d\x47\x6e\xee\xb0\x4c\xf6\xec\x7b\x99\xa3\x8e\x4a\xe7\x33\xfb\x67\x64\x07\x39\x98\x1f\xf6\x54\x76\x63\xae\xf1\x7a\x68\x06\xc1\x78\x1a\x46\xf7\x70\x9e\x7e\x3c\xeb\x37\x54\xbc\xcc\x18\xf6\x01\x17\x67\x35\xf6\x57\xeb\x5a\x76\x48\xd6\xe1\xe0\xaf\xbe\x02\x3d\x3c\xfd\xf0\x2b\x18\x8d\xe6\x7c\x05\xad\x54\xfd\x64\xba\xc6\x5f\x26\x2f\x42\x1d\xcf\xfa\x1e\x92\xf8\x6f\xb8\x1c\x1a\x6c\x94\xdb\x7a\x83\xfd\xe8\x8b\xb3\x33\x81\xf4\x76\x34\x4d\x66\x53\x28\xd2\xc3\x9e\x80\x25\xd0\xae\x43\xd1\xe4\x87\x37\x17\x71\xa0\x22\x8c\xb6\xe3\xc9\xfd\x13\x00\x00\xff\xff\x07\xc9\x26\x4a\xc7\x07\x00\x00") + +func templateDialectSqlDecodeTmplBytes() ([]byte, error) { + return bindataRead( + _templateDialectSqlDecodeTmpl, + "template/dialect/sql/decode.tmpl", + ) +} + +func templateDialectSqlDecodeTmpl() (*asset, error) { + bytes, err := templateDialectSqlDecodeTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template/dialect/sql/decode.tmpl", size: 1991, mode: os.FileMode(420), modTime: time.Unix(1564245687, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _templateDialectSqlDeleteTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x91\x4d\x6b\xf3\x30\x10\x84\xcf\xd2\xaf\x58\x42\x78\xb1\x5e\x8c\x72\x2f\xf4\xd2\xaf\x73\xdb\xf4\x5e\x14\x69\x12\x4c\x55\xdb\x59\xc9\x21\xc5\xec\x7f\x2f\x72\x3e\x70\x29\x3d\x79\xbd\x1a\xed\x3c\xb3\x1a\x47\x0a\xd8\x36\x2d\x68\x11\x1a\x17\xe1\xf3\x2a\xed\xe3\x2a\x20\x22\x63\x41\x22\x7a\x1c\x69\xb9\x19\x9a\x18\xc0\x74\x73\x4b\xbd\x4b\xde\x45\x5a\xda\xb5\xef\x7a\xd8\xbb\xf3\xc9\x59\xc8\xf0\x68\x0e\x27\xe5\xb5\xbe\x5e\x17\xd1\x7a\x3b\xb4\x9e\xaa\xb9\x56\x84\xfe\xcf\x4d\x44\x0c\xa5\x7d\x7c\x3c\xc2\x57\x3e\x1f\xc9\x77\x6d\xc6\x31\xdb\xfb\xd3\xd7\x10\x98\x3b\xa6\x51\xab\x83\x63\x62\xa4\xa2\xb6\xaf\x48\x43\xcc\x5a\x25\x94\x10\xdd\x44\x50\xfa\xeb\xe9\xbf\x32\xf6\x89\xbb\xcf\xaa\x74\xde\xdc\x26\x62\x22\xb0\xcf\xce\x7f\xb8\x1d\x48\xe4\xd4\x35\x46\xab\x6d\xc7\xf4\x5e\x53\x3f\x45\x70\xed\x0e\xf4\x23\x98\x88\xed\x19\xa1\xf1\x2e\x23\x15\x08\xd5\x57\x17\x4f\xa3\x95\x68\xb5\x1f\xc0\x5f\x35\x39\xde\xa5\x0b\xc4\xc3\xb4\xce\x3f\x3c\x27\xb2\x33\xe6\x75\x92\x7d\x29\x53\x2a\xa3\x15\x23\x0f\xdc\xfe\x82\x08\x5c\x2a\x7b\xd9\x52\x4d\x33\xdb\x9a\xfe\x31\x92\xd1\xa2\xcb\xa3\xa0\x0d\x24\xf2\x1d\x00\x00\xff\xff\xef\xce\xec\x8f\xe9\x01\x00\x00") func templateDialectSqlDeleteTmplBytes() ([]byte, error) { @@ -414,6 +564,26 @@ func templateDialectSqlDeleteTmpl() (*asset, error) { return a, nil } +var _templateDialectSqlErrorsTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x52\xc1\x6e\xdb\x3a\x10\x3c\x5b\x5f\x31\x4f\x40\x1e\x2c\x43\x90\xda\x1e\x7a\x70\xe0\x53\xab\xa2\x05\x82\x20\x76\xe2\x43\x4f\x01\x2d\x91\x36\x11\x8a\x8c\x77\xa9\xc4\x85\xa2\x7f\x2f\x48\x55\xa9\x0f\xf5\x4d\xdc\xdd\x19\xcd\xcc\x6e\xdf\x97\x0b\xd4\x1d\x7b\xd7\x42\x12\x39\x62\x08\xdb\x4c\x9f\x07\x61\x1b\x23\x89\xa1\xc8\xb5\xe0\xa3\x41\xa3\x85\x91\xb5\x67\x2c\xca\x61\x48\xfa\x1e\x8d\x54\xda\x4a\xa4\x7f\x1a\x25\x1f\x4d\x39\xa2\x53\x0c\x43\xa2\x3a\x5b\x43\xf3\xfd\xfa\xe6\x8b\xb3\xec\x49\x68\xeb\xab\xd0\x9e\x4b\xa2\xf1\x37\x19\xe6\x8b\x8a\xe8\x6f\xff\x9b\xd0\x46\x36\x39\x76\xce\x99\x0c\x7d\x32\x2b\x4b\x44\x0c\x6c\xd7\xee\x24\xe1\xe3\x87\xcf\x9f\xa0\x19\xd5\xe6\xf1\xeb\xf6\xee\xb1\xba\x7d\xd8\xfc\x84\xb6\x68\x7f\xf1\xd1\xe4\xd1\x40\xba\xbd\xfd\xb1\xde\x56\xa8\xdf\x59\xa1\x22\x6d\x1a\x80\xf7\xeb\x1b\xed\x25\x9e\x49\x2a\x7d\x2a\x92\x99\x56\x68\x79\x8f\xe5\x2a\x28\x2a\x46\x7d\xd9\x35\xd8\x93\xb6\x7b\x2e\xbe\x0b\xbe\x8b\xa3\xf3\x96\xf7\x39\xd2\x51\x4c\x50\x91\x66\x78\x7b\xbb\x38\x77\x51\x43\x74\x35\x23\xe9\x3b\xb2\xf8\xff\x1f\xe6\xfb\x48\x20\x89\x86\x1c\x9e\x3a\x99\xcc\x86\x64\x9a\xb7\xda\xe4\x50\xc2\xb0\x4c\x86\x24\x29\x4b\x90\x33\x66\x27\xea\x27\xd4\xc2\x18\x86\x77\xf0\xa7\x62\x33\x15\x43\x1a\xaf\x24\x9e\x19\xfe\x20\xb1\xd7\x2f\xd2\x8e\xb9\xe3\x55\xfb\x43\x2c\xbe\x13\x8c\x75\xad\xe0\xea\xba\x23\x92\x4d\x31\x2e\x70\x1a\x98\xfb\xd3\x74\x01\xc5\xc3\x29\x0a\x9c\x76\x38\x42\xfb\x98\x25\x85\xfa\x72\x75\x2e\x23\xc4\x19\xcb\xff\xad\x82\x81\xe8\x3f\x3c\x57\x50\xad\x1f\x13\x57\xf3\xf4\x8a\x97\xb8\x7a\x49\xf3\xf3\x35\xe4\x11\x97\xc5\x04\xb4\x0a\x9d\x1c\xee\x29\xd0\x5f\x3a\xab\xec\x3a\x0c\x9c\x25\x2c\x89\xce\x03\x0c\xcf\x78\xbb\xd2\x36\x18\x86\xdf\x01\x00\x00\xff\xff\x0b\xb6\x89\x54\x03\x03\x00\x00") + +func templateDialectSqlErrorsTmplBytes() ([]byte, error) { + return bindataRead( + _templateDialectSqlErrorsTmpl, + "template/dialect/sql/errors.tmpl", + ) +} + +func templateDialectSqlErrorsTmpl() (*asset, error) { + bytes, err := templateDialectSqlErrorsTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template/dialect/sql/errors.tmpl", size: 771, mode: os.FileMode(420), modTime: time.Unix(1564430869, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _templateDialectSqlGroupTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x52\xc1\x6e\x1c\x21\x0c\x3d\x0f\x5f\xe1\x46\x51\x35\xa4\x88\xf4\xdc\x6a\x2f\xc9\xa1\x97\x5e\xd2\x3d\x56\x55\x45\x19\xb3\x42\x25\x66\x06\x98\xcd\x46\x23\xfe\xbd\x82\x61\x93\x34\x9b\x3d\xe4\x84\x65\x3f\xfb\x3d\x3f\xbc\x2c\x30\xa0\xb1\x84\x70\x31\x58\xe5\x50\xa7\xeb\x38\xb9\xeb\x5d\xf0\xf3\x78\x01\x39\xb3\x65\x81\xcb\x3f\xb3\x75\x03\x06\xf8\xb2\x81\x51\x45\xad\x1c\x5c\xca\xad\xf6\x23\xca\x9b\x56\x69\xc0\x80\x1a\xed\x7e\x45\x3e\xc5\x4f\xed\x39\x33\x66\x66\xd2\xd0\xff\x87\xcd\x19\xae\x5e\xb2\xe4\xcc\x21\x4e\x6e\xab\x15\xf5\x3a\x1d\x40\x7b\x4a\x78\x48\xf2\x76\x7d\x05\xec\xc1\x52\xc2\x60\x94\xc6\x25\x73\xc0\x10\x7c\x80\x85\x75\xc1\x3f\xc4\xc2\xfc\x31\x4e\x4e\xfe\xf0\x0f\x71\xc9\xac\x9b\x66\x0c\x8f\x02\x54\xd8\xd5\xda\x2b\x66\x19\x27\x77\x57\x10\x3d\x97\xed\x65\x9d\x35\x65\xe6\x5b\xe8\x21\x94\xa8\x21\x75\x3a\x08\x78\x31\x5e\x40\x11\xc0\xbf\xd6\xe6\x0f\x1b\x20\xeb\x8a\xaa\x2e\x60\x9a\x03\x95\x2c\xeb\x32\xeb\x06\x34\x18\x2a\x54\xde\x3a\x1f\xb1\x30\x36\x48\xd1\x5d\xd6\xde\x3a\xab\xb1\x2f\x10\x01\x7b\xce\x32\x7b\x8f\x6f\x6d\x0d\xb8\xaa\xd3\xb0\x7c\xe9\x6a\x4f\x3c\xc6\x6f\xdb\xc0\x3a\xed\xdd\x7c\x4f\xd5\xa6\x7b\xf5\x17\xfb\x9f\xbf\x62\x0a\x96\x76\x02\x3e\x0b\x70\x48\xaf\xe9\xa5\xb1\xe8\x86\xc8\xe1\xd3\x49\xb5\x14\x29\x72\xfe\x3c\x74\x03\x6a\x1c\x91\x86\xbe\x25\xc4\x89\x86\x75\x9a\x94\x92\xb3\xce\xf8\x00\xbf\x05\x18\xaa\x97\xa4\x68\x87\xa7\x70\x8a\xd5\xde\xf3\x04\x86\xe4\xf6\xee\x7b\x7f\xdc\xbb\xa8\xc9\xcf\x5e\xb7\x6c\xb3\xe8\xd8\x55\xe8\xe5\xb7\x72\xfd\x37\x8f\x67\xf6\xad\x0a\xeb\xbd\x23\x0d\x90\xf3\xbf\x00\x00\x00\xff\xff\x63\x5a\x3f\x5b\x43\x03\x00\x00") func templateDialectSqlGroupTmplBytes() ([]byte, error) { @@ -434,7 +604,47 @@ func templateDialectSqlGroupTmpl() (*asset, error) { return a, nil } -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\xc5\x50\xe7\x4b\x13\x58\x47\x43\x88\xb1\xec\xee\xfd\xdb\xbd\x78\x95\x83\xcd\x73\xdf\x3e\xa9\x07\xa1\x71\xe7\xaa\x47\x8c\xd4\x39\x3f\x07\xad\x96\x2a\x80\xf2\xb0\xe4\x46\xf2\x60\xdd\x13\x10\x99\x0e\x2b\x34\x2f\x3d\x32\xf8\x1b\xc1\x07\xee\x42\x1b\xb3\x56\xe1\x81\xfe\xaa\xe3\xa5\x0e\x50\x71\x5d\xe2\x0c\xb8\x91\x60\x2b\x74\x4e\x49\x04\x15\xe0\x1e\xb5\x5d\x83\xca\xc1\x20\x4a\x94\x6c\x2c\xf5\x9f\x31\x79\x7a\xd6\x16\xc9\xd8\x5b\xe2\x90\x2e\x79\x78\x60\x7f\xf0\xcd\xad\x09\x3f\xff\x34\xb4\xd5\xf2\x3b\xd2\x55\xdc\xb8\xea\xf6\x8f\x4c\xbc\xcb\x7a\x16\x01\x3b\xce\xef\x11\xe4\xfc\xba\x06\x34\x12\x9a\xe6\xdf\x00\x00\x00\xff\xff\x52\x79\x7b\x0e\xa8\x0a\x00\x00") +var _templateDialectSqlMetaTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x54\xcd\x6e\xdb\x3c\x10\x3c\x5b\x4f\xb1\x10\x74\x48\x82\x7c\xd4\xd7\x1c\x0b\xf8\x94\xb6\x80\xd1\x3a\x48\xdb\xdc\x8a\xa2\xa0\xc5\x95\x4c\x84\x26\x6d\x92\xb6\x63\xb0\x7a\xf7\x82\x3f\xd6\x8f\x6b\xa7\x05\x7a\x13\xb9\xda\xd9\xd9\xd9\x59\x3a\x57\xde\x40\xa5\xa4\xb1\x54\x5a\x03\x12\x91\x21\x83\x5a\x69\x30\x1b\x01\x8c\x53\x81\x95\x35\x04\x6e\xca\xb6\xcd\x9c\x03\x86\x35\x97\x08\x79\x8a\x94\x66\x23\xca\x15\x5a\x5a\x76\x18\x39\xb4\x6d\x36\x29\x4b\x78\xa2\x0b\x81\xb0\x54\x82\x19\xb0\x4b\x04\x1b\xce\x92\xae\x10\x54\x1d\x6e\x9c\x03\xa1\xf6\xa8\xa1\x20\x0f\xfe\xba\x6d\x81\xcb\x10\x61\xd4\xd2\x05\x35\x48\xb2\x49\x84\x99\x42\xee\x1c\x14\x24\x9e\xda\x36\xcf\x26\xce\xfd\x07\x9a\xca\x06\xa1\xf8\x71\x0b\x05\xc2\xdb\x29\x14\xe4\x3d\x6b\xd0\x04\x0a\x9e\x83\xcf\xc1\x98\x74\x9f\x08\x86\x2a\x43\x46\xfe\xab\x67\x19\x33\x8e\x74\x34\x0a\x6a\xb9\x92\x25\xb2\xc6\x93\x09\x45\x79\xed\x7f\x99\xdf\xcd\xfd\x1f\x4f\x4b\x84\xb5\xe6\x2b\xaa\x0f\xf0\x8c\x07\x60\x58\x09\xaa\x91\xc1\x02\x85\xda\x13\xe7\x00\x25\x8b\x7c\x2e\x90\x49\xad\x21\xf9\x82\x62\xd8\xdf\xb1\x16\x6e\xba\xbe\x7d\xfa\x61\x9d\x30\xe0\x27\x48\x65\x23\x74\xdf\xeb\x4c\xee\x50\x1b\x7c\xbd\xe5\x30\x04\x3f\xe4\xbe\xe3\x80\x7b\x6c\x1b\xa5\xe5\xf6\x40\x12\xf0\xcc\x02\xbe\x70\x63\x4d\x9c\x0e\x37\xb0\xa6\xd5\x33\x6d\xd0\x9f\x95\x66\xa8\xc1\x2a\xa0\x3b\xc5\x19\x54\x5c\x57\x5b\x41\x35\x30\x5c\xa3\x64\x28\xab\x03\xec\xb9\x5d\x86\x4a\xf9\xa0\xd4\x63\x82\x68\xdb\xfc\x08\x17\xea\xbd\xde\xc5\x74\x84\x71\x2a\xd6\x40\xe9\xa0\x9c\x97\xa7\x9b\xd4\x48\xa5\x7b\x25\xb6\x2b\x79\x51\x9f\x2a\x84\x81\xa1\x54\x96\xcb\xe6\x6f\x8c\x31\xb9\x04\x3c\x1a\x6f\x0c\x9f\xa1\x3c\xf8\xee\x2d\x93\x85\xed\xdc\x51\xcd\x3d\xab\x7f\xd9\xce\x0e\xa3\xdb\xce\xc8\xc4\x24\xe7\x53\x21\xe0\xeb\xe7\x4f\xa9\x71\x03\x54\x9f\xdd\xce\x9a\xa3\x60\x86\x64\x93\x1d\xd5\x1d\xc2\x14\xbe\x7d\x37\x56\x73\xd9\xb8\x64\x72\x32\x7b\x47\x06\x12\xdc\xa6\x5e\x07\xcb\x5a\xc7\x65\xfd\x10\xf0\xd2\x70\x7c\x66\x7d\x2e\xef\xa8\x51\x9b\x79\x9d\xa2\x9d\x0a\xf2\xb0\x5d\x75\x83\xf5\x74\xae\x22\xc6\x1f\xde\x84\xdf\x37\x38\x5c\xf6\xce\x78\xfc\x38\x1c\x1e\x95\xec\x92\x63\xee\x82\x48\xa7\x9e\x31\x23\xd3\x74\xd8\xc3\x17\x62\xbc\x77\xa7\x86\x82\xab\xf9\xdd\xfc\x9a\xc4\xcc\x73\x94\x06\x72\x7b\x63\x71\xc9\xf0\x65\x6c\x2f\x03\xff\x7b\x87\xdd\xc2\xc5\xf8\x1b\x1f\xef\xe5\xe8\xf6\x66\x7c\xba\x0e\x72\x9f\xba\xf2\x57\x00\x00\x00\xff\xff\x1d\x9a\x40\x79\x32\x06\x00\x00") + +func templateDialectSqlMetaTmplBytes() ([]byte, error) { + return bindataRead( + _templateDialectSqlMetaTmpl, + "template/dialect/sql/meta.tmpl", + ) +} + +func templateDialectSqlMetaTmpl() (*asset, error) { + bytes, err := templateDialectSqlMetaTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template/dialect/sql/meta.tmpl", size: 1586, mode: os.FileMode(420), modTime: time.Unix(1564391955, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _templateDialectSqlPredicateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x57\x51\x6f\xe3\x36\x0c\x7e\x76\x7e\x05\x51\x04\x98\x7d\x48\x95\x36\x6d\x5f\x06\x74\x40\xd1\xb5\x40\xb6\xb5\xd9\xd0\xc3\xf6\x50\x14\x07\xcd\xa6\x13\xdd\x1c\xc9\x95\x94\x14\x85\xcf\xff\x7d\xa0\xac\x38\x76\xe2\x5c\x73\x41\x0f\x7b\xd9\x53\xac\x88\x22\xbf\x8f\xfc\x48\xcb\x45\x01\x09\xa6\x42\x22\x1c\x25\x82\x67\x18\xdb\xa1\x79\xce\x86\xb9\xc6\x44\xc4\xdc\xe2\x50\x24\x47\x70\x5c\x96\xbd\x20\x5d\xc8\x38\x34\xf0\xc1\x3c\x67\xec\x01\xc9\x52\xe9\x08\x8a\x5e\x10\x14\xc5\x31\x88\x14\xfa\x6c\xfc\x33\x1b\x9b\x07\xab\x85\x9c\x42\x59\x8a\x64\x00\x9f\xe0\xc7\x4b\x30\x56\xc7\x4a\x2e\xd9\x95\x55\x22\x14\x49\x44\xf6\x28\x13\x20\xaf\x81\x61\x7f\xcd\x50\x63\x48\x6e\x6f\xfe\x08\x0d\xbb\x0e\x8b\xa2\xf2\x75\xad\xa4\xb1\x5c\x5a\x28\xcb\x68\x00\x22\x89\xa2\x5e\x50\xf6\x1a\xa7\x7b\x7b\xa0\x1f\xaa\xdc\x78\x06\x74\xb2\xaf\x72\x82\xd4\x67\x0f\xb1\xca\x91\x4d\xf2\xc6\x16\xd7\xd3\xe6\xde\x95\x9e\xee\xcb\x5c\xe5\xec\x4f\xae\x05\x4f\x44\x5c\xb1\x0a\x86\x43\xda\x90\xca\x02\xd7\xd3\xc5\x1c\xa5\x35\xf0\x82\x1a\x21\xd7\x6a\x29\x12\x4c\x06\xc0\xf3\x9c\x78\xd8\x19\xc2\xed\xd5\x6f\x0f\x37\x10\x7b\xbe\x66\xe0\x3d\x18\x21\x63\x84\x17\x84\x98\xcb\x1f\x2c\x1d\xc8\x5e\xe1\x68\x7c\x0f\x61\x74\xc4\xe0\xe3\x4c\x18\x78\x11\x59\x06\x73\xfe\x0f\x82\xa5\x65\xcd\x1c\x52\x9e\x99\x57\x46\x8e\x44\x0a\x19\x4a\x97\x55\x62\x58\x96\x11\x5c\x5e\xc2\x89\x23\xd0\xce\xff\x2d\xcf\x0c\x86\x94\xe6\x20\x08\x34\xda\x85\x96\xf4\xe8\x08\x2d\x29\x35\x14\x28\x7c\x7c\x12\xd2\xa2\x4e\x79\x8c\x45\x39\xd8\xf4\xed\x0e\xa7\x4a\x83\xa0\x03\x9a\xcb\x29\xc2\xd2\xc7\x2a\x8a\x2e\x9d\x2c\x1f\xc5\x13\x29\x65\x43\x28\x6b\x9f\x8f\xe2\x29\x2a\x0a\xc0\xcc\xa0\x37\x87\x4b\x68\x6d\xd3\xee\x4a\x50\x0e\xae\x13\x09\xd9\x77\xc4\x73\x6c\xba\xa4\xd9\x60\xb1\x72\xd1\xa5\x52\x32\x53\x39\xbb\xe7\x73\x82\xf3\x15\xc5\x2e\x3d\xdf\xb6\x3a\x18\x63\x35\xdc\x03\x14\x9d\x0a\xcc\x92\xa6\xa0\xd3\xa6\x66\x6f\x69\xf7\x2d\xd5\xee\x68\xb9\x74\x13\xfe\xa1\xe8\x36\x5b\x6e\x17\xc2\xff\xfb\xf1\xf0\x7e\xfc\x56\x75\x6e\x15\xf7\x7b\x68\x13\x93\x29\x0e\x67\xbc\x55\x7c\x6c\x96\xf0\x26\x99\xe2\xbe\x35\x44\x76\x37\xba\x03\x5f\x3e\x7b\xea\xba\x95\x7d\xe4\x7f\x67\x18\xba\x84\xac\x48\x57\x59\x7b\xce\xd8\x58\x56\xcf\x81\x3d\xdd\xd5\x92\xd5\xfe\x3a\xa6\xb3\x42\xf6\xfb\xaf\x0d\xab\x47\x9f\x19\x64\x63\x33\x96\x4b\xd4\x6e\xea\x9c\xae\x07\xd0\x49\x9d\xa2\xa7\x88\xdd\x6a\x35\x77\x79\xaf\x90\x55\xfe\xdc\x73\x33\xb0\x8f\x5c\xfd\x44\x1b\xf3\x49\xe9\x8a\xec\x04\x42\x2e\x13\x7a\x9e\x8c\x26\xad\xf8\x11\x94\x65\x51\x0c\x3f\x00\x19\x7d\xf9\x02\x21\x19\xbc\x08\x3b\x03\xe1\x01\x52\xe6\x23\xf8\x30\x7c\x33\x5b\x04\xf5\x5e\xd9\xfb\x45\x96\x85\x75\x9e\x90\x5d\xab\x6c\x31\x97\x2d\xc8\x2d\x98\x3e\xfe\x64\x74\xd7\x8e\xcf\x8d\x51\xf1\xfe\xd1\xdf\xa1\x56\xdb\x48\x59\x65\x19\xec\x59\x8a\x95\xf9\x76\x3e\x76\xa6\xa2\xb3\x7a\xbe\xf9\x0e\x6c\x11\xca\xde\xfb\xb7\x09\x31\x70\xef\xdd\x53\x57\x31\xe8\x7f\xa6\xc5\x89\x5b\x1c\x77\xa8\xba\xb2\x5f\x59\x90\x79\x7d\x94\x18\x1d\xef\x2c\xa8\x1d\xb9\xbf\xea\x64\xfb\xd7\xbb\x8b\x21\x11\xfa\xd5\xdf\xae\x00\xaf\xb9\xaf\xc2\xca\x5d\x05\x13\x99\x87\xb1\x59\xa1\xda\x95\x13\x5e\x7d\xc6\x99\xad\xf7\xd6\xe8\x2a\x3c\x67\x6d\x3c\x3b\x8a\xef\x4c\xcf\x57\xa6\x5e\x57\xf6\xac\x6e\x83\xad\x41\xd0\xff\xec\xda\xdc\x8b\xc6\x29\xcc\x9e\xf9\xd5\x2f\x4a\xc8\xd0\x8e\xfc\x6a\x22\xbf\xee\x48\x38\x47\x03\xb0\xa3\xda\xc8\xa5\x66\x43\xf6\x15\xc4\x8b\x0d\x88\x7e\xce\xd8\x51\x7d\xbb\xfa\x34\x80\x7c\x7d\xc1\x22\x7d\x19\xff\x02\xc9\x43\x7b\x11\xd5\xd7\x36\x7b\xee\x8e\xae\xa8\x5e\x6c\x0d\x83\xb1\x0c\x77\xf7\x20\xd8\xf3\xe8\x3f\x19\x57\x6b\x7d\xb5\x9a\xbf\x2b\x63\x9b\x23\xf8\xfb\x4b\xb1\x5b\x5c\x9d\xda\xdc\xaf\x5e\xa3\x75\xbd\x76\x95\xa6\x6b\x2e\x91\x98\xde\x75\x4c\xef\xc8\x7a\xc7\xc8\xdd\x73\xd6\xbe\x17\xfb\x0e\x61\x36\x98\x1f\x36\x89\x95\x7e\xf3\xc3\xd6\x7d\xc6\x6c\x41\x77\xc7\x3d\x7e\x91\x82\x80\x9f\x1a\x97\xb7\x89\x0e\xd7\x74\xf2\xd0\xd0\xe2\xdb\xb1\x49\x65\xdf\x04\x97\x87\x86\xde\x5c\xe1\xd6\x3d\xed\xdf\x00\x00\x00\xff\xff\x06\x03\xfc\x02\xd3\x0f\x00\x00") + +func templateDialectSqlPredicateTmplBytes() ([]byte, error) { + return bindataRead( + _templateDialectSqlPredicateTmpl, + "template/dialect/sql/predicate.tmpl", + ) +} + +func templateDialectSqlPredicateTmpl() (*asset, error) { + bytes, err := templateDialectSqlPredicateTmplBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "template/dialect/sql/predicate.tmpl", size: 4051, mode: os.FileMode(420), modTime: time.Unix(1564423643, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _templateDialectSqlQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x58\xdf\x6f\xd3\x48\x10\x7e\x4e\xfe\x8a\xa1\xea\x21\xbb\x0a\x0e\x0d\xd5\x3d\x50\xf5\xa4\xbb\xb6\x27\xe5\xee\x4a\x81\x22\xf1\x80\xd0\x69\x6b\x8f\xd3\x05\x67\x37\xd9\xdd\xa4\x45\xc6\xff\xfb\x69\x66\x6d\xc7\x49\x9c\x36\x81\xea\xe0\x01\x91\xf5\xce\xaf\xfd\xe6\xdb\xf9\x16\xf2\x1c\x12\x4c\xa5\x42\xd8\x4b\xa4\xc8\x30\x76\x7d\x3b\xcd\xfa\xd3\x19\x9a\x2f\x7b\x50\x14\xdd\x3c\x87\xfd\xc9\xe7\x11\xbc\x3c\x81\xfd\xe8\x2a\xd6\x13\x8c\x5e\x8b\xf8\xb3\x18\x61\xb5\x7b\x3d\x93\x59\x82\x86\x2c\x26\xc2\xc6\x22\xab\x0d\xff\x28\x77\x4a\x43\x83\x31\xca\xb9\xb7\xac\x7f\xd7\xee\x45\xd1\xed\xa6\x33\x15\x43\xb0\x64\x5b\x14\x70\xd0\xcc\x52\x14\x21\xd8\x69\xf6\x7b\x96\x05\xb1\xbb\x83\x58\x2b\x87\x77\x2e\x3a\xf5\x7f\x87\x10\x7c\xf8\xc8\xf6\xd1\x2b\x31\xa6\x12\x7b\x80\xc6\x68\x13\x42\xde\xed\x18\x7d\x6b\x29\xf9\x53\x3b\xcd\xa2\xb7\xfa\xd6\xe6\x45\xb7\x63\x91\x4e\xad\xb9\xaa\x95\xcc\x91\x9d\x66\x6f\x08\x89\x20\xec\x76\x64\x0a\x33\x25\xa7\x33\x6c\x33\xf4\x3b\xc7\x90\xa1\x0a\xfc\xef\x10\x4e\x4e\xe0\x39\x65\xad\x33\x44\x67\xd2\x3a\xa9\x62\x47\xe1\x8a\x6e\x87\x41\xee\x81\x30\x23\xae\xaa\x36\x6b\xa6\x44\xd3\x5a\x58\x62\xe8\x57\x69\x19\xbb\xbb\x1e\x34\x82\xf5\x80\x0e\x1a\x1e\xb3\xf3\x93\x13\x50\x32\xe3\x3a\x0c\xba\x99\x51\xb4\x64\x50\xb8\x86\x04\x53\x34\x6c\x1f\x9d\x66\xda\x22\xa5\xcd\xf3\x67\x94\xcd\x71\x47\xb3\x99\xe1\x8e\xbe\x5d\x64\xef\x76\xe6\xc2\x94\x25\x39\x6a\x50\x9e\x2f\xec\x18\x76\x36\x5a\xad\x9e\x4c\xa3\x3f\x8d\x1e\x13\xf2\xc1\xf6\x25\x36\xbc\x63\xad\x52\x39\x5a\x25\x48\xf9\x39\xec\x56\xee\x0b\x8f\x1e\x85\xea\xee\xc4\xac\x53\x3d\x53\x6e\x03\xb7\xa4\x72\x8f\xc6\xa7\x05\x99\x3e\x7c\xb4\xce\x48\x35\xca\xd9\xbe\x71\xbd\x22\x5e\x0f\xcf\xa8\x02\xeb\x84\x62\xb0\x3d\xb2\x44\xb4\x76\x12\x86\xf0\x5b\xc9\xbb\x32\xc3\x26\xb6\x32\xb8\x35\xe9\xfc\xb1\xe9\x20\x35\x4b\x1b\x7b\xd9\x6c\xac\x6c\xc9\xec\x28\x8a\x42\xfa\x13\xfe\x30\x06\x3f\xbf\x9f\xbf\x32\x85\x27\xfc\xe5\x15\xde\xb9\x20\x5c\xf7\xd4\x86\xf6\x6e\x83\xbd\x6a\xb8\x15\xc5\x4b\x50\x9a\xc3\x40\xaa\x67\x2a\xd9\xf3\x37\x94\x78\xae\x40\x2a\xd7\x3c\x09\x87\xbe\x8a\x85\x0a\x9e\xaa\xfb\x4a\x4c\xc7\x2e\x3a\xa7\x64\xe9\x72\xa2\x54\xc8\x0c\x13\x30\x28\x12\xa9\x46\x10\x13\xf0\x2f\xe1\x97\xf9\x1e\xd7\xe6\x13\x57\xf7\xe0\x1b\xf8\x7b\x7e\x27\xed\x26\xfe\x5e\x6b\x9d\x35\x09\xac\x7a\x9b\xda\xd3\xbc\x08\x8b\x3e\xae\x9f\x33\x15\x99\xc5\xcd\x67\x8d\x6f\x30\xfe\x0c\x48\x25\xa1\x8a\x71\xd3\x31\x89\xb2\xdf\x70\xd4\xe1\x99\xdd\x28\x02\xd5\xd5\x79\xf7\x65\xb2\x2a\x03\x73\x7b\xdf\xb1\x4b\x65\xb9\xef\xd0\x4b\xe3\x89\x38\x22\x13\x0b\x6b\x29\xbb\x9d\x54\x1b\xf8\xb7\x07\x73\x66\x8d\x50\x23\x84\xb9\xe5\x38\x64\x7f\x02\x62\x32\x41\x95\x04\x32\xb1\x3d\x98\x47\xc3\xb3\x25\x4c\xf8\xeb\xce\x88\x94\x17\x0f\x0e\xe8\x22\x5f\x55\x93\x28\xef\x76\xdc\x21\x5f\xd0\x69\x16\xbd\x13\xd7\x19\x06\xab\x93\x86\xbf\x86\xcb\xd3\x6b\x11\x23\x70\x87\xf5\x10\x58\xf5\x2c\xbf\x57\x53\x81\x27\x7c\xe0\x0e\x3d\x7e\x2d\xf8\x36\xf1\xac\xb3\xb5\x76\xa2\x29\x9d\x65\x1d\x6b\x23\xe9\x81\x6a\x18\xd1\xb2\x0d\x93\x45\x1b\x56\x93\x4d\x0c\x26\x32\x16\x0e\x7d\x7b\x26\x75\x9e\x6d\x03\x68\x43\x4d\x68\xf3\x95\x29\xe8\x34\xb5\x5e\x4d\xd7\xdc\x78\xe7\xb8\xb2\x68\x20\xd3\xef\x43\x26\xc7\xd2\x81\xb4\x30\x16\x2a\x11\x4e\x9b\x2f\x40\x85\x94\xb6\x71\x26\x66\x16\x23\x78\x8f\x60\x9d\x30\xce\xfb\xdc\x4a\x77\x43\x0f\x3a\x31\xcb\x1c\xcc\x45\x36\xc3\x1e\x08\x95\x80\x9e\xa3\x31\x32\x41\x90\x0e\xae\x31\xd3\xb7\x20\x53\x50\x88\x09\x26\x51\x13\xe6\x4b\x0e\x1e\x1c\xf8\x24\x61\xf4\x0f\xd5\x10\x8c\x85\xbb\x89\x2e\xc4\xdd\x50\xb9\x5f\x8f\xea\x63\xf9\xfa\x5a\x4e\xc5\x1b\xc7\xe5\x7e\x4b\xb7\xcb\xa8\x07\x6c\xb0\x44\xfa\xca\xa2\xcb\x0f\x46\x54\x09\xbf\x0a\xf3\xbc\x7f\xe0\xd5\xa1\x3f\x11\xfe\x7c\x52\xa1\x05\x77\x83\xfe\x33\x8c\x50\xa1\x11\x4e\x6a\xc5\x10\xb1\x95\x4e\x41\xc0\x48\xce\x51\x01\x26\x23\x8c\xe0\xa0\xef\xdf\xa1\x1b\xdf\xbb\x1c\x9d\x1f\xbd\xfe\x09\x84\xcd\x47\xef\x79\xc2\x04\x03\x2e\x86\x32\x53\x50\xb8\x45\x46\x11\x9c\xe6\x1a\x46\x46\x38\xe4\x5d\x2e\xc1\xe9\x32\x6b\xf5\xa4\x5a\xbc\x7f\xab\xb0\xcd\x67\x95\x37\x93\x29\xec\x63\x74\x31\xb8\xe0\x42\xf8\xf5\x23\xc9\xe3\x10\x8a\x82\x16\x9f\x68\xf1\x9c\x17\x95\xf1\xd0\x0e\xd5\x1c\x8d\xc5\xd2\x44\x42\x65\x41\xe6\xb5\x2b\xe1\xf9\x8c\x83\xb6\x4d\x03\xe4\xb9\xd5\x36\x13\x3a\x6e\xf0\xd0\x63\xa6\xe3\x06\xf5\xa8\x18\x44\xa7\x6b\xd7\xb2\xe5\x21\x13\xb2\xdb\x8b\xfb\xc7\x52\x59\x18\xed\x35\x5d\xc9\xf3\x68\x75\x44\xbd\xd8\x90\x17\xa3\xd7\x7f\x37\x9c\x3f\x78\x84\x8a\xe2\x63\x18\x12\xf7\x3b\x1d\x3f\xb1\x5e\x94\xab\xbf\xb4\x54\x81\x1b\x94\xab\x4b\xb5\x5b\xe0\x4f\x1c\xb8\x07\x3b\xa1\xc0\xec\xe3\xd9\xb8\x74\x22\x5f\x42\x35\x4f\x79\xe1\x8b\x3b\xf2\x0b\xaa\xed\xb0\x4c\xb3\xde\xbd\xc6\xd7\x95\x94\x3d\x70\x47\xbb\x63\xe5\xd9\x89\x99\x45\x62\x9d\x36\x9e\xa5\x97\x10\xd0\x7c\xd9\xc7\xe8\x72\x70\xb9\xc4\xc5\x90\x49\xd7\x3f\x00\x32\xfa\xfa\x15\x02\x32\xe0\xf9\x24\x4b\xb2\xd2\x0d\x0a\xcb\x0b\xf2\x63\x28\x89\xa5\x5e\x6c\xd9\x90\x15\x15\x5c\x2f\x6f\x55\x0b\x37\xf4\x6f\xf0\xdd\xfd\xdb\xf1\x40\x75\xe7\xca\x96\x5c\x0e\x2e\x96\x5b\x22\xac\xd5\xf1\x4f\xd0\x90\xc7\xb8\x1d\x2d\xe8\x6e\x03\xd3\x6e\x77\x96\x11\xf5\xfa\xd4\xae\x54\xa9\xd1\xe3\x87\x95\x4a\x78\x71\x2a\x37\xd9\xa7\x12\x2d\xa5\x93\xad\x44\x8b\x9c\x1a\xa2\xa5\x58\x5d\x96\x94\x8a\x22\x91\x52\xf1\x3b\xa1\x51\x0b\x79\x2e\x09\xd4\xff\x2a\x78\xcf\x58\xf1\x64\xd2\x46\x9b\x4a\xda\x14\x21\x3f\xb4\x57\xfc\xcf\x63\x28\x0a\x99\x04\x21\xc1\xed\xa9\x3c\x3c\x5b\x40\xbf\x22\x9d\x3f\x9b\x76\x2e\x9b\xab\x76\xcb\x16\x2d\x54\xdf\x2b\x86\x2d\x01\x1e\x49\x0d\xb7\x8a\xbc\x26\x87\x6b\x5e\x6a\xed\x72\xf9\x54\xef\x6f\xd0\x20\xff\x7f\xc4\xf9\x9b\x60\x07\xf7\x1e\xc8\xe4\x07\x8b\xea\x2e\x98\xff\x8c\xaa\xda\x40\x6b\xc3\x71\xd6\xa7\xe7\x02\xd5\xdd\x09\xec\x9d\x97\x1a\xbe\x55\xaf\x1f\x6e\x75\xdd\xe6\x9a\xc6\x8f\xa0\xb9\x5b\xe1\xf1\x8d\xa2\x7b\xff\x49\xb6\xeb\xe3\xb6\x70\xb6\x94\x5d\x21\xda\xa6\x6e\xff\x05\x00\x00\xff\xff\x82\x1a\x9f\xc1\x2a\x18\x00\x00") func templateDialectSqlQueryTmplBytes() ([]byte, error) { return bindataRead( @@ -449,7 +659,7 @@ func templateDialectSqlQueryTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/query.tmpl", size: 2728, mode: os.FileMode(420), modTime: time.Unix(1563979564, 0)} + info := bindataFileInfo{name: "template/dialect/sql/query.tmpl", size: 6186, mode: os.FileMode(420), modTime: time.Unix(1564425510, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -474,7 +684,7 @@ func templateDialectSqlUpdateTmpl() (*asset, error) { return a, nil } -var _templateEntTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x58\xcd\x8f\xdb\xb8\x15\x3f\x5b\x7f\xc5\x5b\xc1\x59\x48\x86\x47\xee\xa1\xe8\x61\x16\x73\x68\xe3\x2e\xe0\x43\xb3\x6d\x3e\xb6\x87\x20\x48\x38\xd2\x93\xcd\x8e\x44\x3a\x24\x65\xcf\x40\xd5\xff\x5e\x3c\x52\x92\x29\x59\x19\x3b\x99\x02\xbd\xf4\x64\x8b\x7c\x7c\x1f\xbf\xf7\x49\xd6\x35\x64\x98\x73\x81\x10\x96\x32\xc3\x22\x84\xa6\x09\x82\xba\x86\xf9\xfe\x61\x0b\xb7\x77\x70\xcf\x34\xc2\x3c\x79\x2d\x45\xce\xb7\xc9\xdf\x59\xfa\xc0\xb6\x48\x44\x75\x0d\x06\xcb\x7d\xc1\x0c\x42\xb8\x43\x96\xa1\x0a\xdd\xa9\x96\xc3\x69\x97\x97\x7b\xa9\x4c\x08\x73\xbb\xb5\x5a\x01\xf1\x4f\xde\xb0\x92\x18\x01\xd7\x60\x76\x08\x56\x3c\xa0\x30\xdc\x3c\x41\x2e\x95\x5d\x1c\x10\xea\x74\x87\x25\x4b\x02\xf3\xb4\x1f\xef\x18\x55\xa5\x06\xea\x60\x96\x5a\x3d\x83\xd9\x6a\x05\x9b\x35\xc8\xdc\x72\x41\x61\x92\x60\xb6\x59\xbb\x43\x9b\x75\xf2\x9e\x38\x34\x0d\x7c\xf9\x97\x96\xe2\x36\xe4\xd9\x52\x96\x9c\xf4\x35\x4f\xe1\x97\x60\x56\xd7\xa0\x98\xd8\x22\xcc\x3f\x2f\x61\x9e\x13\x0c\xf3\xe4\x57\x8e\x45\xa6\xe1\xa6\x69\x82\xd9\xcc\xd9\xb0\x67\x3a\x65\x05\xcc\xf3\x5e\x91\x9d\x24\x1a\x92\x79\x60\x45\x85\x9d\x02\x21\x09\xee\xa9\x42\xc8\x89\x57\x12\x00\x00\xcc\x26\xf9\xd4\x35\xf0\xdc\x2e\x54\x45\xc1\xee\x0b\x5a\x5c\xd4\x35\xa0\xc8\xa0\x69\x1c\xb7\xde\x08\xf7\xf9\xce\x62\xf0\x9e\x11\xfe\xce\x06\x22\xb6\xea\x0e\xed\x41\x67\xcf\x5f\xb3\x2d\x76\xe6\xd4\xf5\x6a\x01\x7c\x2b\xa4\x42\xd8\xa2\x40\xc5\x0c\x17\x5b\xc0\x6c\x8b\x4e\x57\x0d\x8b\x55\x4b\x79\x03\x47\x6e\x76\x30\x47\x4f\xa2\xe3\x32\x42\x05\x2f\xa1\x42\x7a\x9f\x88\x48\x58\x02\xef\x7b\x22\x8d\x06\x8c\x04\xc1\x8b\x25\x30\x91\x81\xde\xc9\xaa\xc8\xe0\x1e\xa1\xda\x67\xcc\x60\x06\x25\x13\x15\x2b\x8a\xa7\x84\x64\x4f\x0a\x76\x30\x0a\x69\x68\xf1\x83\xe0\x5f\x2b\x5a\xfe\xf8\xa9\x47\x72\xe1\x74\x20\x28\xfb\x43\x5f\xdc\xda\x08\xcf\x31\xa0\xdd\xff\x36\x5b\x14\xa6\xc8\x0f\xa8\x1c\xb6\x6f\xbb\xaf\x36\xde\x7f\x55\xb2\x7c\x8b\x7a\x2f\x85\x46\xd0\x29\x13\x0e\x8d\xad\xc2\xb2\xe0\x02\x54\xb7\x95\x31\xc3\x80\x0b\x23\x07\xe1\x9d\x04\x79\x25\x52\x88\x06\x72\x9a\x06\x16\x3e\x51\x3c\x10\x12\x29\xd4\xb0\x68\xf9\x27\xdd\x6a\x0c\xa8\x94\x54\x94\x27\x87\x92\xed\x97\xf4\x49\x0a\x2b\xd4\xc9\x5b\x64\xd9\xef\x04\xfc\xdf\xd8\x3e\x8a\x83\x19\xcf\xed\xee\x4f\x77\xe4\x01\x3a\x31\x53\x68\x2a\x25\x68\x35\x98\x59\x0c\x6e\x60\x4e\xb6\x10\x87\xbd\xe2\xc2\x40\x78\x08\x07\x1a\x06\xb3\x03\x53\xd6\x14\x4b\x37\x48\x54\x4a\x47\x38\x4b\xc8\x6f\x65\xe4\xb3\x29\xe9\x82\x8f\xf4\x79\x26\x91\x36\xfa\x3d\xb7\x4b\x5c\x98\x3f\xfd\x91\x1c\x58\x68\x74\xb9\x74\x6d\xa6\xf5\xab\x9d\x96\x83\xac\x3e\x57\xd8\x11\x5b\xb0\x5a\x34\x6f\xef\x80\x80\x4f\xd6\x98\xca\x0c\xa3\x9f\x3d\x68\xe2\x5f\x2e\xe2\x3d\xc0\x36\xd9\xac\xe1\xce\xc7\x36\xd9\xac\x9f\xaf\x5c\x7d\xfe\x0e\xd8\x4c\x96\x1f\x62\x7c\x33\x06\xce\xf0\xd2\x26\xd1\x63\xe4\x4b\x9d\x84\x7d\x09\x7f\x88\xc1\xc7\xf8\xe6\xc2\x01\x0f\x2d\x3f\xcf\x5a\x08\x04\x2f\x02\x2f\x91\xe4\x51\x7b\x49\xa4\xbf\x16\xff\xcd\x04\x92\x47\x1d\x29\x92\xb0\xd0\x5f\x8b\x84\x3e\xbd\xac\x39\x19\xf2\xa2\x90\x27\x60\x29\xea\x37\xfa\x9d\x51\x54\x68\x6d\x54\x0e\x62\xd2\xcf\x0a\x0f\x9c\x17\xe6\x81\x54\x83\x48\x9f\xe7\xc9\x6f\x7b\xc3\xa5\x60\x45\x1f\xeb\xb4\xe9\xc9\x3d\x29\x74\x9e\x06\x67\x51\xbe\x5a\x59\x8f\x48\x95\xa1\x82\x1d\x2a\xf4\x8a\xb6\x75\x15\x29\xc3\x34\x70\x61\x3f\x6d\xa1\xf5\x46\x8a\xe4\xb5\x2c\xaa\x52\xe8\x2f\x89\x9f\x30\xe4\x8c\xe4\x5d\xca\x44\x44\xd6\xfd\x3c\x8c\xf8\x65\x67\xf1\x05\x50\x86\xe7\xa6\x63\xb6\x63\xd5\x19\xf4\xc3\x19\x39\xe1\x5e\x6d\x54\x2a\xc5\x21\xd9\x18\xc9\xa2\xa1\x09\xf1\x10\xe6\xd3\xc6\x20\x27\x2e\x59\x78\xca\x57\xaf\x8e\x75\x16\x8d\x12\xd9\x02\x32\x56\xfe\x1b\x75\x60\x84\xdb\x39\x4d\x8f\x9a\x33\xc1\xf2\xe6\x39\x5c\x84\x3b\xf9\x9d\x15\x3c\xb3\xb0\x5e\xaf\x8d\xc0\x63\x34\x88\xc5\xd8\x1d\x5f\x5c\x79\x9e\x96\x29\x6d\x73\x08\x5f\xe9\xe4\x95\x0e\x5b\x25\xa3\x21\x71\x0c\xff\xf6\x53\xc1\xe2\xdc\xd9\xd6\x8c\xc3\xe4\x64\xbd\x83\xd9\xcb\xa8\xe0\x7a\xcb\x5e\xac\xd9\xc8\x07\xd7\x8b\xbd\xe4\x5d\xdf\x56\xff\xff\xb0\x36\x3f\x33\x62\xb6\x45\x7d\x6e\x6b\xf0\x69\x56\xf8\x47\x85\xea\x29\x3c\x19\x88\xad\x81\x8d\x2b\x24\xfd\x89\xa6\x81\xaf\x15\x2a\x8e\xfa\x1b\x43\xa3\x3f\x4e\x9e\x2a\xfe\xec\xaa\x92\xef\x49\x89\x62\x18\x4f\x83\x4d\x63\x95\xf4\x73\xdf\xf5\xec\x8e\xc1\xeb\x82\xa3\x30\x35\x8c\xd1\x76\xb7\x90\x26\x4e\x7c\xfe\x23\xa2\x98\x6a\xc8\x29\xc7\xa9\xbb\x7d\xb0\x83\x2d\x38\x51\x1a\x18\xdc\x57\xbc\xa0\x5a\x4a\xd7\x21\x3b\xf5\x52\x35\x31\x3b\xae\x47\xc6\xae\x56\xf0\x46\x1a\x2a\xb2\xcc\x2c\xe1\x49\x56\x20\x10\x33\x1a\x9f\x53\x56\x14\x43\xe2\x0f\xe2\xa8\x68\xc4\x83\x7b\xcc\x69\xde\x27\x8a\x9e\x6d\x89\x66\x27\xb3\x25\x85\xf2\x99\x18\x92\x72\x64\xba\x55\x0f\x33\xc8\x95\x2c\x81\x81\x51\x4c\x68\x96\x52\xd4\xbb\x49\x9d\x9c\xe1\x2d\xda\x43\xa9\x2c\x4b\x6e\x68\x6a\x97\x0a\x94\x2c\x0a\xcc\xe0\x9e\xa5\x0f\x57\xb6\x66\x87\x4c\xe7\xa2\x6e\xdd\xad\xfe\x26\x90\x3c\xf4\x63\x0e\xea\x59\x9c\xbb\xa7\xf5\x89\x85\x0b\x2a\xfb\xa3\xbb\xeb\x24\xdd\x51\x09\xec\x4b\x80\x00\xcb\x0d\x2a\xe0\x8e\x30\x2d\xa4\xc6\x6c\x49\x6c\xb5\x74\xe7\xc9\x3d\x02\x1f\x4d\x1f\xe3\x47\x5e\x14\xd4\x2f\xf1\x11\xd3\x8a\xf0\x32\x3b\x25\xab\xed\xce\x4a\xce\x94\xd5\xee\xb8\xe3\xe9\x0e\x52\x85\xcc\x11\x0c\xe0\xbe\x16\xd1\x2e\x0c\x06\xeb\x04\xa4\x79\x5c\x82\x7c\xa0\x4c\x9d\x46\x2d\x71\x5a\x24\xd1\xc2\x3c\xae\xed\x5f\x77\x5d\xf8\x49\x3e\xd8\x4c\xd9\x33\xc1\xd3\x28\xec\xde\x10\x9a\xe6\xf6\xec\xbe\x4f\x37\xb2\x01\x4e\xac\xbb\xf9\x87\xf1\x64\x6b\x1d\x48\x86\x3b\x30\x8f\x49\xa6\x0e\xbd\xd3\x47\xe4\xad\xeb\xda\xee\xcb\xcb\x7d\x81\x25\x0a\xe3\xbc\x97\x97\x26\x71\x3b\xa8\xae\xc4\xca\x91\x47\x31\xcd\x72\xc4\xb1\x0e\x66\xf7\x95\x6d\xc2\xf7\x4f\x06\x75\xf2\x06\x8f\x7f\xa9\xf2\x1c\x55\x24\x78\x11\xdb\xcd\xe4\x9f\x8a\x1b\x6c\x0f\x86\x3e\xbb\x28\x9c\xa0\xb0\x4a\xb9\x06\x10\x85\x3c\xbb\x7b\x75\x08\x97\x67\xf0\x6f\xd6\x71\x3c\x98\x05\xf8\x77\xce\x02\x3c\x87\xc3\x94\x5f\xa7\x2a\xff\x2f\x70\xf0\x47\x9f\xd9\xf3\x2a\x3b\x65\xfb\xc3\x4e\xff\xc5\x21\xb6\xfd\x79\xa2\x3d\x7d\x3f\xb3\x6b\x74\xb6\xe2\xbe\xd5\xaf\xce\x9c\x12\x93\x23\xda\x00\xa2\xcd\xce\xcb\xae\x9d\xdd\x4c\x8d\x71\x14\x55\x3c\xeb\x0b\x34\x85\x13\xf5\x32\x85\x7b\x85\x1a\x85\x61\x36\xe7\xdb\x7e\xb4\x59\x77\xef\x3c\x57\x05\x19\xcf\xa2\xd8\x72\xab\x83\x19\xcf\x96\xf0\x99\x3c\xd5\xcd\x8d\x7f\x36\x92\x8f\x19\x50\x3c\xf4\x06\xf0\x2c\x68\x02\xcf\x5c\xfb\x28\xa1\x0b\x9e\xda\x56\xbc\x2f\x2a\x45\x48\xf9\xa5\xfc\x44\xe0\x72\x92\xc1\x9e\x29\x6d\xa3\xc5\x2d\xcb\x7c\xd4\x65\xfa\x77\xb7\xfe\xd8\xc7\x4f\x03\x23\x5e\xf0\xd6\xd1\xb1\x7c\x16\xac\x8e\xe8\x7f\xf8\xd6\x71\xfd\xbd\xef\xe3\xa7\xff\x3f\x76\xfc\xf0\x63\x07\x0d\x3c\x9f\x97\xae\x5a\x39\x28\x7c\x68\xe9\xc0\x78\xe4\x87\x3b\x60\xfb\x3d\x8a\x2c\x1a\xef\x2c\x61\x30\x12\xd8\x6a\xb6\x59\xdf\xc2\xe1\x74\x7f\xbc\x78\x7d\x9c\xc4\xfb\xf6\xf9\x57\x92\xc3\x64\x8d\x1a\x3d\x8d\x4c\x13\xf5\x78\x76\xfa\xf5\x2f\x22\x33\x37\x37\xbe\xf4\x65\xe4\x47\xd2\xed\xd9\x97\x91\xdc\x8e\x75\x47\xea\x85\x8f\x26\x8a\xad\x8b\xae\xc9\x9a\x99\xef\xd7\xdb\xbb\x91\xab\x88\xe0\x14\x4d\xfe\x65\x65\xa0\xd1\x79\x38\x0d\xe2\xc9\x36\xa0\xef\x89\x17\x3f\x52\x27\xd0\x9e\x86\x6c\x88\x98\x1b\x58\xa2\x34\xdf\xb6\x7f\xe3\x0e\x25\x3e\x8c\xe9\x01\x8b\xe0\xec\xe2\xf6\x91\x7f\x6a\x87\x1f\xb8\x83\x34\xdf\x92\x3a\xfe\xb5\xe1\x3f\x01\x00\x00\xff\xff\x8b\x42\xb4\xd4\xc0\x19\x00\x00") +var _templateEntTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x56\x4d\x8f\xdb\x36\x13\x3e\x4b\xbf\x62\x22\x38\x2f\x2c\xc3\x91\xee\x79\xb1\x87\x36\xdb\x02\x7b\x49\x3f\x36\x41\x0f\x41\x90\xa5\xc5\x91\xc5\x2e\x45\x2a\x24\xe5\xb5\x21\xe8\xbf\x17\x43\x4a\x5a\xc9\x76\x93\x4d\x4f\x96\xc9\xe1\xcc\x33\xcf\x7c\x76\x1d\x70\x2c\x85\x42\x48\x6a\xcd\x51\x26\xd0\xf7\x71\xdc\x75\xb0\x6a\x1e\xf7\xf0\xf6\x06\x76\xcc\x22\xac\xb2\x77\x5a\x95\x62\x9f\xfd\xce\x8a\x47\xb6\x47\x12\xea\x3a\x70\x58\x37\x92\x39\x84\xa4\x42\xc6\xd1\x24\xe1\xd5\xa0\xe1\xf9\x56\xd4\x8d\x36\x2e\x81\x95\xbf\xca\x73\x20\xfd\xd9\x7b\x56\x93\x22\x10\x16\x5c\x85\xe0\xcd\x03\x2a\x27\xdc\x09\x4a\x6d\xfc\xe1\x42\xd0\x16\x15\xd6\x2c\x8b\xdd\xa9\x39\xbf\x71\xa6\x2d\x1c\x74\x71\x54\x78\x9c\x71\x94\xe7\x70\x77\x0b\xba\xf4\x5a\x50\xb9\x2c\x8e\xee\x6e\xc3\xa3\xbb\xdb\xec\x03\x69\xe8\x7b\x78\xf8\xdb\x6a\xf5\x36\x11\x7c\xab\x6b\x41\x78\xdd\x29\x79\x88\xa3\xae\x03\xc3\xd4\x1e\x61\xf5\x65\x0b\xab\x92\x68\x58\x65\xbf\x0a\x94\xdc\xc2\x9b\xbe\x8f\xa3\x28\xf8\xd0\x30\x5b\x30\x09\xab\x72\x02\x52\x69\x92\x21\x9b\x07\x26\x5b\x1c\x01\x24\x64\x78\x92\x4a\xa0\x24\x5d\x59\x0c\x00\x10\x5d\xd5\xd3\x75\x20\x4a\x7f\xd0\x4a\xc9\x76\x92\x0e\x37\x5d\x07\xa8\x38\xf4\x7d\xd0\x36\x39\x11\xfe\xde\x7b\x0e\x3e\x30\xe2\x3f\xf8\x40\xc2\x1e\xee\xd2\x1f\x0c\xfe\xfc\xc2\xf7\x38\xba\xd3\x75\xf9\x06\xc4\x5e\x69\x83\xb0\x47\x85\x86\x39\xa1\xf6\x80\x7c\x8f\x01\xab\x85\x4d\x3e\x48\xbe\x81\x27\xe1\x2a\x58\xe1\xcc\x62\xd0\x72\xc6\x0a\x7e\x8f\x15\xc2\xfd\x2c\x44\xc6\x32\xf8\x30\x09\x59\x74\xe0\x34\x28\x21\xb7\xc0\x14\x07\x5b\xe9\x56\x72\xd8\x21\xb4\x0d\x67\x0e\x39\xd4\x4c\xb5\x4c\xca\x53\x46\xb6\xaf\x1a\x0e\x34\x2a\xed\xe8\xf0\xa3\x12\x5f\x5b\x3a\xfe\xf4\x79\x62\x72\x13\x30\x10\x95\xd3\xa3\x87\x70\x76\xc6\xe7\x39\xa1\xe3\x77\xc8\xf5\x19\xbd\xd6\x69\x43\x25\xe2\x49\xbe\x1f\xfe\x0c\x8f\x56\xae\x6e\x24\xdd\x34\x46\x28\x57\x42\xc2\x05\x93\x58\xb8\xfc\xb5\xcd\x39\x16\x9a\x63\xae\x15\x26\xcf\x4a\x86\x77\xc7\xa9\x96\x82\x86\xd5\x50\x80\xc1\x89\x50\xaf\x06\x0b\x14\x07\x34\xc1\xf0\x9f\xe3\xbf\xfe\x02\xe0\x22\xfe\x23\xb0\xb2\x55\xc5\x04\x0c\x92\x3f\x5a\x34\xa7\x04\xd6\x4b\x4a\x53\x2f\x3e\xd4\xaf\x7f\xd1\xf7\xf0\xb5\x45\x23\xd0\xfe\x4b\x44\xe7\xb1\x1e\x2f\xb2\x38\xf2\x8f\xd7\x0b\xd8\x7d\x0f\x9b\xb9\x54\x3a\xb7\xb2\x4e\xe1\x3c\x54\x7d\xef\x41\x52\xd1\x47\x06\x5d\x6b\x14\xac\xff\x37\x57\xf0\x4e\x0a\x54\xae\x83\x33\x2b\x59\x68\x11\x7d\x9a\xcd\xf5\x9f\x09\xa5\x71\xb4\x20\x38\xcf\xe1\xa3\xcf\x3a\x08\xa6\x2c\x30\xd8\xb5\x42\x72\x34\xbe\x57\xf9\x94\xa4\x92\x71\x95\xb0\x67\xce\xe6\x39\xbc\xd7\x0e\xc1\x55\xcc\x6d\xe1\xa4\x5b\x50\x88\x9c\x72\xbb\x60\x52\x2e\x85\x3f\xaa\x27\xc3\x9a\x75\x0a\x3b\x2c\xa9\x18\x49\x62\x52\x5b\xa3\xab\x34\xdf\x52\x4a\x5f\x98\x21\x2b\x4f\xcc\x0e\xf0\x90\x43\x69\x74\x0d\x0c\x9c\x61\xca\xb2\xc2\x09\xad\x42\x19\x51\x30\x66\x87\xfe\x51\xa1\xeb\x5a\x38\x2a\x29\x6d\xc0\x68\x29\x91\xc3\x8e\x15\x8f\x59\xfc\xa2\x38\x05\x66\xc6\x10\x8d\xe7\xe1\xf4\x37\x85\x14\xa1\xff\x16\xa0\x49\xc5\x65\x78\x86\x98\x78\xba\xa0\xf5\x3f\x76\xec\xf5\x34\x40\x88\xec\xef\x11\x02\xac\x74\x68\x40\x04\xc1\x42\x6a\x8b\x7c\x4b\x6a\xad\x0e\xef\x29\x3c\x0a\x8f\x6e\xca\xf1\x27\x21\x25\x75\x20\x3c\x62\xd1\x12\x5f\xae\x32\xba\xdd\x57\xde\x32\x37\x1e\xdd\x53\x25\x8a\x0a\x0a\x83\x2c\x08\x2c\xe8\x7e\x29\xa3\x63\x1a\x2c\xce\x89\x48\x77\xdc\x82\x7e\xa4\x4a\xbd\xce\x5a\x16\x50\x64\xeb\x8d\x3b\xde\xfa\xcf\x34\x8e\x44\x09\xaf\xf4\xa3\xaf\x94\x86\x29\x51\xac\x93\x71\xc0\xf7\xfd\xdb\x8b\x61\x4c\xed\x72\xc1\x13\x1b\xc7\x72\xe2\xcb\x22\xfa\xa6\x65\xb8\x01\x77\xcc\xb8\x39\x4c\x41\x3f\x13\x1f\x42\x77\xef\x0c\x25\xb6\xa8\x1b\x89\x35\x2a\x17\xa2\x57\xd6\x2e\x0b\x37\x68\x5e\xc8\x55\x10\x5f\xa7\xb4\x04\x90\xc6\x2e\x8e\x76\xad\x9f\xd9\xbb\x93\x43\x9b\xbd\xc7\xa7\x9f\xdb\xb2\x44\xb3\x56\x42\xa6\xfe\x32\xfb\xcb\x08\x87\xc3\xc3\x64\xae\x6e\x9d\x5c\x91\xf0\xa0\x42\xc7\x5e\x27\x82\xdf\xbc\x3e\x24\xdb\x0b\xfa\xef\x6e\xd3\x34\xf6\xe3\x71\x68\xb5\xe2\x62\x75\x98\x06\xe8\xc5\x68\xa7\x01\x26\x4a\x38\x5c\x8b\xeb\xb5\xfd\xe0\xff\x70\x80\x57\x37\x34\x1b\x7d\x50\xa3\x6f\x43\x0e\x60\xa7\xc7\x01\xff\xe6\x40\x78\xa3\x68\xc4\x84\xd2\x8e\x48\x7e\x5c\xd9\x4b\x30\x7b\x73\xde\x52\xe8\xa9\x8b\xef\x8b\xa0\xa4\x14\x88\x21\x81\xe8\x72\x8c\x72\x98\xb7\x81\x42\xda\xe4\xee\xec\x90\x48\xa1\x05\x0a\x3e\x35\x68\x4a\x27\x9a\x65\x06\x1b\x83\x16\x95\x63\xbe\xe6\x87\x79\x74\x77\x3b\x2e\x61\x2f\x4a\x32\xc1\xd7\xa9\xd7\xd6\xc5\x91\xe0\x5b\xf8\x42\x91\xb2\xce\x14\x5a\x1d\xb2\x9f\x9c\x16\xe7\x0a\x28\x1f\x26\x07\x04\x8f\xfb\x78\xe6\xae\x9f\xd7\x56\x8a\xc2\x8f\xe2\x46\xb6\x86\x98\x9a\xb7\xf2\x67\x81\x50\x93\x0c\x1a\x66\xac\xcf\x96\x70\xac\xcb\xb3\x29\x33\x2d\xc5\xd3\xb3\x4f\x9f\x17\x4e\xfc\xc8\x9e\xe2\x37\x3c\x3c\x3a\xc2\xbb\x82\xe4\x9e\x54\x26\xcf\xaa\xc3\x36\xf4\x82\x65\xa6\x66\xea\x74\xb6\xcd\x5c\x5b\x67\x32\x98\x2d\x55\xcb\xcd\xe6\x7a\x74\xe6\x7e\xa6\x10\xfa\xcf\xba\x28\xf7\xc3\x67\x4a\x61\xa2\xb1\x2c\x08\x5e\xf0\xf9\x42\xc5\xe0\xc4\xec\xec\x93\xf8\x3c\xf4\x32\xb8\x81\xa2\xdc\x53\xb3\x9b\x83\xf9\x27\x00\x00\xff\xff\xdc\x2b\x72\xde\x2c\x0d\x00\x00") func templateEntTmplBytes() ([]byte, error) { return bindataRead( @@ -489,12 +699,12 @@ func templateEntTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/ent.tmpl", size: 6592, mode: os.FileMode(420), modTime: time.Unix(1563488473, 0)} + info := bindataFileInfo{name: "template/ent.tmpl", size: 3372, mode: os.FileMode(420), modTime: time.Unix(1564245932, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateExampleTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x56\x4f\x6f\xdb\xc6\x13\x3d\x73\x3f\xc5\xfc\x16\xf4\xaf\x64\x20\x93\x68\x4f\x81\x02\x1d\x5a\x47\x2e\x04\x14\xb2\x9b\xb8\x40\x6f\xc6\x86\x1c\xd2\x0b\xad\x76\x99\xe5\x52\x96\xc1\xf2\xbb\x17\xb3\xa4\x48\x31\xb2\x8b\x02\xb9\xf4\x22\x88\xc3\xf9\xf3\x66\xe6\xbd\x91\xda\x16\x72\x2c\xa4\x46\xe0\x78\x14\xfb\x4a\x21\x87\xae\x63\x6d\x0b\x61\xb5\x2b\x61\xb9\x82\x2f\xa2\x46\x08\x93\x1b\xa3\x0b\x59\x26\xf7\x22\xdb\x89\x12\x07\x1f\x87\xfb\x4a\x09\x87\xc0\x9f\x50\xe4\x68\x79\x1f\xd5\x75\x8c\xc9\x7d\x65\xac\x83\x88\x05\x5c\x99\x92\xb3\x80\x3b\xac\x9d\xd4\xfe\xab\xa9\xe9\x53\xa3\x4b\x1b\xab\x38\x63\x41\xdb\x82\x15\xba\x44\x08\x1f\x17\x10\x6a\xaa\x1b\x26\x5b\x93\x63\x4d\xc9\x82\x80\x13\x20\x7d\x09\x22\xed\xed\x93\x81\x53\xae\x6b\x40\x9d\x7b\x14\x01\x2f\xbe\x64\x29\x6a\x97\xe6\x52\x28\xcc\x1c\xbf\x34\xa5\xa5\xc5\xbd\x92\x9a\xb3\x98\xf9\xc6\x51\x1f\x08\x40\x53\x55\x68\xfb\x86\xfe\x82\xca\x4a\xed\x0a\xe0\x57\xf5\xe3\x66\xfb\xb0\xfe\xf5\xd3\xcf\x0f\x9b\xbb\xed\xe3\x7a\xfb\xf1\xfe\x6e\xb3\x7d\xf0\x43\x63\x69\x4a\x85\x2b\x23\xb5\x83\xc2\x58\x70\x4f\x08\xb9\x70\x82\x46\x98\xc0\x46\x83\xb1\x39\x5a\x70\x06\x6c\xa3\xfd\x5b\x9a\x49\x0d\xca\x64\x42\xa9\x97\xc5\x68\x2e\x8c\x52\xe6\x59\xea\x12\x32\xb3\xdf\x0b\x9d\x2f\x59\x9a\xb2\x34\x0d\xe0\x84\xaf\xeb\x56\xfc\xc9\xb9\x6a\x99\xa6\x3e\xfa\xc9\xd4\x6e\xf9\xfe\xc7\xf7\x3f\x71\x28\x8d\x4f\x0b\xd7\x07\x0a\x3a\x08\x3b\x81\x7a\x37\xb4\x9a\xac\x07\x0b\x63\x45\xa3\x33\x90\x5a\xba\x28\x86\x96\x05\xb2\x00\x5c\x80\xd9\xd1\x00\x4c\x9d\xfc\x66\xcc\xae\xa9\xd6\xfa\x10\xf1\xa9\x32\x8f\x3f\x90\x47\xcb\x02\x72\x6f\x16\x80\xd6\xfa\x81\x59\x95\xdc\x0b\x5b\x63\x84\xf1\x07\x6f\x5c\xad\x40\x4b\xe5\x3d\x83\x11\xc4\x0a\xfe\xff\x2d\x8c\xb6\xa1\x25\x77\x2c\xe8\x58\xe7\x77\xf0\x16\x19\xae\xbb\xae\x47\xbc\xee\xc9\xda\xb6\x50\x89\x3a\x13\x8a\x58\xb0\x15\x7b\xa2\xc0\xd4\xc8\x58\x71\x82\x61\xd1\x35\x56\x53\xa1\x20\x73\x47\x4a\x9d\x19\xed\xf0\xe8\x92\x5f\x44\xb6\x2b\xad\x69\x74\x1e\xc5\x2c\xc8\x8c\xd6\x63\x63\x27\xb8\x5b\x7c\xbe\x51\x12\xb5\x8b\x4e\x96\x9e\x90\xed\xa9\x8f\x25\xbc\x3b\x15\xed\xe2\x1e\x83\xb5\xf0\xbf\xa9\xbc\x32\x65\x72\x2b\x9c\x50\x45\xc4\x0b\x21\x15\xe6\x90\x59\x14\xa4\x8b\x91\x29\x90\xf9\x1a\x4b\xb8\x3a\x70\x0f\x21\xee\xe1\x7a\x2b\xc1\x99\x60\x7c\xb4\xf2\x80\x36\x3a\xc3\x37\x58\x08\x7e\x1c\xc7\x8c\x05\x69\x3a\x55\x38\xa0\x75\x32\xc3\x7a\x24\x67\xdb\x82\x32\xcf\xc4\xf2\x71\x7a\x3f\xd4\x80\x79\x89\x75\x72\x2e\x4a\xb9\x80\x10\xfd\x1e\x74\xb2\xa6\xb7\xbd\x2a\x49\x69\xb2\x00\x6d\x1c\x84\x98\x6c\xea\x8d\x3e\xa0\xad\xb1\x7f\xe9\xdf\x86\x5e\x49\x93\x78\xae\x72\x4e\xae\x0f\x2f\x15\x26\x9f\x30\x43\x02\x0b\xa1\x9c\x47\x74\x9d\xdf\x8b\x6f\x31\xf1\xb4\xeb\x03\x06\x84\x09\xb9\x06\xc1\x0d\x75\x85\x51\xdc\x3f\xce\x39\x53\x78\xac\x43\xd8\xad\x44\x95\x0f\x88\x87\x22\x27\xce\x14\x7d\xce\x49\xde\x9f\xd1\x5d\xd5\x24\xe6\x88\xea\x16\xc9\x40\xb3\x1b\x93\x53\xe5\xa9\xd6\x70\x5f\x7c\xc2\xcf\xe2\x80\x7f\x46\x99\x3b\xc6\xf4\x4c\x1b\xbe\xa7\x6c\x4a\x7b\xcd\x0c\xf3\x9d\xb7\xd0\xaf\x04\xf3\x25\x5f\x78\x45\x53\xcf\x31\x9b\x65\x3e\xbb\x62\xe3\x0e\x5f\x5d\x98\xdf\x2a\x1e\xe1\x59\xba\x27\x90\x6e\xb6\xbe\x50\x4f\x53\xbe\x98\xaa\x3e\x1f\xe8\xd9\x34\x5f\x1b\xa5\x9e\x4d\xf1\x3b\x47\x38\xeb\xf2\xfb\x29\x66\x2a\x0a\xe3\x22\xcf\xa9\x6a\xdb\x92\x7f\x88\xc9\x1f\x5a\x7e\x6d\xb0\xb7\x90\xcf\x0a\x78\x8d\x6e\x70\x99\xf6\xe7\x53\xf8\x93\x72\x22\x2a\x44\xa7\xde\x4c\x15\x4f\x0f\xfd\xf2\xe2\x8b\xb0\xbe\xd1\x7f\x43\x71\x4f\x9f\x79\xf3\x23\x8e\x73\x12\xbd\x41\x21\xfd\x16\x7b\x66\x4b\x1e\x34\xff\xb5\x41\xfb\xf2\x1f\x50\x72\x7f\x43\x57\x97\x38\x93\xb3\xd3\x8d\xdf\x72\xe8\x77\x42\x3f\xb0\x28\x4e\x6e\xa5\xad\xdd\x28\xb0\xcb\xa3\xfa\xea\x59\xf5\x03\xa0\xa3\xd7\x1f\x90\x61\x74\xb3\xa3\xea\x7f\x71\x2e\x15\x3b\x79\x43\x41\x3f\x07\xff\x28\xd2\x73\x8d\xde\x35\xae\x6a\xdc\x92\xf9\xbf\x46\xa7\x7f\x20\xd3\xd7\xbf\x03\x00\x00\xff\xff\xa1\xf9\x10\xb7\x6b\x09\x00\x00") +var _templateExampleTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x56\x5d\x6b\xec\x36\x10\x7d\xb6\x7e\xc5\x54\x38\xd4\x86\xbd\x76\xe1\x42\x1f\x16\x96\x7e\xe4\x26\x65\x5f\x36\xe9\xbd\x5b\xe8\x5b\xd0\xb5\xc6\x8e\x88\x56\x72\x24\xd9\x49\x70\xfd\xdf\xcb\xc8\xce\x7e\x74\x93\x52\xb8\x2f\x7d\x09\x2b\x79\x74\xe6\xcc\x99\x33\x43\x86\x01\x24\xd6\xca\x20\x70\x7c\x16\xbb\x56\x23\x87\x71\x64\xc3\x00\x69\xfb\xd0\xc0\x72\x05\x5f\x85\x47\x48\x8b\x4b\x6b\x6a\xd5\x14\xb7\xa2\x7a\x10\x0d\xce\x31\x01\x77\xad\x16\x01\x81\xdf\xa3\x90\xe8\xf8\xf4\x6a\x1c\x19\x53\xbb\xd6\xba\x00\x19\x4b\xb8\xb6\x0d\x67\x09\x0f\xe8\x83\x32\xf1\xa7\xf5\xf4\xd7\x60\x28\x3b\xa7\x39\x63\x09\xaf\xbf\x56\x25\x9a\x50\x4a\x25\x34\x56\xa1\xf4\x8f\x9a\xb3\x64\x18\xc0\x09\xd3\x20\xa4\x77\x0b\x48\x0d\xd1\x49\x8b\x8d\x95\xe8\x29\x47\x92\x70\xe2\x69\xce\xb9\x95\xd3\xfd\xe1\x22\x62\x7d\x00\x34\x92\x1e\xe6\x2c\x16\x88\xa6\x27\xc4\xae\x6d\xd1\x4d\xc4\xff\x82\xd6\x29\x13\x6a\xe0\x17\xfe\x6e\xbd\xd9\x5e\xfd\xf6\xf9\x97\xed\xfa\x66\x73\x77\xb5\xf9\x74\x7b\xb3\xde\x6c\xa3\x38\xac\x2c\x41\x7a\x03\xb5\x75\x10\xee\x11\xa4\x08\x82\x54\x2a\x60\x6d\xc0\x3a\x89\x0e\x82\x05\xd7\x99\xf8\x95\xca\xf6\xa0\x6d\x25\xb4\x7e\x59\xec\xaf\x6b\xab\xb5\x7d\x52\xa6\x81\xca\xee\x76\xc2\xc8\x25\x2b\x4b\x56\x96\x09\xbc\x52\x1b\xc7\x15\x77\xd6\x86\x65\x2b\xbc\xff\x39\x54\x6d\x16\x41\xee\xad\x0f\xcb\x8f\x1f\x7f\xf8\x31\x2f\x09\xfa\xa7\x56\x38\x8f\x5b\xb5\xc3\xd5\xd6\x75\xc8\xa1\xb1\x31\x25\x7c\xe8\x09\xb0\x17\x2e\x72\xf5\xc1\x29\xd3\xc4\xba\xdf\x53\xf4\xc3\x38\xb2\xba\x33\x15\x5c\x4d\x46\x18\x06\x68\x85\xaf\x84\x26\x29\x37\x62\x47\x3a\x66\x39\x0c\x2c\x51\x75\xc4\x5c\xad\x80\x73\x3a\x27\x0e\x43\xe7\x0c\x4b\x46\x96\x54\xe1\x99\x40\x2b\x6b\x02\x3e\x87\xe2\x57\x51\x3d\x34\xce\x76\x46\x66\x39\x4b\xa4\xeb\x17\x80\xce\x51\x84\x7f\xd4\xc5\x4d\x8b\x26\xe3\xbb\x17\xea\xf6\x82\x30\xf3\x08\x4e\x11\xdf\xad\xc0\x28\x1d\xd1\xb5\x6d\x8a\x6b\x11\x84\xae\x33\x5e\x0b\xa5\x51\x42\xe5\x50\x90\x99\xf6\xda\x43\xa5\x15\x9a\xb0\x84\x8b\x9e\xc7\x14\x79\x64\x23\xb1\x46\x07\xd2\xf5\xc5\xa5\xb6\x1e\x89\xc3\x14\x48\x0c\x36\xf8\x74\x19\x0f\xd9\x27\xa7\x7a\x74\x99\x74\x7d\x9e\xb3\xa4\x2c\x0f\xf8\x3d\xba\xa0\x2a\xf4\xfb\x66\x0f\x03\x68\xfb\x44\x86\xd9\x8b\xf2\xbd\x07\x94\x0d\xfa\xe2\xd8\xb0\x6a\x01\x29\x46\x79\x4d\x71\x45\x5f\x27\xc7\x92\x0b\x55\x0d\xc6\x06\x48\xb1\x58\xfb\xb5\xe9\xd1\x79\x9c\x3e\xc6\xaf\x69\x34\xe5\xc1\x87\x17\x92\x53\xe8\xf6\xa5\xc5\xe2\x33\x56\x48\x4c\x21\x55\xa7\x2f\xc6\x31\x8a\x1e\xab\x29\xa2\x81\xa6\x07\x33\xc3\x82\x42\x93\xe4\x92\xaa\xc2\x2c\x9f\x8e\xa7\x56\xa8\x23\xd7\xf9\xd9\xb5\x42\x2d\x67\xc6\x73\x92\x57\x2b\xd4\x13\xe6\x61\x52\xbe\x60\xb8\xf0\x34\x17\x19\xe5\xad\x8b\xd9\x3d\x97\x56\x52\xe6\x43\xae\x79\xf6\x22\xe0\x17\xd1\xe3\x9f\x59\x15\x9e\x73\x3a\x53\x7f\x6f\x09\x4d\x9b\x8c\x1f\xf4\x3d\x2d\x61\x6a\x09\xca\x25\x5f\xc4\x09\xa1\x9a\x73\x76\x82\x7c\x34\xe1\xfb\x1e\xbe\xd9\xb0\xd8\x55\x7c\x86\x27\x15\xee\x41\x85\x93\xf6\xa5\xe6\xa0\xf2\x99\xaa\xe6\x58\xd0\x23\x35\xdf\x92\xd2\x9c\xa8\xf8\x8d\x12\x9e\x54\xf9\xed\x16\xb3\x2d\x3d\xe3\x42\x4a\xca\x3a\x0c\x14\x9f\x62\xf1\x87\x51\x8f\x1d\x4e\x37\x14\xb3\x02\xee\x31\xcc\x21\x87\xfe\x45\x88\xb8\x29\x5e\x8d\x0a\xd9\x6b\x6d\xb6\xcd\x0f\x87\xa9\x79\xf9\xd9\xb3\xa9\xd0\xff\x62\xf1\x68\x9f\xd3\xe2\xf7\x3c\x8e\x4d\xf4\x8e\x85\xcc\x7b\xee\x39\x69\x72\xce\xa2\x5f\x1e\x3b\x74\x2f\xff\x83\x49\x9e\x36\xe4\xea\x9c\x67\x71\xb4\x91\xf1\x9f\x1e\xfa\x9d\xd8\xcf\x2e\xca\x8b\x6b\xe5\x7c\xd8\x0f\xd8\xf9\x4a\x7d\x73\xa9\x46\x01\x68\xe9\x4d\x0b\x64\x96\xee\x64\xa5\x26\xc9\xf8\xd6\xc4\x1e\xa2\xa1\xa6\x5d\xff\xaf\x43\x7a\x3c\xa3\x37\x5d\x68\xbb\xb0\x64\xf1\xbf\x89\xf9\xfe\xe8\xe7\xdf\x01\x00\x00\xff\xff\x31\x52\x5d\x02\x9e\x08\x00\x00") func templateExampleTmplBytes() ([]byte, error) { return bindataRead( @@ -509,7 +719,7 @@ func templateExampleTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/example.tmpl", size: 2411, mode: os.FileMode(420), modTime: time.Unix(1563538691, 0)} + info := bindataFileInfo{name: "template/example.tmpl", size: 2206, mode: os.FileMode(420), modTime: time.Unix(1564434704, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -534,7 +744,7 @@ func templateHeaderTmpl() (*asset, error) { return a, nil } -var _templateImportTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x90\x41\x6e\xeb\x20\x10\x86\xd7\xe6\x14\x23\x94\x45\x92\x85\x39\xc4\xbb\xc0\x93\x7a\x80\x88\xe2\x31\x1e\xd5\x0c\x0e\x8c\xda\x4a\x88\xbb\x57\x38\xae\xbc\x68\x64\x65\xc5\xc7\x3f\x1f\x68\xf4\x97\x02\x03\x8e\xc4\x08\x9a\xc2\x12\x93\x68\xa8\x55\x3d\x10\xce\xaa\xd3\x63\x10\xad\x3a\xed\x22\x0b\x7e\xaf\x88\x29\xc5\x94\x1b\x05\x2b\x53\x3b\xb3\x24\x17\xf9\x73\x43\x62\xbf\x4e\x85\x02\x6a\xa5\xba\x52\xcc\x15\xc8\x73\x4c\x08\x1e\x19\x93\x10\x7b\x88\x0c\x3e\xd9\x65\x02\xc1\xb0\xcc\x56\x30\xc3\xd5\xd4\xda\x74\xa0\x11\x38\x0a\x9c\xf1\x0e\xa7\xfe\x5f\xe4\x91\x7c\xff\xdf\xba\x0f\xeb\x11\x4e\xbf\x74\x69\x8b\x76\x9d\x2e\xe5\xaf\x54\xab\x59\x12\x0e\xe4\xac\xa0\x3e\x90\xd6\x78\xbf\x37\xb5\x14\xf8\x22\x99\x76\xfd\xcd\x4d\x18\x2c\x40\xad\xd0\xbe\xe9\x9b\x07\xa5\x00\xf2\x00\xdb\xbe\x1b\xb6\xb6\xde\x9d\x41\x5e\x6b\xda\xd0\x0c\x64\x67\x74\xcf\x22\x93\xef\xf3\xb3\xd8\x27\x0c\x33\xf1\xc1\xc8\xac\xd5\x99\x21\x1f\xbd\xdf\x25\x73\xbb\xbd\xe6\xf9\xd7\xb4\xe5\x48\x43\x76\x71\x20\xf6\x0f\x3f\x47\xd6\xea\xa2\xf6\x92\x7e\x02\x00\x00\xff\xff\x71\xf4\x95\x2a\x71\x02\x00\x00") +var _templateImportTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x91\xc1\x4e\x84\x30\x10\x86\xcf\xf0\x14\x7f\x1a\x0e\xbb\x1b\x17\xee\x26\x9e\x3c\x79\x33\xd9\x07\x30\x15\x86\xd2\xb8\x4c\xb1\x4c\xd4\xa4\xe9\xbb\x9b\x61\xab\xab\x31\xf1\xc4\xd7\xe1\x03\xfe\x7f\x48\x09\x03\x8d\x9e\x09\xc6\xcf\x4b\x88\x62\x90\x73\x7d\x41\xec\xea\xca\x8c\xb3\x98\xba\x32\x7d\x60\xa1\x8f\x0d\x29\xc6\x10\x57\xa5\xd9\xca\xa4\xd7\x55\x62\x1f\xf8\xad\xa0\x67\xb7\xdd\x15\x3f\x93\xa9\xeb\x2a\xa5\xee\x00\xef\x38\x44\x82\x23\xa6\x28\x9e\x1d\x02\xc3\x45\xbb\x4c\x10\x9a\x97\xb3\x15\x5a\x71\xe8\x72\x56\x1d\x7e\x04\x07\xc1\x8e\x5e\xd1\xb4\xf7\x81\x47\xef\xda\x47\xdb\xbf\x58\x47\x68\xbe\x68\xaf\x41\xab\xca\xa4\xf4\x57\xca\xb9\x5b\x22\x0d\xbe\xb7\x42\xe6\x1f\x69\x1b\x5f\xcf\xaa\xa6\x84\x77\x2f\xd3\x55\x3f\xf5\x13\xcd\x16\xc8\x19\xfa\x9a\x56\x3d\xa4\x04\xe2\x01\x25\x6f\x41\xdd\xd6\x73\xdf\x11\x6f\x6b\x2a\xd8\x0d\xde\x9e\xa9\xd7\x51\x4a\x88\x96\xb5\xc3\xd3\x0d\x9a\x55\x42\xd4\xcf\xde\xde\xa1\x69\x4f\xe5\x70\xdc\x3a\xfd\x16\xcb\xcf\x50\xaf\x3c\xd3\x3e\x6c\xa3\xb5\xe8\x97\x7a\x45\xfb\x6e\xa1\xa1\x8e\x3f\x02\x2a\xef\xeb\x6b\xda\xcf\x00\x00\x00\xff\xff\x36\x75\xd9\x8c\xfa\x01\x00\x00") func templateImportTmplBytes() ([]byte, error) { return bindataRead( @@ -549,12 +759,12 @@ func templateImportTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/import.tmpl", size: 625, mode: os.FileMode(420), modTime: time.Unix(1563979564, 0)} + info := bindataFileInfo{name: "template/import.tmpl", size: 506, mode: os.FileMode(420), modTime: time.Unix(1564432120, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templateMetaTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x56\x4f\x6f\xe3\xb6\x13\x3d\xcb\x9f\x62\x7e\xfa\x69\x01\x1b\xb0\xe5\xdd\x1c\x53\xf8\xb4\xdb\xa2\x41\x37\x8b\x6d\x37\xe8\x25\x08\x16\xb4\x38\x8a\xb9\xa1\x29\x97\xa4\x9d\x18\xaa\xbe\x7b\xc1\xbf\xa2\x1c\xd9\x41\x81\x9e\x6c\x91\x9c\x99\xf7\xe6\xcd\x0c\xd9\xb6\x40\xb1\x66\x02\x21\xdf\xa2\x26\x39\x74\xdd\x64\xd2\xb6\xa0\x71\xbb\xe3\x44\x23\xe4\x1b\x24\x14\x65\x0e\x45\xf9\x95\x54\x4f\xe4\x11\x5f\x1f\x61\xdb\x5d\x23\x75\x0e\x85\xdd\xaa\x1a\xa1\x34\x4c\x27\xd9\x72\x09\x9f\xc9\x1a\x39\x6c\x1a\x4e\x15\xe8\x0d\x82\xd2\x92\x89\x47\xe0\x76\x99\xa2\x68\xb4\xf9\x34\x3b\x6d\x0b\xbc\x79\x46\x09\x45\xf9\x85\x6c\x4d\x10\xd0\xc7\x1d\x02\x13\x76\x9b\x12\x4d\xd6\x44\x61\x39\xc9\x9c\xcf\x15\xe4\x6d\x0b\x45\xe9\xbe\xba\x2e\x9f\x64\x6d\x0b\x92\x88\x47\x84\xe2\xfb\x1c\x0a\x84\xeb\x15\x14\xe5\xcf\xf4\x11\x15\x74\x9d\x39\xec\xc2\x9a\x65\x2c\x3f\x1a\x94\x44\x68\x58\x74\xdd\x24\x33\xb6\xac\x36\xeb\x37\xea\x46\x1c\x50\x2a\xb4\x36\x8b\x60\x64\x6d\xfc\xce\x89\xa9\xe1\xd9\x7b\xef\xba\x7f\x49\x17\x23\x5f\xe6\x03\x23\x7d\xc4\x73\xe4\x0d\x50\xe4\x0a\xff\xeb\xd8\x6f\xc6\x14\xb4\xcf\x54\x1f\xce\xab\x80\x27\x32\xc4\xd3\x43\x49\x6a\x27\xc9\x2f\x0c\x0d\xc8\x85\x13\xa5\x36\x5f\x76\xa3\x3e\x15\xc5\x93\x73\x27\xc6\xc8\x9d\xa1\x55\x47\x5a\x07\x94\x1a\x5f\x60\x27\x9b\x1d\x4a\x7d\x3c\x43\xae\x8f\xe0\xf8\x28\x41\x9e\x30\x71\x93\xf7\x05\x52\x97\xbf\x12\xf5\x09\x6b\xb2\xe7\x1a\x7c\x3e\x16\x50\x50\xbf\xe2\x68\xf8\xfd\x71\x36\x34\x1a\x27\x7c\xc2\xe2\x81\xf0\x3d\x42\xdd\xc8\xc0\x28\xe1\x62\x41\x06\xc4\x89\x97\x88\xec\xee\xb8\xc3\xf2\xcb\x7e\x8b\x92\x55\x7e\xc3\xaf\xfa\x2f\x23\x8b\x25\xd9\xb6\xb0\x93\x4c\xe8\x1a\xf2\x77\xff\x3f\xe4\x09\xe6\xc0\x69\x20\x61\xfc\xef\x29\x94\x37\x9f\x7a\xa9\xde\xd4\x85\x51\x07\x7d\x24\xf9\x63\xce\x06\x12\x98\xcd\x5e\x84\xe5\x12\xee\xc8\x9a\x63\x12\x50\xdb\x6f\x61\x8e\x34\xf5\xb9\x41\xf2\x3a\xb0\x73\x13\x66\x88\xfb\xf2\xc5\xbb\xb8\x30\x44\x7a\x15\xd1\x19\xa5\xc0\x59\x8a\xc8\xfc\xeb\x51\x3a\x8b\x00\x47\x22\x27\x9a\x35\x62\x69\x9a\xae\xf4\x25\xe4\xa6\xcf\xed\xd5\xad\x39\x71\xb7\x41\x23\xd0\x96\xc8\x23\x3c\xe1\x11\x28\x56\x9c\x48\xa4\xb0\x46\xde\x3c\x97\x51\x4a\x5f\x0c\x23\x60\x62\x63\xfe\x81\x3c\xe5\x17\x62\xe1\x5f\x91\xb7\x31\x37\x95\xe3\xbe\xfe\x06\xd1\xf8\x2a\xe8\xb9\xfa\xc1\x77\x99\xb2\x15\x21\x2d\x5d\xef\x37\x8e\x18\xa1\x99\x3e\x96\xde\xf1\x8d\x06\x7c\x61\x4a\x2b\xa7\x0e\x53\xb0\xf3\xd7\x0b\x13\xd0\x48\x8a\x12\x74\x03\xe4\xd0\x30\x0a\x15\x93\xd5\x9e\x13\x09\x14\x77\x28\x28\x8a\xea\x08\xcf\x4c\x6f\x6c\xa4\x3c\x09\xd5\xdf\x50\x79\x70\x67\xe3\x5d\x66\xb1\x1a\xf8\x38\x4d\x56\x92\x69\x9b\x39\x93\x9e\xa8\xd4\x20\x4b\x1f\x1b\xbe\xdf\x8a\xb3\xf9\xa9\xec\xf6\xab\x99\x75\xa9\x30\xb2\x73\x8e\x07\xf2\xba\xed\x11\xc8\xc9\xff\xd9\x64\xb2\x5c\x82\x3b\xa9\x7c\x65\x12\xce\xe1\xdb\xef\x9f\x3d\x30\x05\x44\x8e\x76\x8f\x6d\x5e\x55\x4e\x0e\x44\x46\x07\x2b\xb8\x7f\x70\xbd\xde\x8e\x76\xf1\xfc\x55\x27\x0d\x67\x7f\x2c\xdd\x7a\xc4\xca\x43\x76\xaf\x0c\xab\x73\x61\xc6\x5a\xc8\xb8\xc1\x31\xf5\x4c\x2f\xb6\xea\xab\xbe\x32\x6b\xbd\x5c\x5f\x7f\x4b\x33\x4a\x04\x3d\x27\xe3\x95\xcd\xcc\xa9\x90\x6a\xa0\x64\x70\x9d\x76\xed\xb0\x17\x4e\x45\x86\xe9\xed\xd5\xed\xcc\xaa\x9c\x8d\x01\x4a\x52\x6c\xb4\x66\x82\xe2\xcb\x50\x71\x05\xef\x8d\xe8\x73\x38\xbb\xff\xc1\xec\xc7\x54\x0c\x2a\x39\x7c\xcc\x26\xfd\x34\x99\xf8\xab\xc4\xdc\x71\x7f\x12\xce\x28\xd1\x8d\xb4\xc9\xf4\x39\x77\xa5\xe0\x2e\x10\x33\x49\xa1\x28\xbf\x55\x1b\xdc\x12\xe8\xba\xd2\x96\x81\x67\xd9\x76\x5e\xe9\xe9\x2c\x7d\x04\xb0\xb1\x47\x80\xab\x04\xa7\x73\x5d\x26\x71\x17\x41\x45\x28\xec\x6c\x71\x97\x6b\x3c\x90\xee\xdb\x97\xcb\xf5\x0a\xe2\xb5\x56\xef\x45\x05\xd3\x77\x6a\x06\x28\x65\x23\xf3\x78\x13\x0e\xdf\x4d\x22\xdc\x10\x0a\x88\xb9\x7c\xbd\xe7\xa0\x5c\x3e\xb8\x81\x73\x7f\x05\x9b\xd9\xc5\x14\x54\x84\x73\x33\x92\x8f\xf6\xe8\x7a\xcf\x38\x45\xa9\x60\x8d\x75\x23\x11\x14\x39\xc4\x16\xf6\xf3\x76\x40\xee\x43\x40\x92\xa5\x38\x56\xbe\xdb\xee\xcd\x22\x83\xae\x7b\x48\x6c\xa6\xb3\xfb\xf7\x0f\xe5\x34\xf2\xed\xba\x99\x0f\x90\xbe\x08\x4f\xfd\xed\x45\x35\x9d\x41\x62\x04\xad\x3d\x96\x1d\x7a\x30\xd7\x6f\xc4\x75\x06\xb5\xb0\x27\xef\xcb\xb2\x7c\xb0\x6e\x07\x0f\x0c\x9f\xe9\xe0\x3d\x6d\xcf\x1f\x73\x28\x84\x31\x7d\xf1\x0b\x83\x4c\x78\xd8\x03\x44\x16\xc7\x0f\x8b\x63\x7a\x36\xd4\x6c\x9e\x84\x8a\xc5\x9d\x65\x99\xff\x91\xa8\xf7\x52\x40\x62\x1f\x7a\xf0\x22\x70\x23\xfe\xf7\x39\xd4\x16\xb1\x03\x6c\x98\x87\xed\xcc\xa8\x29\xa5\xcd\x99\x18\xfa\x9d\xfd\x64\x77\xfe\xb7\x02\xc1\x78\x6f\x10\x80\xa0\x94\x61\x29\x50\x0e\xbf\xfe\x84\x60\x3c\x65\xd0\x4d\xa3\xc0\xe9\xf3\x7b\xec\x69\x76\xda\xc6\xee\xef\x3f\x01\x00\x00\xff\xff\x07\xac\x00\x70\xde\x0d\x00\x00") +var _templateMetaTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x54\x5d\x6b\xdb\x3c\x14\xbe\x76\x7e\xc5\x79\xfd\xba\x60\x43\xea\x6c\xb7\x1d\xb9\x5a\x19\x2b\x8c\x32\x58\xd9\x4d\x29\x45\xb1\x8f\x1a\xb5\x8a\xec\x49\x4a\xda\x60\xf4\xdf\x87\xbe\x1c\x39\x4d\xd7\x5e\xd9\xd2\xf9\x78\x9e\xe7\x7c\x68\x18\xa0\x45\xca\x04\x42\xbe\x41\x4d\x72\x30\x66\x36\x1b\x06\xd0\xb8\xe9\x39\xd1\x08\xf9\x1a\x49\x8b\x32\x87\xa2\xfe\x49\x9a\x27\xf2\x80\xaf\x5d\xd8\xa6\xef\xa4\xce\xa1\x70\xa6\xa6\x13\x4a\x43\x39\xcb\x16\x0b\xf8\x41\x56\xc8\x61\xdd\xf1\x56\x81\x5e\x23\x28\x2d\x99\x78\x00\xee\xae\x5b\x14\x9d\xb6\x47\x6b\x19\x06\xe0\xdd\x33\x4a\x28\xea\x6b\xb2\xb1\x20\xa0\xf7\x3d\x02\x13\xce\xdc\x12\x4d\x56\x44\x61\x3d\xcb\x7c\xce\x25\xe4\xc3\x00\x45\xed\x4f\xc6\xe4\x0e\xcf\x5d\x5d\x5d\xd6\x5f\x2d\x07\x22\xb4\x4d\xf3\x0a\x7d\x82\xcb\x5a\xa0\x0c\x79\x7b\x02\xe8\x54\x32\x0f\xab\x04\x79\x42\x6f\x0c\x64\x73\xe7\x2e\x89\x78\x40\x28\xee\xe7\x50\x50\xb8\x58\x42\x51\x7f\xb3\xb9\x15\x9c\x1b\x63\xb3\x79\x24\x6b\xa0\x87\xac\xe7\xc6\xcc\xb2\x48\xde\x7b\xbc\xcb\xfa\x50\x2d\x3a\x96\x6b\x87\x52\xe3\x0b\xf4\xb2\xeb\x51\xea\xfd\x09\x41\xd9\x04\x61\x22\x85\x26\x42\xac\x1b\xa3\xf6\xee\x3b\x51\x97\x48\xc9\x96\x5b\xed\xce\x70\x0e\x45\x1b\x6e\xbc\x8c\x60\x3f\xad\xa6\x1d\x83\x13\x3d\xf1\x72\x47\xf8\x16\x81\x76\x32\x2a\x4a\xb4\x38\x92\x91\x71\x92\x65\x64\x76\xb3\xef\xb1\xbe\xde\x6e\x50\xb2\x26\x18\xc2\x6d\x38\xa1\x08\x22\x87\x01\x7a\xc9\x84\xa6\x90\x9f\xfd\xbf\xcb\x13\xce\x51\x93\xf3\x75\xbc\x8f\xfe\x93\x76\x2a\xdd\x49\x3b\xfb\xae\xa9\xbf\xc2\x21\xc6\x17\x7a\xd3\x73\x6b\x8a\x40\x2d\x23\x1c\x1b\xbd\x38\x53\x0b\xbb\x55\x8b\x26\x54\x47\xe5\x87\x4c\x31\xf8\x65\xdc\x23\x9f\xc6\x2d\x51\x36\x2a\x98\x55\x6e\xd9\x3e\x42\xe5\x23\x4c\x76\x44\x32\xb2\xe2\x78\xcc\xc4\x17\x76\x4d\xd4\xcd\x94\xcd\x47\x59\x1e\xfe\x66\xa1\x47\x76\x78\x7e\x13\xce\x5a\xa2\x3b\xa9\xac\x65\x47\xa4\x7d\x16\xa8\x5f\x09\xd7\x19\x3b\x98\x56\x45\xb3\xc6\x0d\x01\x63\x6a\xb7\x73\x61\x0a\x06\x13\xd6\xa7\xac\xd2\x76\xb0\x53\xdb\xe5\x59\x3e\x33\xbd\xb6\x0d\x4e\x70\xbd\xcd\xd5\x46\xd8\xb4\x7e\x6a\x47\x87\xd4\xee\xde\x9b\x8b\x25\x8c\xc5\xa3\x5b\xd1\x40\x79\xa6\x2a\x40\x29\x3b\x99\x8f\x23\x16\x82\xc2\x94\x8b\x30\xb4\x4c\x01\xb1\x53\x1d\x32\xc7\xc9\xce\x27\xa3\x9d\x87\xd9\x86\x2b\x6d\x03\x1a\xc2\x39\xb6\xb0\xda\x3b\xd7\xd5\x96\xf1\x16\xa5\x82\x15\xd2\x4e\x22\x28\xb2\x73\x7b\x1b\xda\x83\x7f\x8e\xc4\x7d\x8e\x4c\xb2\x94\xc7\xd2\x43\xa8\x5b\x7b\xc9\xc0\x98\xbb\x24\xa6\xac\x6e\x3f\xdd\xd5\xe5\xa8\xd7\x98\x2a\x00\x20\x57\xf8\x56\xbe\xad\x68\xca\x0a\x92\x20\x18\x9c\x5b\xb6\x3b\x90\xb9\x78\x07\xd7\x07\x50\xe1\x3c\x6f\xeb\xba\xbe\x73\x69\x27\x9b\x1b\x2a\x1d\xb3\xbb\x07\x27\xb4\xfd\x71\x0e\x85\xb0\xa1\x2f\xe1\x62\x52\x89\x40\x7b\xc2\xc8\xf1\x78\x74\x3c\xca\x37\xa1\xaa\x79\x02\x15\x46\xd8\x9d\xc3\x47\xa2\xde\x4a\x01\x49\x7c\x7c\xa3\xfe\x49\xdc\x36\xff\x7e\x0e\xd4\x31\xf6\x84\xad\xf2\x68\xce\x6c\x37\xa5\x74\x35\x13\xd3\xbc\xd5\x17\x67\xf9\x6f\x09\x82\xf1\x43\x40\x24\x82\x52\xc6\xab\x28\x39\x7e\x83\x87\x60\x3c\x55\x60\xca\xb1\xc1\xf1\x69\x7b\xeb\xcd\xab\x8e\xd6\xd8\xff\xfe\x0d\x00\x00\xff\xff\xce\x02\xbd\xcc\x23\x08\x00\x00") func templateMetaTmplBytes() ([]byte, error) { return bindataRead( @@ -569,7 +779,7 @@ func templateMetaTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/meta.tmpl", size: 3550, mode: os.FileMode(420), modTime: time.Unix(1558789265, 0)} + info := bindataFileInfo{name: "template/meta.tmpl", size: 2083, mode: os.FileMode(420), modTime: time.Unix(1564435072, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -614,7 +824,7 @@ func templateMigrateSchemaTmpl() (*asset, error) { return a, nil } -var _templatePredicateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x52\xc1\x6a\xdc\x30\x10\x3d\x5b\x5f\x31\x88\x2d\xd8\x65\x6b\x93\x1c\x17\x7a\xeb\x39\x04\x92\x7b\xd1\x4a\xa3\xb5\x88\x2c\x79\x47\x63\x87\x62\xf4\xef\x45\xf6\x76\xc9\x66\x9b\x93\xcd\xcc\x9b\xf7\xde\x3c\xcd\xb2\x80\x41\xeb\x02\x82\x1c\x09\x8d\xd3\x8a\x51\x42\xce\x42\x2c\x0b\x30\x0e\xa3\x57\x8c\x20\x7b\x54\x06\x49\xde\x81\xdc\x30\x46\x62\xa8\x45\x25\xed\xc0\x52\x94\xef\x51\x77\x18\xb8\x33\x4e\x79\xd4\xdc\x9d\x08\x07\xef\x42\x77\x22\x35\xf6\x9d\x49\x5e\xfe\x07\x94\xce\x5e\x8a\x66\x15\x25\x15\x4e\x08\xbb\xdf\x7b\xd8\x05\x38\xfc\x84\x5d\xfb\x14\x0d\x26\xf8\x91\xb3\xe8\x3a\x58\x16\xd8\x85\xf6\x49\x0d\x08\x39\x83\x4b\xc0\x3d\xc2\xd5\x15\xd8\x29\x68\x76\x31\x80\x8d\x74\xc1\x3e\x2b\xfd\xa6\x4e\x2b\xfc\x38\x39\x6f\x90\x52\x2b\xf8\xcf\x88\x9f\xb8\xca\x68\xed\x02\x23\x59\xa5\x71\xc9\x8d\xb8\xd3\x7b\x46\xfa\xb5\x39\x06\x1d\x43\x62\x9a\x34\x83\xfa\x28\x1f\x09\x8e\x91\x7b\xb8\x6c\x0d\x4c\x6a\x46\x4a\xca\x83\x0a\x06\xd2\xd9\x43\xc2\x32\x1f\xa9\x15\x45\xf0\x2b\xfe\xda\x3e\x6c\x86\xbe\xa7\xb3\x6f\x5f\x2e\x33\xcd\x1e\xec\xe3\xa5\x6e\x92\x6f\x5f\xff\xb1\x37\xcd\xa7\x65\x16\x51\x11\xf2\x44\xe1\xb6\x5e\xaf\x9a\xf5\x0c\x1f\xf7\x2c\xe0\x2a\xbd\x3b\xd6\x3d\xcc\x25\xf2\xb9\xad\x4b\x3e\x5b\x43\xab\x84\x70\xe3\xe2\x20\xaa\xaa\xb2\x0f\xf5\xdc\x5c\xdb\x37\x66\xb6\xfe\xe3\xd6\x37\x68\xd5\xe4\x79\xad\x8d\x2a\x38\x5d\xdb\x81\xdb\x97\x91\x5c\x60\x5b\xcb\x29\xbc\x85\xf8\x1e\x60\x7d\x8f\x92\xde\x35\xcb\x03\x7c\x7b\x95\x7b\x98\x9b\xc2\x92\x45\x95\x1b\x91\xcb\x7d\x60\x30\xe5\xf4\xae\x7f\x7f\x03\x00\x00\xff\xff\x04\xd0\xea\x6c\xc2\x02\x00\x00") +var _templatePredicateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x91\xc1\x6e\x9c\x30\x14\x45\xd7\xf6\x57\x5c\x21\x2a\x19\x69\x02\xed\x36\x52\x37\x55\xd7\x51\xa4\x74\x5f\x79\xec\x67\xc6\x0a\x18\x6a\x1b\xd2\xca\xf2\xbf\x57\xc0\x84\x99\x66\x12\xa9\x2b\x10\x5c\x5f\xbf\x73\x5e\x4a\xd0\x64\xac\x23\x14\xa3\x27\x6d\x95\x8c\x54\x20\x67\xce\x53\x42\xa4\x7e\xec\x64\x24\x14\x27\x92\x9a\x7c\x71\x13\xb2\xfd\x38\xf8\x08\xc1\x59\x61\xfa\x58\xf0\xe5\x79\x54\x0d\xb9\xd8\x68\x2b\x3b\x52\xb1\x69\x3d\xf5\x9d\x75\x4d\xeb\xe5\x78\x6a\x74\xe8\x8a\x77\x42\xe1\x57\x57\xf0\x6a\xbd\xd4\x4b\xd7\x12\xca\x9f\x07\x94\x0e\xf7\x5f\x51\xd6\x0f\x83\xa6\x80\xbb\x9c\x79\xd3\x20\x25\x94\xae\x7e\x90\x3d\x21\x67\xd8\x80\x78\x22\xec\x53\xc1\x4c\x4e\x45\x3b\x38\x98\xc1\x9f\xb3\x8f\x52\x3d\xcb\x76\x8d\x1f\x27\xdb\x69\xf2\xa1\xe6\xf1\xcf\x48\x6f\xba\x96\xa3\x22\x25\x58\x83\x36\x42\x74\xe4\x50\xd6\x4f\x71\xf0\xb2\xa5\x0a\x5f\x90\xb3\x75\x91\xbc\x91\x8a\x52\x4e\x09\xd4\x85\xe5\x5c\x4a\x10\xd6\x69\xfa\x7d\x49\xe3\x73\x55\x7f\xdb\xae\xda\x02\xe4\x34\x72\xde\xf8\x3e\xae\xbf\xc1\x7b\x24\xff\x7d\x13\x04\x35\xb8\x10\xfd\xa4\x22\xe4\x35\xed\xe0\xb1\x7a\x45\xf4\x72\x26\x1f\x64\x17\x70\x94\x81\x34\x06\x87\xb3\x5c\x2c\xac\x35\x5f\xf0\x3e\xaa\x17\x17\xef\xf6\x80\x32\x9c\x31\x56\xfb\xaf\x4c\x2b\x88\x35\x28\x2d\x72\x3e\xec\x50\x66\xa9\xb4\xd7\xfe\x5e\x8f\x5f\x29\xa8\x2e\x0e\xde\x48\x4f\x9c\x79\x8a\x93\x77\xff\x7e\x17\xeb\xb4\x62\xc6\x95\xf2\x6a\x09\xb3\xf0\x62\xa3\x3a\x61\x5e\x86\x9b\x6b\xb1\xb0\x6d\x3f\x52\xba\xfb\x0f\x06\xce\x98\x92\x61\x5b\xfd\xed\x9c\xf7\x9c\x31\xb6\x13\x89\xb9\x3a\xf7\x6e\xb3\x73\xc6\x34\x19\x39\x75\x71\xcd\x8d\xd2\x59\x25\x4c\x1f\xeb\xa7\xd1\x5b\x17\x8d\x28\x26\xf7\xec\x86\x17\xb7\x1a\x5f\x97\xb3\xaf\xea\x1e\x9f\x7e\x14\x07\xcc\xd5\x52\x99\x39\xcb\x15\xcf\x7c\xb7\xf2\xde\xdb\xdf\x00\x00\x00\xff\xff\x24\x8b\xe8\xd9\x9a\x03\x00\x00") func templatePredicateTmplBytes() ([]byte, error) { return bindataRead( @@ -629,7 +839,7 @@ func templatePredicateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/predicate.tmpl", size: 706, mode: os.FileMode(420), modTime: time.Unix(1564012743, 0)} + info := bindataFileInfo{name: "template/predicate.tmpl", size: 922, mode: os.FileMode(420), modTime: time.Unix(1564434863, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -654,7 +864,7 @@ func templateTxTmpl() (*asset, error) { return a, nil } -var _templateWhereTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x59\x5f\x6f\xdb\x38\x12\x7f\x96\x3f\xc5\xc0\x70\xb1\x52\xe0\xd2\x6d\xda\xbe\x2c\x90\x03\xf6\x36\xe9\xd5\x77\xdb\xb8\x7b\x2d\xba\x0f\x45\x11\x30\xd2\x28\xe6\x56\x26\x55\x92\x76\x50\xa8\xfe\xee\x07\x92\x12\xf5\xdf\x71\xd0\x6c\xee\x65\xfd\x64\x49\xa3\xf9\xf3\x9b\x99\xdf\x8c\xa4\xa2\x80\x04\x53\xc6\x11\xa6\xb7\x6b\x94\x38\x85\xfd\x7e\x32\x29\x0a\xd0\xb8\xc9\x33\xaa\x11\xa6\x6b\xa4\x09\xca\x29\xcc\xc8\x3b\x1a\x7f\xa1\x37\xd8\x17\x61\x9b\x5c\x48\x3d\x85\x99\xbd\xb4\x58\xc0\xf2\x1c\x52\x96\x69\x94\x0a\x76\x28\x35\x8b\x51\xc1\x35\x55\x98\x80\xe0\xa0\xd7\xc8\x24\xb0\x04\xb9\x66\x29\x43\x49\x26\xe9\x96\xc7\xb0\x3c\x0f\x59\x02\x45\x01\x33\xb2\x3c\x27\x1f\xbe\xe5\xc6\x50\x04\xb9\xc4\x84\xc5\x54\x23\xb1\x97\x2e\xe9\xc6\x9c\x87\x62\x12\x48\xd4\x5b\xc9\x47\x04\xde\xa1\x3c\x67\x34\xc3\x58\x87\x93\x20\x30\x06\x42\x05\x27\xea\x6b\x46\xde\xa3\x39\x2b\x64\x64\x74\x04\x41\x51\x3c\x05\x96\x3a\xa3\x4b\xf5\x5e\x4b\xc6\x6f\x60\xbf\x67\xc9\x1c\xae\xe0\xe7\x33\x50\x5a\xc6\x82\xef\xc8\x2f\x5a\xb0\x90\x25\x91\x91\x47\x9e\x98\x48\x83\x20\x50\xe4\x0f\x03\x5b\x68\x14\x5f\xfc\x1e\x2a\xf2\x6b\x58\x45\xf0\xab\xe0\x4a\x53\xae\x4d\x14\x73\x60\x49\x14\x4d\x82\x60\x3f\xaf\xbc\xd1\x70\x92\xa8\x8c\x7c\x90\x74\x87\x52\xd1\xac\x74\x47\x93\x37\x54\x59\x28\x2a\xf1\x68\xe2\xe0\x96\x94\xdf\x20\xcc\xae\xe6\x30\x13\xb9\xf1\x4c\xe4\xca\x5a\xb2\xae\x18\xab\xd2\x9c\x9d\xb2\xc4\x24\xb1\x28\x6c\x54\x22\x27\x1f\xa9\x64\x34\x61\xb1\x3b\x39\x93\x60\x65\x54\x29\x54\x85\x62\x2e\xd9\x34\xfc\x7c\x06\xb9\x64\x5c\xa7\x30\x5d\x9e\x3f\x51\x53\xab\xa3\x04\x75\x12\x2c\x16\xe0\x25\xf7\x7b\xa0\x79\x9e\x31\x54\x26\xa5\xf6\x7c\x2d\x5a\xa7\xa5\x4c\xb9\xab\x09\xcc\x12\x32\xb1\x00\x34\xf5\x84\xce\x31\x93\xd6\x21\xb7\x09\x21\xde\xd3\x7b\xd4\xc7\x7d\x0a\xe4\x50\x85\xf8\x12\x69\x7b\x65\x2f\x19\x40\x58\x0a\x5c\x68\xa0\xf2\x66\xbb\x41\xae\x15\xdc\xa2\x44\xc8\xa5\xd8\xb1\x04\x93\xb9\x01\xc9\xf8\x6e\x30\x78\xfd\xcb\x6f\xef\x2f\x20\x2e\x2b\x43\xcd\xbd\x0e\xc5\x78\x8c\x70\x8b\x10\x53\xfe\x93\xb6\xb8\x7e\x83\xe9\xf2\x12\xc2\x68\x4a\xe0\xc3\x9a\x29\xb8\x65\x59\x06\x1b\xfa\x05\x41\x9b\xc3\x1a\xdf\x94\x66\xea\x1b\x71\xaa\x58\x0a\x19\x72\x8f\x67\x04\x67\x67\xf0\xac\x0c\xa3\x5d\xad\xaf\x69\xa6\x30\xb4\x45\x69\x7e\x0e\x2b\x77\x50\x86\xb6\x33\xb5\x60\x0c\x86\x9f\x3e\x33\xae\x51\xa6\x34\xc6\x62\x3f\x6f\x5b\x28\x15\xa4\x42\x02\x33\x37\xb8\x32\xdd\x79\x9b\x65\x46\x3b\xed\xb5\xfb\xc4\x3e\x9b\x06\xeb\xf4\x57\xa5\xf5\x13\xfb\x1c\x99\x94\x67\x0a\x4b\x61\x38\x83\xc6\xc5\x46\xe1\xd6\x0e\xdb\xce\x34\x77\x0c\xd8\x2b\x23\x1a\xea\x69\x1f\x49\xad\xa4\x56\xdd\x44\xac\x5d\xe0\x07\x7a\x7d\x77\x67\x15\x3b\xd4\x2c\x19\x1c\x64\x83\x83\xa5\xf7\x30\xf9\xe9\x83\xdb\xc3\xb4\x86\xa3\x62\xa7\xbc\x02\xe3\x5f\x12\x37\x19\xe3\x65\x0f\xf7\x3d\xdd\x95\x51\xbb\x44\x56\x46\x86\x70\x88\x26\xc1\x7e\x52\xe7\xb5\xc3\x78\xa9\x71\x7d\x46\x5e\x1b\x02\x51\x7d\xc2\xa2\x2a\xa6\x19\xcc\xd2\x3b\x89\x0a\xbf\x6e\x69\xc6\xf4\x37\x88\xd7\x18\x7f\xe9\x93\x54\x51\xc0\xd7\xad\xd0\xd8\xd0\x55\xb2\x16\x2c\xf5\x4f\xaa\x9c\x5a\xc6\x98\x16\x4d\x03\x17\xbf\x0f\xd1\xda\xce\x1d\x3d\x2a\x59\x8d\x4c\xa4\xb4\x5b\xa3\x47\x97\xa0\xcd\x79\xf8\x1b\xbd\xc6\x6c\x0e\x3d\x55\x73\xc8\x8d\x99\xdd\x8f\x65\xb2\x37\xdb\x42\x3b\xdc\xd2\xa8\x33\xdb\x76\x77\x8f\xb6\xdd\x9d\x93\x0d\xc2\x76\xbd\x44\x10\x56\x7d\x1d\xfd\xe8\x90\x1b\xaf\x9f\x1f\x9e\x7a\xc7\x95\xd1\x38\x61\xdc\x83\x2e\x46\xc8\x62\x98\x2a\xf6\x93\x0e\x4d\xfc\x3d\x76\x7f\x64\xec\xde\x7f\x00\xf5\x5a\xfb\xe1\xc6\xcf\xdd\xbd\xdf\x9f\x03\xf7\x32\x6f\xb9\x22\xa8\xbb\x75\x94\x36\xd0\xd1\xc6\x45\x72\x83\xe3\xfc\x8f\x0e\x9b\xef\x7e\x83\x7d\x43\xd5\x13\xcb\x07\x4e\x3e\x33\x81\x58\x45\xd8\x8c\xc3\x5d\x4c\x98\xc4\x58\x33\xc1\x2d\xd3\xac\xb6\xba\xbe\x8f\x71\x03\x0b\x5e\xb5\x45\x96\xdc\x4b\x98\x78\x91\x2c\xd5\xd2\x09\xba\xe4\x15\x45\xd0\x50\xda\xb8\x61\x44\x67\xd3\x6a\x50\x14\x8b\x13\xa0\x3b\xc1\x12\x88\x99\x8c\xb7\x19\x95\x90\xa0\xa9\x68\x8c\x0d\x19\x9d\x2c\xbc\x26\x17\x95\x0d\xaa\xb4\xdf\x8d\xad\xaa\xa7\x03\xc4\xf6\x86\x2a\x83\xed\x21\x46\x43\x4f\x34\x98\xdc\xe0\x10\xa1\x3d\xea\x36\x8e\xe4\xed\xe9\x5b\xf0\x8c\xa0\x9f\xdb\xcd\x8e\x7c\xa0\xd7\x19\x86\x65\x7f\x55\xdd\x53\x35\xe2\xd7\x8c\x2c\x79\x75\x14\xe8\xe7\x63\x2b\x5c\x25\x51\xdb\xb7\x72\x48\xde\xfd\xa7\x21\xf7\x69\x30\xf3\xcf\xeb\x7d\xe7\x99\xc7\xfe\x73\x44\x5e\x4b\xb1\xb1\x6d\xec\x3c\x74\xfa\xec\xff\xa6\x69\x6f\xbb\xfa\x13\xf5\x76\x5b\x21\x5d\xf0\x2b\x08\x29\x4f\xcc\xff\xd5\xe9\xaa\xe5\x45\x64\x47\xc6\xe2\x04\x8c\xd0\xf7\xef\x10\x1a\x81\x5b\xa6\xd7\x50\x56\x9d\xcd\x60\x54\x15\xd1\x5d\xe8\x19\xa7\x2f\x85\xbe\xdc\x66\x59\xe8\x31\x33\x1d\x94\x6d\x37\xbc\xe5\x7c\xc7\xd9\xd2\x8b\xd5\xe9\xdb\xb6\x17\x54\x29\x11\xdf\xcf\x87\x07\xcb\x60\xdf\x6b\x52\xc9\x06\x47\xa6\xa8\xbe\xa1\x8f\xcf\x28\x34\x07\xf2\xea\xd9\xfe\xc8\x07\x82\xc5\x89\x29\x03\x66\xf6\x51\xca\x2d\x8c\x0e\x56\x85\x59\xfa\x54\x62\x8a\x12\x79\x8c\x73\xd0\x6e\x6a\x21\xe8\x5b\x51\xbf\x87\xf1\x80\xd7\x8d\xf4\x1e\xb3\xf4\xbf\x98\xd6\xbd\x44\xfe\x29\xf4\x3a\xac\xc9\xa5\xf5\x74\x94\x55\x04\x67\x25\xdb\xd4\xb9\xdf\x5f\xb4\x6f\xeb\x5d\xff\x18\x8e\x46\xee\x87\x81\x23\x94\xfa\x45\xc4\x13\xf5\x07\xd3\xeb\xa9\x27\x9a\x87\x65\xb2\xb2\x26\xe1\x86\xed\x90\x9b\x2d\x21\x61\xc6\x57\x05\xa1\xd0\x6b\x94\xb5\x22\x15\x0d\x91\x9e\xb9\xac\x80\x10\xd2\x66\x36\xb4\xeb\x5a\x65\xe8\xff\xc9\x8c\x76\xda\x98\xd6\x7a\x5e\x6e\x92\x7f\x9a\x83\x67\xf6\xe0\xe9\x00\x81\x39\xf9\x4a\xc2\x88\xfb\x5b\x4d\xc2\x9e\x1e\xec\x57\x7d\x6a\x4f\xfa\x1e\xf2\x6f\x01\xac\x25\x8e\x30\x73\x17\x3c\x40\xee\xc8\x2b\x75\xee\xfa\x49\xd6\x6d\xbe\x86\x3a\x5b\x87\x8d\xfb\xac\x68\xf3\x7a\xd3\xd7\xca\xbb\x17\x6d\xef\x46\x3a\xbc\x14\x7e\x59\x09\x97\x04\xa2\x5f\x78\xee\xeb\xcd\x81\xd9\x9f\x96\xe5\x3d\x37\x58\x2a\xd1\x2f\xfc\xf1\xbf\x05\xe3\xa1\x3e\xf5\xc7\x2b\x7e\x58\x1d\xb3\xea\xe6\xa0\x4f\xbd\x90\x85\xab\xc3\x73\x95\xab\xaf\x3a\xae\x96\xe3\x46\x9f\x36\x1e\xff\xaf\xe6\x90\xd7\x4b\xbd\x2b\xdb\x6a\x45\xcd\x43\xfd\x2a\x6a\xbd\xfd\xd1\x2f\xad\x8a\x2a\xf4\x57\x03\x33\x61\xc9\xc3\x71\x02\x06\xfd\xb2\x3b\x0e\x1e\x73\x76\xd5\x75\xd8\x62\xff\x21\x0c\xbb\x93\xf9\xf1\x4a\x76\xb8\xfc\x46\x6b\xf8\xf8\x5c\x9e\xb6\x73\x39\x96\xb4\xa1\x41\x65\x4a\xee\x2f\x98\xe3\x23\xf9\x18\x98\xc6\x47\x0e\xe1\x87\xc6\x62\xa0\x80\x5b\x38\xdc\x77\x48\x77\x27\xab\x45\xd0\x4c\x68\x89\x29\x6c\x90\x72\x05\x4c\x83\x5a\x8b\x6d\x96\xc0\x35\x82\x96\x5b\x04\xc6\x41\x70\x04\x91\xda\x81\xe5\xc7\x66\x63\x68\x07\x8c\xcf\x41\x6c\xb5\x09\xf8\xea\x8a\x2c\xf9\xc7\x30\x9a\x9b\x7f\xab\xad\xae\x46\xeb\x11\xa8\x30\x1e\xf9\xff\x62\xab\x3b\xad\xdf\xde\xb9\x8c\x72\xe9\x57\x2e\x67\xaa\x3b\xe5\xdd\x0d\x8c\xd7\x8b\x97\x75\x6e\x58\xcc\x18\xbc\x63\xcd\xf5\xb5\x24\xcb\x40\x87\x1f\x99\xea\x75\xe2\x98\x4a\x90\xdd\x30\xef\xda\x5d\x9c\xbb\x5a\xde\x7f\x8b\x69\x3c\xc7\x4e\x16\x0b\x58\x49\xb8\x91\x62\x9b\x2b\xc8\x98\xd2\x26\xbf\xf5\x52\xe1\x5a\xc9\xe4\x5b\x48\x10\x39\x4a\xaa\x85\x84\x6b\xd4\xb7\x88\x76\x71\xd9\x94\x1f\xc8\x56\x32\x6c\xdc\xd5\x5b\x38\x8e\x59\x35\x1e\xe6\x93\x99\x7d\x3d\xd4\x83\xba\xf4\xcb\xe1\x6d\xf6\x53\xf8\x47\xfd\x0e\x44\x99\x12\x72\x90\x39\xf4\xf3\x50\x45\xd5\xdb\xa3\xc6\x47\x31\x39\xf2\x55\x4c\xaa\xb1\xb7\x57\xcf\xdc\x0b\xac\xc6\x92\xe6\x5f\x61\xf5\xcb\xa1\xe5\x63\xd5\x43\x97\x78\x5b\xba\x96\x87\x65\x27\x18\x7b\x67\xe5\x1b\xa4\x50\x4b\x35\x07\xed\xbd\x0d\xb4\x2c\x0b\xc3\x35\x86\x96\x8a\x10\x12\xb5\x3e\xd7\x2d\x16\x70\x29\x74\x6b\x2d\xe5\x42\xd7\xd9\x2d\x37\x52\xb7\x71\xd6\xd9\x70\x79\xbe\x14\x3a\xcc\x47\x72\xf4\xd7\x27\x37\x0f\x95\x79\x98\x09\xbb\x9f\x2b\xc7\x32\xd3\x05\xb1\xc2\xb0\x89\x92\xd1\xa7\xa3\xee\x07\xcd\xb2\x41\xfe\x17\x00\x00\xff\xff\xe8\xf0\x8b\x6d\x83\x1e\x00\x00") +var _templateWhereTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xe4\x97\x51\x6b\xe4\x36\x10\xc7\x9f\xed\x4f\x31\x18\x87\xda\x90\x93\xe9\x6b\xe1\x1e\x0a\x7b\xe5\xf6\x25\xb9\xd2\xd2\x3e\x84\x50\x74\xf6\xd8\x16\xf1\x4a\x3a\x49\xeb\xdc\xa1\xfa\xbb\x17\x49\x5e\xdb\x39\xef\xde\x65\x49\x42\x1b\xfa\xb8\xd6\x68\x34\xf3\xff\xff\x34\x8b\xac\x85\x0a\x6b\xc6\x11\x92\xfb\x16\x15\x26\x30\x0c\x71\x6c\x2d\x18\xdc\xc9\x8e\x1a\x84\xa4\x45\x5a\xa1\x4a\x20\x25\x1f\x68\x79\x47\x1b\x5c\x87\xb0\x9d\x14\xca\x24\x90\xfa\xa5\xa2\x80\xed\x06\x6a\xd6\x19\x54\x1a\x7a\x54\x86\x95\xa8\xe1\x23\xd5\x58\x81\xe0\x60\x5a\x64\x0a\x58\x85\xdc\xb0\x9a\xa1\x22\x71\xbd\xe7\x25\x6c\x37\x19\xab\xc0\x5a\x48\xc9\x76\x43\x7e\xff\x22\xdd\x41\x39\x48\x85\x15\x2b\xa9\x41\xe2\x97\xae\xe8\xce\x7d\x07\x1b\x47\x0a\xcd\x5e\xf1\x13\x01\xd6\x02\xab\xa1\x31\x90\x75\xc8\x21\x25\xbf\x19\xa1\x68\x83\x39\xfc\x08\xc3\xf0\x01\xd5\x86\xd1\x0e\x4b\x63\x2d\x20\xaf\x60\x18\xb2\x38\x8a\xac\x05\x45\x79\x83\x90\xfe\x75\x09\xa9\x0e\x3b\xe0\xa7\xb7\xf3\x76\x78\x33\x0c\x71\xe4\x23\x53\xb3\x93\x9d\x5b\x94\x8a\x71\x53\x43\x52\x85\x8c\xc5\x85\x2e\xa6\x92\x0a\x56\x25\x73\xa6\xc3\xde\x37\xf0\x79\xd2\x2e\xa4\x71\xc2\x5d\x86\x0a\x5c\x39\xfe\x94\x3c\x0e\x32\x2f\x4a\x12\xd2\x1d\x28\xa4\xf6\x1a\xf9\x7c\xae\x12\xaa\x1a\xf7\x3d\x71\x87\x1d\x3a\x4f\x85\x24\x7f\x50\xc5\x68\xc5\xca\xf0\xd1\x87\xf9\x28\x3d\x86\x85\xce\x43\x0e\x6f\xc1\xa2\x9b\xed\xe6\x42\x27\x3e\xcb\x28\x68\x1c\x15\x05\x4c\x91\xc3\x00\x54\xca\x8e\xa1\x76\x76\xfa\xef\x73\xe8\x6c\xc9\x68\x77\xe0\x01\xbb\x8a\xc4\x91\xdf\xbe\xc8\x93\x1d\x4a\x73\xa6\x1e\x2b\x9d\x10\x32\xd5\x7a\x06\x1d\xcf\x8f\xc7\x19\x7c\x78\x93\xef\x99\x69\x01\x3f\x1b\x97\x21\x85\xe4\x67\xd5\x24\xa1\xd3\xe4\x5a\x7a\x69\xa7\xe8\x73\x78\x2a\x84\xd4\x2b\xa6\x8e\x53\x45\x46\xaa\x1e\x72\xf5\xd5\xaf\x3c\x8e\x86\x78\x86\xe1\x2b\xe2\xea\xd0\xde\x2f\xce\x3c\xbd\x86\x85\xea\x92\x76\x90\xd6\xdf\x85\x04\x3f\xed\x69\xc7\xcc\x17\x28\x5b\x2c\xef\xd6\x80\x58\x0b\x9f\xf6\xc2\x55\x3e\xe5\x1a\x89\x81\xad\xf9\x41\x8f\xd3\xc2\x1d\x66\xc4\xf2\x80\x77\xbf\x1e\x43\xaa\x0f\xbf\x5e\x25\x26\x5e\xea\xc4\x29\x7f\x3e\x1d\xf5\xb8\xf7\xdf\x84\x63\x35\xae\x32\x3f\xaf\xea\x7c\x35\xae\xfa\xc7\x4c\xab\xfe\xbb\xc3\x0a\xb2\x87\x18\xe6\x90\x1d\x66\x51\xfe\xd4\xb9\x75\x1a\xcb\x67\x18\x64\x8f\xe3\xd3\x79\xb7\xce\xe5\x9c\xea\x9d\x04\x3b\x7a\x87\xd9\xcd\x2d\xe3\x06\x55\x4d\x4b\xb4\xc3\x25\x74\xc8\x17\xc5\xe4\xb9\x0b\xae\x85\x02\xe6\x36\x04\x7f\x7a\x9f\x3b\x8a\xfa\x1b\x76\x0b\x6f\x61\x8e\xbe\x61\xb7\x6e\x61\x18\x4f\x3e\xa8\xfe\x9f\xbb\x26\x8b\x69\x3a\xdf\x98\x27\x0c\x56\xef\xea\x8b\xcc\xd6\x68\x86\xf7\xe4\x4d\x1a\xfb\x7e\x57\x35\x78\x7a\xca\x62\x90\xfb\xef\xa9\x91\xf7\x54\x5f\xf8\xeb\xf1\x4d\xc6\xdf\x53\xed\xf2\x7e\x0b\x6e\x9c\x88\xc3\xaa\xc1\x63\x6c\xbf\xaa\x11\xea\xda\x4d\x9c\xa8\xe7\x63\xe0\xfa\x2f\x5a\xfa\x32\x14\x04\x35\xe7\x0a\x2e\xf4\x9f\xcc\xb4\xc9\xa4\xf2\xf3\xda\x18\x54\xa1\xd0\xb0\x1e\x39\x94\x82\x57\xcc\x30\xc1\x35\x64\xc2\xb4\xa8\xe6\x44\x3a\x3f\xe6\xb8\x5b\xd6\x40\x08\x79\x68\x2b\xfa\xa1\x75\x38\xe8\xff\x86\xc5\x7d\xf0\xeb\xc5\xfe\x5f\xdd\xdb\xe9\x5a\x41\xa3\xc4\x5e\x6a\xe8\x98\x36\x20\xea\x85\x53\xa1\x25\xe7\xba\x50\x20\x24\x2a\x6a\x84\x82\x8f\x68\xee\x11\x3d\x0d\xbb\xf1\x31\x75\xad\xb2\xc5\xae\x95\x8b\x8f\xf1\xef\x35\x3c\xaf\x84\x7a\xd4\xf3\x8a\x9c\x7a\x5e\x15\x05\x5c\x09\xf3\xe0\x9e\x71\x61\x66\x65\xc7\x2b\x16\xae\xd0\xac\x44\xd0\xf8\x4a\x98\x4c\x9e\xd0\xe7\xb5\x0b\xcb\x85\x79\x9a\xb2\x33\xd4\xff\x04\x00\x00\xff\xff\x7c\xd4\x48\xd3\x63\x10\x00\x00") func templateWhereTmplBytes() ([]byte, error) { return bindataRead( @@ -669,7 +879,7 @@ func templateWhereTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/where.tmpl", size: 7811, mode: os.FileMode(420), modTime: time.Unix(1563979564, 0)} + info := bindataFileInfo{name: "template/where.tmpl", size: 4195, mode: os.FileMode(420), modTime: time.Unix(1564425091, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -726,35 +936,45 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ - "template/base.tmpl": templateBaseTmpl, - "template/builder/create.tmpl": templateBuilderCreateTmpl, - "template/builder/delete.tmpl": templateBuilderDeleteTmpl, - "template/builder/query.tmpl": templateBuilderQueryTmpl, - "template/builder/setter.tmpl": templateBuilderSetterTmpl, - "template/builder/update.tmpl": templateBuilderUpdateTmpl, - "template/client.tmpl": templateClientTmpl, - "template/config.tmpl": templateConfigTmpl, - "template/context.tmpl": templateContextTmpl, - "template/dialect/gremlin/create.tmpl": templateDialectGremlinCreateTmpl, - "template/dialect/gremlin/delete.tmpl": templateDialectGremlinDeleteTmpl, - "template/dialect/gremlin/group.tmpl": templateDialectGremlinGroupTmpl, - "template/dialect/gremlin/query.tmpl": templateDialectGremlinQueryTmpl, - "template/dialect/gremlin/update.tmpl": templateDialectGremlinUpdateTmpl, - "template/dialect/sql/create.tmpl": templateDialectSqlCreateTmpl, - "template/dialect/sql/delete.tmpl": templateDialectSqlDeleteTmpl, - "template/dialect/sql/group.tmpl": templateDialectSqlGroupTmpl, - "template/dialect/sql/query.tmpl": templateDialectSqlQueryTmpl, - "template/dialect/sql/update.tmpl": templateDialectSqlUpdateTmpl, - "template/ent.tmpl": templateEntTmpl, - "template/example.tmpl": templateExampleTmpl, - "template/header.tmpl": templateHeaderTmpl, - "template/import.tmpl": templateImportTmpl, - "template/meta.tmpl": templateMetaTmpl, - "template/migrate/migrate.tmpl": templateMigrateMigrateTmpl, - "template/migrate/schema.tmpl": templateMigrateSchemaTmpl, - "template/predicate.tmpl": templatePredicateTmpl, - "template/tx.tmpl": templateTxTmpl, - "template/where.tmpl": templateWhereTmpl, + "template/base.tmpl": templateBaseTmpl, + "template/builder/create.tmpl": templateBuilderCreateTmpl, + "template/builder/delete.tmpl": templateBuilderDeleteTmpl, + "template/builder/query.tmpl": templateBuilderQueryTmpl, + "template/builder/setter.tmpl": templateBuilderSetterTmpl, + "template/builder/update.tmpl": templateBuilderUpdateTmpl, + "template/client.tmpl": templateClientTmpl, + "template/config.tmpl": templateConfigTmpl, + "template/context.tmpl": templateContextTmpl, + "template/dialect/gremlin/by.tmpl": templateDialectGremlinByTmpl, + "template/dialect/gremlin/create.tmpl": templateDialectGremlinCreateTmpl, + "template/dialect/gremlin/decode.tmpl": templateDialectGremlinDecodeTmpl, + "template/dialect/gremlin/delete.tmpl": templateDialectGremlinDeleteTmpl, + "template/dialect/gremlin/errors.tmpl": templateDialectGremlinErrorsTmpl, + "template/dialect/gremlin/group.tmpl": templateDialectGremlinGroupTmpl, + "template/dialect/gremlin/meta.tmpl": templateDialectGremlinMetaTmpl, + "template/dialect/gremlin/predicate.tmpl": templateDialectGremlinPredicateTmpl, + "template/dialect/gremlin/query.tmpl": templateDialectGremlinQueryTmpl, + "template/dialect/gremlin/update.tmpl": templateDialectGremlinUpdateTmpl, + "template/dialect/sql/by.tmpl": templateDialectSqlByTmpl, + "template/dialect/sql/create.tmpl": templateDialectSqlCreateTmpl, + "template/dialect/sql/decode.tmpl": templateDialectSqlDecodeTmpl, + "template/dialect/sql/delete.tmpl": templateDialectSqlDeleteTmpl, + "template/dialect/sql/errors.tmpl": templateDialectSqlErrorsTmpl, + "template/dialect/sql/group.tmpl": templateDialectSqlGroupTmpl, + "template/dialect/sql/meta.tmpl": templateDialectSqlMetaTmpl, + "template/dialect/sql/predicate.tmpl": templateDialectSqlPredicateTmpl, + "template/dialect/sql/query.tmpl": templateDialectSqlQueryTmpl, + "template/dialect/sql/update.tmpl": templateDialectSqlUpdateTmpl, + "template/ent.tmpl": templateEntTmpl, + "template/example.tmpl": templateExampleTmpl, + "template/header.tmpl": templateHeaderTmpl, + "template/import.tmpl": templateImportTmpl, + "template/meta.tmpl": templateMetaTmpl, + "template/migrate/migrate.tmpl": templateMigrateMigrateTmpl, + "template/migrate/schema.tmpl": templateMigrateSchemaTmpl, + "template/predicate.tmpl": templatePredicateTmpl, + "template/tx.tmpl": templateTxTmpl, + "template/where.tmpl": templateWhereTmpl, } // AssetDir returns the file names below a certain @@ -812,18 +1032,28 @@ var _bintree = &bintree{nil, map[string]*bintree{ "context.tmpl": &bintree{templateContextTmpl, map[string]*bintree{}}, "dialect": &bintree{nil, map[string]*bintree{ "gremlin": &bintree{nil, map[string]*bintree{ - "create.tmpl": &bintree{templateDialectGremlinCreateTmpl, map[string]*bintree{}}, - "delete.tmpl": &bintree{templateDialectGremlinDeleteTmpl, map[string]*bintree{}}, - "group.tmpl": &bintree{templateDialectGremlinGroupTmpl, map[string]*bintree{}}, - "query.tmpl": &bintree{templateDialectGremlinQueryTmpl, map[string]*bintree{}}, - "update.tmpl": &bintree{templateDialectGremlinUpdateTmpl, map[string]*bintree{}}, + "by.tmpl": &bintree{templateDialectGremlinByTmpl, map[string]*bintree{}}, + "create.tmpl": &bintree{templateDialectGremlinCreateTmpl, map[string]*bintree{}}, + "decode.tmpl": &bintree{templateDialectGremlinDecodeTmpl, map[string]*bintree{}}, + "delete.tmpl": &bintree{templateDialectGremlinDeleteTmpl, map[string]*bintree{}}, + "errors.tmpl": &bintree{templateDialectGremlinErrorsTmpl, map[string]*bintree{}}, + "group.tmpl": &bintree{templateDialectGremlinGroupTmpl, map[string]*bintree{}}, + "meta.tmpl": &bintree{templateDialectGremlinMetaTmpl, map[string]*bintree{}}, + "predicate.tmpl": &bintree{templateDialectGremlinPredicateTmpl, map[string]*bintree{}}, + "query.tmpl": &bintree{templateDialectGremlinQueryTmpl, map[string]*bintree{}}, + "update.tmpl": &bintree{templateDialectGremlinUpdateTmpl, map[string]*bintree{}}, }}, "sql": &bintree{nil, map[string]*bintree{ - "create.tmpl": &bintree{templateDialectSqlCreateTmpl, map[string]*bintree{}}, - "delete.tmpl": &bintree{templateDialectSqlDeleteTmpl, map[string]*bintree{}}, - "group.tmpl": &bintree{templateDialectSqlGroupTmpl, map[string]*bintree{}}, - "query.tmpl": &bintree{templateDialectSqlQueryTmpl, map[string]*bintree{}}, - "update.tmpl": &bintree{templateDialectSqlUpdateTmpl, map[string]*bintree{}}, + "by.tmpl": &bintree{templateDialectSqlByTmpl, map[string]*bintree{}}, + "create.tmpl": &bintree{templateDialectSqlCreateTmpl, map[string]*bintree{}}, + "decode.tmpl": &bintree{templateDialectSqlDecodeTmpl, map[string]*bintree{}}, + "delete.tmpl": &bintree{templateDialectSqlDeleteTmpl, map[string]*bintree{}}, + "errors.tmpl": &bintree{templateDialectSqlErrorsTmpl, map[string]*bintree{}}, + "group.tmpl": &bintree{templateDialectSqlGroupTmpl, map[string]*bintree{}}, + "meta.tmpl": &bintree{templateDialectSqlMetaTmpl, map[string]*bintree{}}, + "predicate.tmpl": &bintree{templateDialectSqlPredicateTmpl, map[string]*bintree{}}, + "query.tmpl": &bintree{templateDialectSqlQueryTmpl, map[string]*bintree{}}, + "update.tmpl": &bintree{templateDialectSqlUpdateTmpl, map[string]*bintree{}}, }}, }}, "ent.tmpl": &bintree{templateEntTmpl, map[string]*bintree{}}, diff --git a/entc/gen/func.go b/entc/gen/func.go index 7e28b7fb5..6a37c64ac 100644 --- a/entc/gen/func.go +++ b/entc/gen/func.go @@ -1,6 +1,7 @@ package gen import ( + "bytes" "fmt" "path/filepath" "reflect" @@ -19,25 +20,27 @@ var ( rules = ruleset() acronym = make(map[string]bool) funcs = template.FuncMap{ - "ops": ops, - "add": add, - "order": order, - "snake": snake, - "pascal": pascal, - "extend": extend, - "xrange": xrange, - "receiver": receiver, - "plural": plural, - "aggregate": aggregate, - "primitives": primitives, - "singular": rules.Singularize, - "quote": strconv.Quote, - "base": filepath.Base, - "keys": keys, - "join": join, - "lower": strings.ToLower, - "upper": strings.ToUpper, - "hasSuffix": strings.HasSuffix, + "ops": ops, + "add": add, + "order": order, + "snake": snake, + "pascal": pascal, + "extend": extend, + "xrange": xrange, + "receiver": receiver, + "plural": plural, + "aggregate": aggregate, + "primitives": primitives, + "singular": rules.Singularize, + "quote": strconv.Quote, + "base": filepath.Base, + "keys": keys, + "join": join, + "lower": strings.ToLower, + "upper": strings.ToUpper, + "hasSuffix": strings.HasSuffix, + "xtemplate": xtemplate, + "hasTemplate": hasTemplate, } ) @@ -213,3 +216,22 @@ func join(a []string, sep string) string { sort.Strings(a) return strings.Join(a, sep) } + +// xtemplate dynamically executes templates by their names. +func xtemplate(name string, v interface{}) (string, error) { + buf := bytes.NewBuffer(nil) + if err := templates.ExecuteTemplate(buf, name, v); err != nil { + return "", err + } + return buf.String(), nil +} + +// hasTemplate checks whether a template exists in the loaded templates. +func hasTemplate(name string) bool { + for _, t := range templates.Templates() { + if t.Name() == name { + return true + } + } + return false +} diff --git a/entc/gen/graph.go b/entc/gen/graph.go index 3ed7d4fd3..7ab85a099 100644 --- a/entc/gen/graph.go +++ b/entc/gen/graph.go @@ -29,6 +29,8 @@ type ( Package string // Header is an optional header signature for generated files. Header string + // Storage to support in codegen. + Storage []*Storage // imports are the import packages used for code generation. imports map[string]string } @@ -75,6 +77,9 @@ func (g *Graph) Gen() (err error) { } } for _, tmpl := range GraphTemplates { + if tmpl.Skip != nil && tmpl.Skip(g) { + continue + } if dir := filepath.Dir(tmpl.Format); dir != "." { path := filepath.Join(g.Config.Target, dir) check(os.MkdirAll(path, os.ModePerm), "create dir %q", path) @@ -325,6 +330,16 @@ func (g *Graph) Tables() (all []*schema.Table) { return } +// migrateSupport reports if the codegen needs to support schema migratio. +func (g *Graph) migrateSupport() bool { + for _, storage := range g.Storage { + if storage.SchemaMode.Support(Migrate) { + return true + } + } + return false +} + func (g *Graph) typ(name string) (*Type, bool) { for _, n := range g.Nodes { if name == n.Name { @@ -347,6 +362,11 @@ func imports() map[string]string { check(err, "unquote import path") specs[filepath.Base(path)] = path } + for _, s := range drivers { + for _, path := range s.Imports { + specs[filepath.Base(path)] = path + } + } return specs } diff --git a/entc/gen/where.go b/entc/gen/predicate.go similarity index 100% rename from entc/gen/where.go rename to entc/gen/predicate.go diff --git a/entc/gen/storage.go b/entc/gen/storage.go new file mode 100644 index 000000000..edccf6a90 --- /dev/null +++ b/entc/gen/storage.go @@ -0,0 +1,80 @@ +package gen + +import ( + "fmt" + "reflect" + + "fbc/ent/dialect/gremlin/graph/dsl" + "fbc/ent/dialect/sql" +) + +// A SchemaOption defines what type of schema feature a storage driver support. +type SchemaMode uint + +const ( + // Unique defines field and edge uniqueness support. + Unique SchemaMode = 1 << iota + + // Cascade defines cascading operations (e.g. cascade deletion). + Cascade + + // Migrate defines static schema and migration support (e.g. SQL-based). + Migrate +) + +// Support reports whether m support the given mode. +func (m SchemaMode) Support(mode SchemaMode) bool { return m&mode != 0 } + +// Storage driver type for codegen. +type Storage struct { + Name string // storage name. + Builder reflect.Type // query builder type. + Dialects []string // supported dialects. + IdentName string // identifier name (fields and funcs). + Imports []string // import packages needed. + SchemaMode SchemaMode // schema mode support. +} + +// StorageDrivers holds the storage driver options for entc. +var drivers = []*Storage{ + { + Name: "sql", + IdentName: "SQL", + Builder: reflect.TypeOf(&sql.Selector{}), + Dialects: []string{"dialect.SQLite", "dialect.MySQL"}, + Imports: []string{ + "fbc/ent/dialect/sql", + }, + SchemaMode: Unique | Cascade | Migrate, + }, + { + Name: "gremlin", + IdentName: "Gremlin", + Builder: reflect.TypeOf(&dsl.Traversal{}), + Dialects: []string{"dialect.Neptune"}, + Imports: []string{ + "fbc/ent/dialect/gremlin", + "fbc/ent/dialect/gremlin/graph/dsl", + "fbc/ent/dialect/gremlin/graph/dsl/__", + "fbc/ent/dialect/gremlin/graph/dsl/g", + "fbc/ent/dialect/gremlin/graph/dsl/p", + "fbc/ent/dialect/gremlin/encoding/graphson", + }, + SchemaMode: Unique, + }, +} + +// NewStorage returns a the storage driver type from the given string. +// It fails if the provided string is not a valid option. this function +// is here in order to remove the validation logic from entc command line. +func NewStorage(s string) (*Storage, error) { + for _, d := range drivers { + if s == d.Name { + return d, nil + } + } + return nil, fmt.Errorf("entc/gen: invalid storage driver %q", s) +} + +// String implements the fmt.Stringer interface for template usage. +func (s *Storage) String() string { return s.Name } diff --git a/entc/gen/template.go b/entc/gen/template.go index 965e9c48a..a9084239a 100644 --- a/entc/gen/template.go +++ b/entc/gen/template.go @@ -48,6 +48,7 @@ var ( GraphTemplates = []struct { Name string Format string + Skip func(*Graph) bool }{ { Name: "base", @@ -72,10 +73,12 @@ var ( { Name: "migrate", Format: "migrate/migrate.go", + Skip: func(g *Graph) bool { return g.migrateSupport() }, }, { Name: "schema", Format: "migrate/schema.go", + Skip: func(g *Graph) bool { return g.migrateSupport() }, }, { Name: "predicate", @@ -87,15 +90,16 @@ var ( }, } // templates holds the Go templates for the code generation. - templates = tmpl() + // the init function below initializes the templates and its funcs. + templates = template.New("templates") ) -func tmpl() *template.Template { - t := template.New("templates").Funcs(funcs) +func init() { + templates.Funcs(funcs) for _, asset := range AssetNames() { - t = template.Must(t.Parse(string(MustAsset(asset)))) + templates = template.Must(templates.Parse(string(MustAsset(asset)))) } - return t + return } func pkgf(s string) func(t *Type) string { diff --git a/entc/gen/template/base.tmpl b/entc/gen/template/base.tmpl index 6c6e85408..6a9bf4ec0 100644 --- a/entc/gen/template/base.tmpl +++ b/entc/gen/template/base.tmpl @@ -6,37 +6,45 @@ {{ template "import" $ }} // Order applies an ordering on either graph traversal or sql selector. -type Order struct { - SQL func(*sql.Selector) - Gremlin func(*dsl.Traversal) +type Order func({{ if gt (len $.Storage) 1 }}interface{}{{ else }}{{ (index $.Storage 0).Builder }}{{ end }}) + +{{ if gt (len $.Storage) 1 }} +// OrderPerDialect construct the "order by" clause for graph traversals based on dialect type. +func OrderPerDialect({{ range $i, $storage := $.Storage }}{{ if $i }},{{ end }}f{{ $i }} func({{ $storage.Builder }}){{ end }}) Order { + return Order(func (v interface{}) { + switch v := v.(type) { + {{- range $i, $storage := $.Storage }} + case {{ $storage.Builder }}: + f{{ $i }}(v) + {{- end }} + default: + panic(fmt.Sprintf("unknown type for order: %T", v)) + } + }) } +{{ end }} {{ range $f, $order := order }} {{ $f = pascal $f }} // {{ $f }} applies the given fields in {{ upper $f }} order. func {{ $f }}(fields ...string) Order { - return Order{ - SQL: func(s *sql.Selector) { - for _, f := range fields { - s.OrderBy(sql.{{ $f }}(f)) - } - }, - Gremlin: func(tr *dsl.Traversal) { - for _, f := range fields { - tr.By(f, dsl.{{ pascal $order }}) - } - }, - } + return Order{{ if gt (len $.Storage) 1 }}PerDialect{{ end }}( + {{ range $_, $storage := $.Storage -}} + {{- with extend (index $.Nodes 0) "Func" $f "Order" $order -}} + {{ $tmpl := printf "dialect/%s/order" $storage }} + {{- xtemplate $tmpl . }}, + {{ end -}} + {{ end -}} + ) } {{ end }} // Aggregate applies an aggregation step on the group-by traversal/selector. type Aggregate struct { - // SQL the column wrapped with the aggregation function. - SQL func(*sql.Selector) string - // Gremlin gets two labels as parameters. The first used in the `As` step for the predicate, - // and the second is an optional name for the next predicates (or for later usage). - Gremlin func(string, string) (string, *dsl.Traversal) + {{ range $_, $storage := $.Storage -}} + {{ $tmpl := printf "dialect/%s/group/signature" $storage }} + {{- xtemplate $tmpl . }} + {{ end -}} } @@ -48,35 +56,33 @@ type Aggregate struct { // func As(fn Aggregate, end string) Aggregate { return Aggregate{ - SQL: func(s *sql.Selector) string { - return sql.As(fn.SQL(s), end) - }, - Gremlin: func(start, _ string) (string, *dsl.Traversal) { - return fn.Gremlin(start, end) - }, + {{ range $_, $storage := $.Storage -}} + {{ $tmpl := printf "dialect/%s/group/as" $storage }} + {{- $storage.IdentName }}: {{ xtemplate $tmpl . }}, + {{ end -}} } } {{ range $name, $withField := aggregate }} {{ $fn := pascal $name }} - // Default{{ $fn }}Label is the default label name for the {{ $fn }} aggregation function. - // It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. - // In order to {{ quote $name }} 2 or more fields and avoid conflicting, use the `{{ $pkg }}.As({{ $pkg }}.{{ $fn }}(field), "custom_name")` - // function with custom name in order to override it. - const Default{{ $fn }}Label = {{ quote $name }} + {{ range $_, $storage := $.Storage -}} + {{ $tmpl := printf "dialect/%s/group/const" $storage }} + {{ if hasTemplate $tmpl }} + {{ with extend (index $.Nodes 0) "Name" $name "Func" $fn -}} + {{ xtemplate $tmpl . }} + {{ end }} + {{ end }} + {{ end }} // {{ $fn }} applies the {{ quote $name }} aggregation function on {{ if $withField }}the given field of {{ end }}each group. func {{ $fn }}({{ if $withField }}field string{{ end }}) Aggregate { return Aggregate { - SQL: func(s *sql.Selector) string { - return sql.{{ if eq $fn "Mean" }}Avg{{ else }}{{ $fn }}{{ end }}({{ if $withField }}s.C(field){{ else }}"*"{{ end }}) - }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = Default{{ $fn }}Label - } - return end, __.As(start).{{ if $withField }}Unfold().Values(field).{{ $fn }}(){{ else }}{{ $fn }}(dsl.Local){{ end }}.As(end) - }, + {{ range $_, $storage := $.Storage -}} + {{- with extend (index $.Nodes 0) "Func" $fn "WithField" $withField -}} + {{ $tmpl := printf "dialect/%s/group/func" $storage }} + {{- $storage.IdentName }}: {{ xtemplate $tmpl . }}, + {{ end -}} + {{ end -}} } } {{ end }} @@ -139,72 +145,18 @@ func (e *ErrConstraintFailed) Unwrap() error { return e.wrap } -// Code implements the dsl.Node interface. -func (e ErrConstraintFailed) Code() (string, []interface{}) { - return strconv.Quote(e.prefix() + e.msg), nil -} - -func (e *ErrConstraintFailed) UnmarshalGraphson(b []byte) error { - var v [1]*string - if err := graphson.Unmarshal(b, &v); err != nil { - return err - } - if v[0] == nil { - return fmt.Errorf("{{ $pkg }}: missing string value") - } - if !strings.HasPrefix(*v[0], e.prefix()) { - return fmt.Errorf("{{ $pkg }}: invalid string for error: %s", *v[0]) - } - e.msg = strings.TrimPrefix(*v[0], e.prefix()) - return nil -} - -// prefix returns the prefix used for gremlin constants. -func (ErrConstraintFailed) prefix() string { return "Error: " } - -// NewErrUniqueField creates a constraint error for unique fields. -func NewErrUniqueField(label, field string, v interface{}) *ErrConstraintFailed { - return &ErrConstraintFailed{msg: fmt.Sprintf("field %s.%s with value: %#v", label, field, v)} -} - -// NewErrUniqueEdge creates a constraint error for unique edges. -func NewErrUniqueEdge(label, edge, id string) *ErrConstraintFailed { - return &ErrConstraintFailed{msg: fmt.Sprintf("edge %s.%s with id: %#v", label, edge, id)} -} - // IsConstraintFailure returns a boolean indicating whether the error is a constraint failure. func IsConstraintFailure(err error) bool { _, ok := err.(*ErrConstraintFailed) return ok } -// isConstantError indicates if the given response holds a gremlin constant containing an error. -func isConstantError(r *gremlin.Response) (*ErrConstraintFailed, bool) { - e := &ErrConstraintFailed{} - if err := graphson.Unmarshal(r.Result.Data, e); err != nil { - return nil, false - } - return e, true -} - -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { - // Error number 1062 is ER_DUP_ENTRY in mysql, and "UNIQUE constraint failed" is SQLite prefix. - if msg := err.Error(); strings.HasPrefix(msg, "Error 1062") || strings.HasPrefix(msg, "UNIQUE constraint failed") { - return &ErrConstraintFailed{msg, err}, true - } - return nil, false -} - -// rollback calls to tx.Rollback and wraps the given error with the rollback error if occurred. -func rollback(tx dialect.Tx, err error) error { - if rerr := tx.Rollback(); rerr != nil { - err = fmt.Errorf("%s: %v", err.Error(), rerr) - } - if err, ok := isSQLConstraintError(err); ok { - return err - } - return err -} +{{ range $_, $storage := $.Storage -}} + {{ $tmpl := printf "dialect/%s/errors" $storage }} + {{ if hasTemplate $tmpl }} + {{ xtemplate $tmpl $ }} + {{ end }} +{{ end -}} {{ $id := (index $.Nodes 0).ID.Type }} // keys returns the keys/ids from the edge map. diff --git a/entc/gen/template/builder/create.tmpl b/entc/gen/template/builder/create.tmpl index abd6e0454..ed55fe4ac 100644 --- a/entc/gen/template/builder/create.tmpl +++ b/entc/gen/template/builder/create.tmpl @@ -58,10 +58,10 @@ func ({{ $receiver }} *{{ $builder }}) Save(ctx context.Context) (*{{ $.Name }}, {{ end -}} {{ end -}} switch {{ $receiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - return {{ $receiver }}.sqlSave(ctx) - case dialect.Neptune: - return {{ $receiver }}.gremlinSave(ctx) + {{- range $_, $storage := $.Storage }} + case {{ join $storage.Dialects ", " }}: + return {{ $receiver }}.{{ $storage }}Save(ctx) + {{- end }} default: return nil, errors.New("{{ $pkg }}: unsupported dialect") } @@ -76,12 +76,11 @@ func ({{ $receiver }} *{{ $builder }}) SaveX(ctx context.Context) *{{ $.Name }} return v } -{{ with extend $ "Builder" $builder }} - {{ template "dialect/sql/create" . }} -{{ end }} - -{{ with extend $ "Builder" $builder }} - {{ template "dialect/gremlin/create" . }} +{{- range $_, $storage := $.Storage }} + {{ with extend $ "Builder" $builder }} + {{ $tmpl := printf "dialect/%s/create" $storage }} + {{ xtemplate $tmpl . }} + {{ end }} {{ end }} {{ end }} diff --git a/entc/gen/template/builder/delete.tmpl b/entc/gen/template/builder/delete.tmpl index b4a5f2c53..e022cb03b 100644 --- a/entc/gen/template/builder/delete.tmpl +++ b/entc/gen/template/builder/delete.tmpl @@ -22,10 +22,10 @@ func ({{ $receiver}} *{{ $builder }}) Where(ps ...predicate.{{ $.Name }}) *{{ $b // Exec executes the deletion query. func ({{ $receiver}} *{{ $builder }}) Exec(ctx context.Context) error { switch {{ $receiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - return {{ $receiver }}.sqlExec(ctx) - case dialect.Neptune: - return {{ $receiver }}.gremlinExec(ctx) + {{- range $_, $storage := $.Storage }} + case {{ join $storage.Dialects ", " }}: + return {{ $receiver }}.{{ $storage }}Exec(ctx) + {{- end }} default: return errors.New("{{ $pkg }}: unsupported dialect") } @@ -38,12 +38,11 @@ func ({{ $receiver }} *{{ $builder }}) ExecX(ctx context.Context) { } } -{{ with extend $ "Builder" $builder }} - {{ template "dialect/sql/delete" . }} -{{ end }} - -{{ with extend $ "Builder" $builder }} - {{ template "dialect/gremlin/delete" . }} +{{- range $_, $storage := $.Storage }} + {{ with extend $ "Builder" $builder }} + {{ $tmpl := printf "dialect/%s/delete" $storage }} + {{ xtemplate $tmpl . }} + {{ end }} {{ end }} {{ $onebuilder := print $builder "One" }} diff --git a/entc/gen/template/builder/query.tmpl b/entc/gen/template/builder/query.tmpl index ffc19668a..53125623e 100644 --- a/entc/gen/template/builder/query.tmpl +++ b/entc/gen/template/builder/query.tmpl @@ -16,8 +16,9 @@ type {{ $builder }} struct { unique []string predicates []predicate.{{ $.Name }} // intermediate queries. - sql *sql.Selector - gremlin *dsl.Traversal + {{- range $_, $storage := $.Storage }} + {{ $storage }} {{ $storage.Builder}} + {{- end }} } // Where adds a new predicate for the builder. @@ -51,47 +52,13 @@ func ({{ $receiver }} *{{ $builder }}) Order(o ...Order) *{{ $builder }} { func ({{ $receiver }} *{{ $builder }}) Query{{ pascal $e.Name }}() *{{ $edge_builder }} { query := &{{ $edge_builder }}{config: {{ $receiver }}.config} switch {{ $receiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - {{- if $e.M2M }} - {{ $i := 1 }}{{ $j := 0 }}{{- if $e.IsInverse }}{{ $i = 0 }}{{ $j = 1 }}{{ end -}} - t1 := sql.Table({{ $e.Type.Package }}.Table) - t2 := {{ $receiver }}.sqlQuery() - t2.Select(t2.C({{ $.Package }}.{{ $.ID.Constant }})) - t3 := sql.Table({{ $.Package }}.{{ $e.TableConstant }}) - t4 := sql.Select(t3.C({{ $.Package }}.{{ $e.PKConstant }}[{{ $i }}])). - From(t3). - Join(t2). - On(t3.C({{ $.Package }}.{{ $e.PKConstant }}[{{ $j }}]), t2.C({{ $.Package }}.{{ $.ID.Constant }})) - query.sql = sql.Select(). - From(t1). - Join(t4). - On(t1.C({{ $e.Type.Package }}.{{ $e.Type.ID.Constant }}), t4.C({{ $.Package }}.{{ $e.PKConstant }}[{{ $i }}])) - {{- else if or $e.M2O (and $e.O2O $e.IsInverse) }}{{/* M2O || (O2O with inverse edge) */}} - t1 := sql.Table({{ $e.Type.Package }}.Table) - t2 := {{ $receiver }}.sqlQuery() - t2.Select(t2.C({{ $.Package }}.{{ $e.ColumnConstant }})) - query.sql = sql.Select(t1.Columns({{ $e.Type.Package }}.Columns...)...). - From(t1). - Join(t2). - On(t1.C({{ $e.Type.Package }}.{{ $e.Type.ID.Constant }}), t2.C({{ $.Package }}.{{ $e.ColumnConstant }})) - {{- else }}{{/* O2M || (O2O with assoc edge) */}} - t1 := sql.Table({{ $e.Type.Package }}.Table) - t2 := {{ $receiver }}.sqlQuery() - t2.Select(t2.C({{ $.Package }}.{{ $.ID.Constant }})) - query.sql = sql.Select(). - From(t1). - Join(t2). - On(t1.C({{ $.Package }}.{{ $e.ColumnConstant }}), t2.C({{ $.Package }}.{{ $.ID.Constant }})) - {{- end }} - case dialect.Neptune: - gremlin := {{ $receiver }}.gremlinQuery() - {{- if $e.SelfRef }} - query.gremlin = gremlin.Both({{ $.Package }}.{{ $e.Constant }}) - {{- else if $e.IsInverse }} - query.gremlin = gremlin.InE({{ $e.Type.Package }}.{{ $e.Constant }}).OutV() - {{- else }} - query.gremlin = gremlin.OutE({{ $.Package }}.{{ $e.Constant }}).InV() - {{- end }} + {{- range $_, $storage := $.Storage -}} + case {{ join $storage.Dialects ", " }}: + {{- with extend $ "Receiver" $receiver "Edge" $e -}} + {{ $tmpl := printf "dialect/%s/query/path" $storage }} + {{- xtemplate $tmpl . -}} + {{ end -}} + {{ end -}} } return query } @@ -209,10 +176,10 @@ func ({{ $receiver }} *{{ $builder }}) OnlyXID(ctx context.Context) {{ $.ID.Type // All executes the query and returns a list of {{ plural $.Name }}. func ({{ $receiver }} *{{ $builder }}) All(ctx context.Context) ([]*{{ $.Name }}, error) { switch {{ $receiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - return {{ $receiver }}.sqlAll(ctx) - case dialect.Neptune: - return {{ $receiver }}.gremlinAll(ctx) + {{- range $_, $storage := $.Storage }} + case {{ join $storage.Dialects ", " }}: + return {{ $receiver }}.{{ $storage }}All(ctx) + {{- end }} default: return nil, errors.New("{{ $pkg }}: unsupported dialect") } @@ -230,10 +197,10 @@ func ({{ $receiver }} *{{ $builder }}) AllX(ctx context.Context) []*{{ $.Name }} // IDs executes the query and returns a list of {{ $.Name }} ids. func ({{ $receiver }} *{{ $builder }}) IDs(ctx context.Context) ([]{{ $.ID.Type }}, error) { switch {{ $receiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - return {{ $receiver }}.sqlIDs(ctx) - case dialect.Neptune: - return {{ $receiver }}.gremlinIDs(ctx) + {{- range $_, $storage := $.Storage }} + case {{ join $storage.Dialects ", " }}: + return {{ $receiver }}.{{ $storage }}IDs(ctx) + {{- end }} default: return nil, errors.New("{{ $pkg }}: unsupported dialect") } @@ -251,10 +218,10 @@ func ({{ $receiver }} *{{ $builder }}) IDsX(ctx context.Context) []{{ $.ID.Type // Count returns the count of the given query. func ({{ $receiver }} *{{ $builder }}) Count(ctx context.Context) (int, error) { switch {{ $receiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - return {{ $receiver }}.sqlCount(ctx) - case dialect.Neptune: - return {{ $receiver }}.gremlinCount(ctx) + {{- range $_, $storage := $.Storage }} + case {{ join $storage.Dialects ", " }}: + return {{ $receiver }}.{{ $storage }}Count(ctx) + {{- end }} default: return 0, errors.New("{{ $pkg }}: unsupported dialect") } @@ -272,10 +239,10 @@ func ({{ $receiver }} *{{ $builder }}) CountX(ctx context.Context) int { // Exist returns true if the query has elements in the graph. func ({{ $receiver }} *{{ $builder }}) Exist(ctx context.Context) (bool, error) { switch {{ $receiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - return {{ $receiver }}.sqlExist(ctx) - case dialect.Neptune: - return {{ $receiver }}.gremlinExist(ctx) + {{- range $_, $storage := $.Storage }} + case {{ join $storage.Dialects ", " }}: + return {{ $receiver }}.{{ $storage }}Exist(ctx) + {{- end }} default: return false, errors.New("{{ $pkg }}: unsupported dialect") } @@ -301,8 +268,9 @@ func ({{ $receiver }} *{{ $builder }}) Clone() *{{ $builder }} { unique: append([]string{}, {{ $receiver }}.unique...), predicates: append([]predicate.{{ $.Name }}{}, {{ $receiver }}.predicates...), // clone intermediate queries. - sql: {{ $receiver }}.sql.Clone(), - gremlin: {{ $receiver}}.gremlin.Clone(), + {{- range $_, $storage := $.Storage }} + {{ $storage }}: {{ $receiver }}.{{ $storage }}.Clone(), + {{- end }} } } @@ -330,24 +298,21 @@ func ({{ $receiver }} *{{ $builder }}) GroupBy(field string, fields ...string) * group := &{{ $groupBuilder }}{config: {{ $receiver }}.config} group.fields = append([]string{field}, fields...) switch {{ $receiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - group.sql = {{ $receiver }}.sqlQuery() - case dialect.Neptune: - group.gremlin = {{ $receiver }}.gremlinQuery() + {{- range $_, $storage := $.Storage }} + case {{ join $storage.Dialects ", " }}: + group.{{ $storage }} = {{ $receiver }}.{{ $storage }}Query() + {{- end }} } return group } - -{{ with extend $ "Builder" $builder "Package" $pkg }} - {{ template "dialect/sql/query" . }} +{{- range $_, $storage := $.Storage }} + {{ with extend $ "Builder" $builder "Package" $pkg }} + {{ $tmpl := printf "dialect/%s/query" $storage }} + {{ xtemplate $tmpl . }} + {{ end }} {{ end }} -{{ with extend $ "Builder" $builder }} - {{ template "dialect/gremlin/query" . }} -{{ end }} - - {{ $groupReceiver := receiver $groupBuilder }} // {{ $builder }} is the builder for group-by {{ pascal $.Name }} entities. @@ -356,8 +321,9 @@ type {{ $groupBuilder }} struct { fields []string fns []Aggregate // intermediate queries. - sql *sql.Selector - gremlin *dsl.Traversal + {{- range $_, $storage := $.Storage }} + {{ $storage }} {{ $storage.Builder}} + {{- end }} } // Aggregate adds the given aggregation functions to the group-by query. @@ -369,10 +335,10 @@ func ({{ $groupReceiver }} *{{ $groupBuilder }}) Aggregate(fns ...Aggregate) *{{ // Scan applies the group-by query and scan the result into the given value. func ({{ $groupReceiver }} *{{ $groupBuilder }}) Scan(ctx context.Context, v interface{}) error { switch {{ $groupReceiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - return {{ $groupReceiver }}.sqlScan(ctx, v) - case dialect.Neptune: - return {{ $groupReceiver }}.gremlinScan(ctx, v) + {{- range $_, $storage := $.Storage }} + case {{ join $storage.Dialects ", " }}: + return {{ $groupReceiver }}.{{ $storage }}Scan(ctx, v) + {{- end }} default: return errors.New("{{ $groupReceiver }}: unsupported dialect") } @@ -409,12 +375,11 @@ func ({{ $groupReceiver }} *{{ $groupBuilder }}) ScanX(ctx context.Context, v in } {{ end }} -{{ with extend $ "Builder" $groupBuilder }} - {{ template "dialect/sql/group" . }} -{{ end }} - -{{ with extend $ "Builder" $groupBuilder }} - {{ template "dialect/gremlin/group" . }} +{{- range $_, $storage := $.Storage }} + {{ with extend $ "Builder" $groupBuilder }} + {{ $tmpl := printf "dialect/%s/group" $storage }} + {{ xtemplate $tmpl . }} + {{ end }} {{ end }} {{ end }} diff --git a/entc/gen/template/builder/update.tmpl b/entc/gen/template/builder/update.tmpl index 3e5383e8e..013f1c9db 100644 --- a/entc/gen/template/builder/update.tmpl +++ b/entc/gen/template/builder/update.tmpl @@ -33,11 +33,10 @@ func ({{ $receiver }} *{{ $builder }}) Save(ctx context.Context) (int, error) { {{ template "update/validators" . }} {{- end -}} switch {{ $receiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - return {{ $receiver }}.sqlSave(ctx) - case dialect.Neptune: - vertices, err := {{ $receiver }}.gremlinSave(ctx) - return len(vertices), err + {{- range $_, $storage := $.Storage }} + case {{ join $storage.Dialects ", " }}: + return {{ $receiver }}.{{ $storage }}Save(ctx) + {{- end }} default: return 0, errors.New("{{ $pkg }}: unsupported dialect") } @@ -65,12 +64,11 @@ func ({{ $receiver }} *{{ $builder }}) ExecX(ctx context.Context) { } } -{{ with extend $ "Builder" $builder "Package" $pkg }} - {{ template "dialect/sql/update" . }} -{{ end }} - -{{ with extend $ "Builder" $builder }} - {{ template "dialect/gremlin/update" . }} +{{- range $_, $storage := $.Storage }} + {{ with extend $ "Builder" $builder "Package" $pkg }} + {{ $tmpl := printf "dialect/%s/update" $storage }} + {{ xtemplate $tmpl . }} + {{ end }} {{ end }} {{ $onebuilder := printf "%sOne" $builder }} @@ -98,10 +96,10 @@ func ({{ $receiver }} *{{ $onebuilder }} ) Save(ctx context.Context) (*{{ $.Name {{ template "update/validators" . }} {{- end -}} switch {{ $receiver }}.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - return {{ $receiver }}.sqlSave(ctx) - case dialect.Neptune: - return {{ $receiver }}.gremlinSave(ctx) + {{- range $_, $storage := $.Storage }} + case {{ join $storage.Dialects ", " }}: + return {{ $receiver }}.{{ $storage }}Save(ctx) + {{- end }} default: return nil, errors.New("{{ $pkg }}: unsupported dialect") } @@ -129,12 +127,11 @@ func ({{ $receiver }} *{{ $onebuilder }}) ExecX(ctx context.Context) { } } -{{ with extend $ "Builder" $onebuilder "Package" $pkg }} - {{ template "dialect/sql/update" . }} -{{ end }} - -{{ with extend $ "Builder" $onebuilder }} - {{ template "dialect/gremlin/update" . }} +{{- range $_, $storage := $.Storage }} + {{ with extend $ "Builder" $onebuilder "Package" $pkg }} + {{ $tmpl := printf "dialect/%s/update" $storage }} + {{ xtemplate $tmpl . }} + {{ end }} {{ end }} {{ end }} diff --git a/entc/gen/template/client.tmpl b/entc/gen/template/client.tmpl index 4057d2629..06fac1a47 100644 --- a/entc/gen/template/client.tmpl +++ b/entc/gen/template/client.tmpl @@ -114,40 +114,13 @@ func (c *{{ $client }}) Query() *{{ $n.Name }}Query { func (c *{{ $client }}) Query{{ pascal $e.Name }}({{ $rec }} *{{ $n.Name }}) *{{ $builder }} { query := &{{ $e.Type.Name }}Query{config: c.config} switch c.driver.Dialect() { - case dialect.MySQL, dialect.SQLite: - id := {{ $rec }}.{{- if $n.ID.IsString }}id(){{ else }}ID{{ end }} - {{- if $e.M2M }} - {{ $i := 1 }}{{ $j := 0 }}{{- if $e.IsInverse }}{{ $i = 0 }}{{ $j = 1 }}{{ end -}} - t1 := sql.Table({{ $e.Type.Package }}.Table) - t2 := sql.Table({{ $n.Package }}.Table) - t3 := sql.Table({{ $n.Package }}.{{ $e.TableConstant }}) - t4 := sql.Select(t3.C({{ $n.Package }}.{{ $e.PKConstant }}[{{ $i }}])). - From(t3). - Join(t2). - On(t3.C({{ $n.Package }}.{{ $e.PKConstant }}[{{ $j }}]), t2.C({{ $n.Package }}.{{ $n.ID.Constant }})). - Where(sql.EQ(t2.C({{ $n.Package }}.{{ $n.ID.Constant }}), id)) - query.sql = sql.Select(). - From(t1). - Join(t4). - On(t1.C({{ $e.Type.Package }}.{{ $e.Type.ID.Constant }}), t4.C({{ $n.Package }}.{{ $e.PKConstant }}[{{ $i }}])) - {{- else if or $e.M2O (and $e.O2O $e.IsInverse) }}{{/* M2O || (O2O with inverse edge) */}} - t1 := sql.Table({{ $e.Type.Package }}.Table) - t2 := sql.Select({{ $n.Package }}.{{ $e.ColumnConstant }}). - From(sql.Table({{ $n.Package }}.{{ $e.TableConstant }})). - Where(sql.EQ({{ $n.Package }}.{{ $n.ID.Constant }}, id)) - query.sql = sql.Select().From(t1).Join(t2).On(t1.C({{ $e.Type.Package }}.{{ $e.Type.ID.Constant }}), t2.C({{ $n.Package }}.{{ $e.ColumnConstant }})) - {{- else }}{{/* O2M || (O2O with assoc edge) */}} - query.sql = sql.Select().From(sql.Table({{ $e.Type.Package }}.Table)). - Where(sql.EQ({{ $n.Package }}.{{ $e.ColumnConstant }}, id)) - {{- end }} - case dialect.Neptune: - {{- if $e.SelfRef }} - query.gremlin = g.V({{ $rec }}.ID).Both({{ $n.Package }}.{{ $e.Constant }}) - {{- else if $e.IsInverse }} - query.gremlin = g.V({{ $rec }}.ID).InE({{ $e.Type.Package }}.{{ $e.Constant }}).OutV() - {{- else }} - query.gremlin = g.V({{ $rec }}.ID).OutE({{ $n.Package }}.{{ $e.Constant }}).InV() - {{- end }} + {{- range $_, $storage := $.Storage -}} + case {{ join $storage.Dialects ", " }}: + {{- with extend $n "Receiver" $rec "Edge" $e -}} + {{ $tmpl := printf "dialect/%s/query/from" $storage }} + {{- xtemplate $tmpl . -}} + {{ end -}} + {{ end -}} } return query } diff --git a/entc/gen/template/dialect/gremlin/by.tmpl b/entc/gen/template/dialect/gremlin/by.tmpl new file mode 100644 index 000000000..8a79fc88f --- /dev/null +++ b/entc/gen/template/dialect/gremlin/by.tmpl @@ -0,0 +1,44 @@ +{{ define "dialect/gremlin/order" -}} + {{- $order := $.Scope.Order -}} + func(tr *dsl.Traversal) { + for _, f := range fields { + tr.By(f, dsl.{{ pascal $order }}) + } + } +{{- end }} + +{{/* custom signature for group-by function */}} +{{ define "dialect/gremlin/group/signature" -}} + // Gremlin gets two labels as parameters. The first used in the `As` step for the predicate, + // and the second is an optional name for the next predicates (or for later usage). + Gremlin func(string, string) (string, *dsl.Traversal) +{{- end }} + +{{ define "dialect/gremlin/group/as" -}} + func(start, _ string) (string, *dsl.Traversal) { + return fn.Gremlin(start, end) + } +{{- end }} + +{{ define "dialect/gremlin/group/func" -}} + {{- $fn := $.Scope.Func }} + {{- $withField := $.Scope.WithField }} + func(start, end string) (string, *dsl.Traversal) { + if end == "" { + end = Default{{ $fn }}Label + } + return end, __.As(start).{{ if $withField }}Unfold().Values(field).{{ $fn }}(){{ else }}{{ $fn }}(dsl.Local){{ end }}.As(end) + } +{{- end }} + +{{/* optional constants for group-by default values. */}} +{{ define "dialect/gremlin/group/const" -}} + {{- $fn := $.Scope.Func }} + {{- $name := $.Scope.Name }} + {{- $pkg := base $.Config.Package }} + // Default{{ $fn }}Label is the default label name for the {{ $fn }} aggregation function. + // It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. + // In order to {{ quote $name }} 2 or more fields and avoid conflicting, use the `{{ $pkg }}.As({{ $pkg }}.{{ $fn }}(field), "custom_name")` + // function with custom name in order to override it. + const Default{{ $fn }}Label = {{ quote $name }} +{{- end }} \ No newline at end of file diff --git a/entc/gen/template/dialect/gremlin/decode.tmpl b/entc/gen/template/dialect/gremlin/decode.tmpl new file mode 100644 index 000000000..b299a50f6 --- /dev/null +++ b/entc/gen/template/dialect/gremlin/decode.tmpl @@ -0,0 +1,58 @@ +{{ define "dialect/gremlin/decode/one" }} +{{ $receiver := $.Receiver }} + +// FromResponse scans the gremlin response data into {{ $.Name }}. +func ({{ $receiver }} *{{ $.Name }}) FromResponse(res *gremlin.Response) error { + vmap, err := res.ReadValueMap() + if err != nil { + return err + } + {{- $scan := print "v" $receiver }} + var {{ $scan }} struct { + ID {{ $.ID.Type }} `json:"id,omitempty"` + {{ range $_, $f := $.Fields }} + {{- pascal $f.Name }} {{ if $f.IsTime }}int64{{ else }}{{ if $f.Nullable }}*{{ end }}{{ $f.Type }}{{ end }} `json:"{{ $f.Name }},omitempty"` + {{ end }} + } + if err := vmap.Decode(&{{ $scan }}); err != nil { + return err + } + {{ $receiver }}.ID = {{ $scan }}.ID + {{ range $_, $f := $.Fields }} + {{- $receiver }}.{{ pascal $f.Name }} = {{- if $f.IsTime }}time.Unix({{ $scan }}.{{- pascal $f.Name }}, 0) {{ else }}{{- $scan }}.{{- pascal $f.Name }}{{ end }} + {{ end -}} + return nil +} +{{ end }} + +{{ define "dialect/gremlin/decode/many" }} +{{ $receiver := $.Receiver }} +{{ $slice := $.Scope.Slice }} + +// FromResponse scans the gremlin response data into {{ $slice }}. +func ({{ $receiver }} *{{ $slice }}) FromResponse(res *gremlin.Response) error { + vmap, err := res.ReadValueMap() + if err != nil { + return err + } + {{- $scan := print "v" $receiver }} + var {{ $scan }} []struct { + ID {{ $.ID.Type }} `json:"id,omitempty"` + {{ range $_, $f := $.Fields }} + {{- pascal $f.Name }} {{ if $f.IsTime }}int64{{ else }}{{ if $f.Nullable }}*{{ end }}{{ $f.Type }}{{ end }} `json:"{{ $f.Name }},omitempty"` + {{ end }} + } + if err := vmap.Decode(&{{ $scan }}); err != nil { + return err + } + for _, v := range {{ $scan }} { + *{{ $receiver }} = append(*{{ $receiver }}, &{{ $.Name }}{ + ID: v.ID, + {{ range $_, $f := $.Fields }} + {{- pascal $f.Name }}: {{- if $f.IsTime }}time.Unix(v.{{ pascal $f.Name }}, 0) {{ else }}v.{{ pascal $f.Name }}{{ end }}, + {{ end -}} + }) + } + return nil +} +{{ end }} \ No newline at end of file diff --git a/entc/gen/template/dialect/gremlin/errors.tmpl b/entc/gen/template/dialect/gremlin/errors.tmpl new file mode 100644 index 000000000..d42dfb3a8 --- /dev/null +++ b/entc/gen/template/dialect/gremlin/errors.tmpl @@ -0,0 +1,46 @@ +{{/* custom errors and errors handlers from sql dialects */}} +{{ define "dialect/gremlin/errors" }} +{{ $pkg := base $.Config.Package }} + +// Code implements the dsl.Node interface. +func (e ErrConstraintFailed) Code() (string, []interface{}) { + return strconv.Quote(e.prefix() + e.msg), nil +} + +func (e *ErrConstraintFailed) UnmarshalGraphson(b []byte) error { + var v [1]*string + if err := graphson.Unmarshal(b, &v); err != nil { + return err + } + if v[0] == nil { + return fmt.Errorf("{{ $pkg }}: missing string value") + } + if !strings.HasPrefix(*v[0], e.prefix()) { + return fmt.Errorf("{{ $pkg }}: invalid string for error: %s", *v[0]) + } + e.msg = strings.TrimPrefix(*v[0], e.prefix()) + return nil +} + +// prefix returns the prefix used for gremlin constants. +func (ErrConstraintFailed) prefix() string { return "Error: " } + +// NewErrUniqueField creates a constraint error for unique fields. +func NewErrUniqueField(label, field string, v interface{}) *ErrConstraintFailed { + return &ErrConstraintFailed{msg: fmt.Sprintf("field %s.%s with value: %#v", label, field, v)} +} + +// NewErrUniqueEdge creates a constraint error for unique edges. +func NewErrUniqueEdge(label, edge, id string) *ErrConstraintFailed { + return &ErrConstraintFailed{msg: fmt.Sprintf("edge %s.%s with id: %#v", label, edge, id)} +} + +// isConstantError indicates if the given response holds a gremlin constant containing an error. +func isConstantError(r *gremlin.Response) (*ErrConstraintFailed, bool) { + e := &ErrConstraintFailed{} + if err := graphson.Unmarshal(r.Result.Data, e); err != nil { + return nil, false + } + return e, true +} +{{ end }} \ No newline at end of file diff --git a/entc/gen/template/dialect/gremlin/meta.tmpl b/entc/gen/template/dialect/gremlin/meta.tmpl new file mode 100644 index 000000000..d3d920f3a --- /dev/null +++ b/entc/gen/template/dialect/gremlin/meta.tmpl @@ -0,0 +1,11 @@ +{{/* constants needed for gremlin dialects. */}} +{{ define "dialect/gremlin/meta/constants" }} + {{ range $_, $e := $.Edges }}{{ $label := $e.Constant -}} + {{ if $e.IsInverse }}{{- $label = $e.InverseConstant -}} + // {{ $label }} holds the string label denoting the {{ lower $e.Name }} inverse edge type in the database. + {{ else -}} + // {{ $label }} holds the string label denoting the {{ lower $e.Name }} edge type in the database. + {{ end -}} + {{ $label }} = "{{ $e.Label }}" + {{ end -}} +{{ end }} diff --git a/entc/gen/template/dialect/gremlin/predicate.tmpl b/entc/gen/template/dialect/gremlin/predicate.tmpl new file mode 100644 index 000000000..98cc20acb --- /dev/null +++ b/entc/gen/template/dialect/gremlin/predicate.tmpl @@ -0,0 +1,107 @@ +{{ define "dialect/gremlin/predicate/id" -}} + func(t *dsl.Traversal) { + t.HasID(id) + } +{{- end }} + +{{ define "dialect/gremlin/predicate/id/ops" -}} +{{- $op := $.Scope.Op -}} +{{- $arg := $.Scope.Arg -}} + func(t *dsl.Traversal) { + {{- if $op.Variadic }} + v := make([]interface{}, len({{ $arg }})) + for i := range v { + v[i] = {{ $arg }}[i] + } + {{- end }} + t.HasID(p.{{ $op.Gremlin }}({{ if $op.Variadic }}v...{{ else }}{{ $arg }}{{ end }})) + } +{{- end }} + +{{ define "dialect/gremlin/predicate/field" -}} + {{- $f := $.Scope.Field -}} + func(t *dsl.Traversal) { + t.Has(Label, {{ $f.Constant }}, p.EQ(v)) + } +{{- end }} + +{{ define "dialect/gremlin/predicate/field/ops" -}} + {{- $f := $.Scope.Field -}} + {{- $op := $.Scope.Op -}} + func(t *dsl.Traversal) { + t.Has(Label, {{ $f.Constant }}, p.{{ $op.Gremlin }}(v{{ if $op.Variadic }}...{{ end }})) + } +{{- end }} + +{{ define "dialect/gremlin/predicate/edge/has" -}} + {{- $e := $.Scope.Edge -}} + {{- $label := $e.Constant -}} + {{- $direction := "Out" -}} + {{- if $e.IsInverse -}} + {{- $direction = "In" -}} + {{/* avoid circular dependecies */}} + {{- $label = $e.InverseConstant -}} + {{- end -}} + func(t *dsl.Traversal) { + {{- /* if it's an edge with self-reference, take the two vertices */}} + {{- if $e.SelfRef }} + t.Both({{ $label }}) + {{- else }} + t.{{ $direction }}E({{ $label }}).{{ $direction }}V() + {{- end }} + } +{{- end }} + +{{ define "dialect/gremlin/predicate/edge/haswith" -}} + {{- $e := $.Scope.Edge -}} + {{- $label := $e.Constant -}} + {{- $direction := "Out" -}} + {{- $inverse_direction := "In" -}} + {{- if $e.IsInverse -}} + {{- $direction = "In" -}} + {{- $inverse_direction = "Out" -}} + {{/* avoid circular dependecies */}} + {{- $label = $e.InverseConstant -}} + {{- end -}} + func(t *dsl.Traversal) { + {{- if $e.SelfRef }}{{/* selfref means it should be true in one of the directions */}} + in, out := __.InV(), __.OutV() + for _, p := range preds { + p(in) + p(out) + } + t.Where( + __.Or( + __.OutE({{ $label }}).Where(in), + __.InE({{ $label }}).Where(out), + ), + ) + {{- else }} + tr := __.{{ $inverse_direction }}V() + for _, p := range preds { + p(tr) + } + t.{{ $direction }}E({{ $label }}).Where(tr).{{ $direction }}V() + {{- end }} + } +{{- end }} + +{{ define "dialect/gremlin/predicate/or" -}} + func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + } +{{- end }} + +{{ define "dialect/gremlin/predicate/not" -}} + func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + } +{{- end }} \ No newline at end of file diff --git a/entc/gen/template/dialect/gremlin/query.tmpl b/entc/gen/template/dialect/gremlin/query.tmpl index 49e3dfa64..4922f6f34 100644 --- a/entc/gen/template/dialect/gremlin/query.tmpl +++ b/entc/gen/template/dialect/gremlin/query.tmpl @@ -62,7 +62,7 @@ func ({{ $receiver }} *{{ $builder }}) gremlinQuery() *dsl.Traversal { if len({{ $receiver }}.order) > 0 { v.Order() for _, p := range {{ $receiver }}.order { - p.Gremlin(v) + p(v) } } switch limit, offset := {{ $receiver }}.limit, {{ $receiver }}.offset; { @@ -78,4 +78,34 @@ func ({{ $receiver }} *{{ $builder }}) gremlinQuery() *dsl.Traversal { } return v } +{{ end }} + +{{/* query/path defines the query generation for path of a given edge. */}} +{{ define "dialect/gremlin/query/path" }} + {{- $e := $.Scope.Edge }} {{/* the edge we need to genegrate the path to. */}} + {{- $receiver := $.Scope.Receiver }} + gremlin := {{ $receiver }}.gremlinQuery() + {{- if $e.SelfRef }} + query.gremlin = gremlin.Both({{ $.Package }}.{{ $e.Constant }}) + {{- else if $e.IsInverse }} + query.gremlin = gremlin.InE({{ $e.Type.Package }}.{{ $e.Constant }}).OutV() + {{- else }} + query.gremlin = gremlin.OutE({{ $.Package }}.{{ $e.Constant }}).InV() + {{- end }} +{{ end }} + + +{{/* query/from defines the query generation for an edge query from a given node. */}} +{{ define "dialect/gremlin/query/from" }} + {{- $n := $ }} {{/* the node we start the query from. */}} + {{- $e := $.Scope.Edge }} {{/* the edge we need to genegrate the path to. */}} + {{- $receiver := $.Scope.Receiver }} + + {{- if $e.SelfRef }} + query.gremlin = g.V({{ $receiver }}.ID).Both({{ $n.Package }}.{{ $e.Constant }}) + {{- else if $e.IsInverse }} + query.gremlin = g.V({{ $receiver }}.ID).InE({{ $e.Type.Package }}.{{ $e.Constant }}).OutV() + {{- else }} + query.gremlin = g.V({{ $receiver }}.ID).OutE({{ $n.Package }}.{{ $e.Constant }}).InV() + {{- end }} {{ end }} \ No newline at end of file diff --git a/entc/gen/template/dialect/gremlin/update.tmpl b/entc/gen/template/dialect/gremlin/update.tmpl index d282345f8..fafa2fd61 100644 --- a/entc/gen/template/dialect/gremlin/update.tmpl +++ b/entc/gen/template/dialect/gremlin/update.tmpl @@ -2,28 +2,27 @@ {{ $builder := pascal $.Scope.Builder }} {{ $receiver := receiver $builder }} {{ $one := hasSuffix $builder "One" }} +{{ $zero := 0 }}{{ if $one }}{{ $zero = "nil" }}{{ end }} -func ({{ $receiver }} *{{ $builder }}) gremlinSave(ctx context.Context) ({{- if not $one }}[]{{ end }}*{{ $.Name }}, error) { +func ({{ $receiver }} *{{ $builder }}) gremlinSave(ctx context.Context) ({{- if $one }}*{{ $.Name }}{{ else }}int{{ end }}, error) { res := &gremlin.Response{} query, bindings := {{ $receiver }}.gremlin({{- if $one }}{{ $receiver }}.id{{ end }}).Query() if err := {{ $receiver }}.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return {{ $zero }}, err } if err, ok := isConstantError(res); ok { - return nil, err + return {{ $zero }}, err } - {{- $r := plural $.Receiver }} {{- if $one }} - {{- $r = $.Receiver }} + {{- $r := $.Receiver }} {{ $r }} := &{{ $.Name }}{config: {{ $receiver }}.config} + if err := {{ $r }}.FromResponse(res); err != nil { + return nil, err + } + return {{ $r }}, nil {{- else }} - var {{ $r }} {{ plural $.Name }} - {{ $r }}.config({{ $receiver }}.config) + return res.ReadInt() {{- end }} - if err := {{ $r }}.FromResponse(res); err != nil { - return nil, err - } - return {{ $r }}, nil } func ({{ $receiver }} *{{ $builder }}) gremlin({{ if $one }}id {{ $.ID.Type }}{{ end }}) *dsl.Traversal { @@ -107,7 +106,7 @@ func ({{ $receiver }} *{{ $builder }}) gremlin({{ if $one }}id {{ $.ID.Type }}{{ {{- end }} } {{- end }} - v.ValueMap(true) + {{ if $one }}v.ValueMap(true){{ else }}v.Count(){{ end }} {{- with .NumConstraint }} if len(constraints) > 0 { {{- /* make sure the traversal does not contain more than one vertex if we have constraint */}} diff --git a/entc/gen/template/dialect/sql/by.tmpl b/entc/gen/template/dialect/sql/by.tmpl new file mode 100644 index 000000000..a4b6c5a51 --- /dev/null +++ b/entc/gen/template/dialect/sql/by.tmpl @@ -0,0 +1,28 @@ +{{ define "dialect/sql/order" -}} + {{- $f := $.Scope.Func -}} + func(s *sql.Selector) { + for _, f := range fields { + s.OrderBy(sql.{{ $f }}(f)) + } + } +{{- end }} + +{{/* custom signature for group-by function */}} +{{ define "dialect/sql/group/signature" -}} + // SQL the column wrapped with the aggregation function. + SQL func(*sql.Selector) string +{{- end }} + +{{ define "dialect/sql/group/as" -}} + func(s *sql.Selector) string { + return sql.As(fn.SQL(s), end) + } +{{- end }} + +{{ define "dialect/sql/group/func" -}} + {{- $fn := $.Scope.Func }} + {{- $withField := $.Scope.WithField }} + func(s *sql.Selector) string { + return sql.{{ if eq $fn "Mean" }}Avg{{ else }}{{ $fn }}{{ end }}({{ if $withField }}s.C(field){{ else }}"*"{{ end }}) + } +{{- end }} \ No newline at end of file diff --git a/entc/gen/template/dialect/sql/decode.tmpl b/entc/gen/template/dialect/sql/decode.tmpl new file mode 100644 index 000000000..aa38ca633 --- /dev/null +++ b/entc/gen/template/dialect/sql/decode.tmpl @@ -0,0 +1,59 @@ +{{ define "dialect/sql/decode/one" }} +{{ $receiver := $.Receiver }} + +// FromRows scans the sql response data into {{ $.Name }}. +func ({{ $receiver }} *{{ $.Name }}) FromRows(rows *sql.Rows) error { + {{- $scan := print "v" $receiver }} + var {{ $scan }} struct { + ID {{ if $.ID.IsString }}int{{ else }}{{ $.ID.Type }}{{ end }} + {{ range $_, $f := $.Fields }} + {{- pascal $f.Name }} {{ if or $f.Nullable $f.Optional }}{{ $f.NullType }}{{ else }}{{ $f.Type }}{{ end }} + {{ end }} + } + // the order here should be the same as in the `{{ $.Package }}.Columns`. + if err := rows.Scan( + &{{ $scan }}.ID, + {{- range $_, $f := $.Fields }} + &{{ $scan }}.{{- pascal $f.Name }}, + {{- end }} + ); err != nil { + return err + } + {{ $receiver }}.ID = {{ if $.ID.IsString }}strconv.Itoa({{ $scan }}.ID){{ else }}{{ $scan }}.ID{{ end }} + {{- range $_, $f := $.Fields }} + {{- if $f.Nullable }} + {{- if $f.IsTime }} + {{ $receiver }}.{{ pascal $f.Name }} = &{{ $scan }}.{{ pascal $f.Name }} + {{- else }} + if {{ $scan }}.{{- pascal $f.Name }}.Valid { + {{ $receiver }}.{{ pascal $f.Name }} = new({{ $f.Type }}) + *{{ $receiver }}.{{ pascal $f.Name }} = {{ printf "%s.%s" $scan (pascal $f.Name) | $f.NullTypeField }} + } + {{- end }} + {{- else if $f.Optional }} + {{ $receiver }}.{{ pascal $f.Name }} = {{ printf "%s.%s" $scan (pascal $f.Name) | $f.NullTypeField }} + {{- else }} + {{ $receiver }}.{{ pascal $f.Name }} = {{ $scan }}.{{ pascal $f.Name }} + {{- end }} + {{- end }} + return nil +} +{{ end }} + +{{ define "dialect/sql/decode/many" }} +{{ $receiver := $.Receiver }} +{{ $slice := $.Scope.Slice }} + +// FromRows scans the sql response data into {{ $slice }}. +func ({{ $receiver }} *{{ $slice }}) FromRows(rows *sql.Rows) error { + for rows.Next() { + {{- $scan := print "v" $receiver }} + {{ $scan }} := &{{ $.Name }}{} + if err := {{ $scan }}.FromRows(rows); err != nil { + return err + } + *{{ $receiver }} = append(*{{ $receiver }}, {{ $scan }}) + } + return nil +} +{{ end }} \ No newline at end of file diff --git a/entc/gen/template/dialect/sql/errors.tmpl b/entc/gen/template/dialect/sql/errors.tmpl new file mode 100644 index 000000000..9805b5045 --- /dev/null +++ b/entc/gen/template/dialect/sql/errors.tmpl @@ -0,0 +1,21 @@ +{{/* custom errors and errors handlers from sql dialects */}} +{{ define "dialect/sql/errors" }} +func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { + // Error number 1062 is ER_DUP_ENTRY in mysql, and "UNIQUE constraint failed" is SQLite prefix. + if msg := err.Error(); strings.HasPrefix(msg, "Error 1062") || strings.HasPrefix(msg, "UNIQUE constraint failed") { + return &ErrConstraintFailed{msg, err}, true + } + return nil, false +} + +// rollback calls to tx.Rollback and wraps the given error with the rollback error if occurred. +func rollback(tx dialect.Tx, err error) error { + if rerr := tx.Rollback(); rerr != nil { + err = fmt.Errorf("%s: %v", err.Error(), rerr) + } + if err, ok := isSQLConstraintError(err); ok { + return err + } + return err +} +{{ end }} \ No newline at end of file diff --git a/entc/gen/template/dialect/sql/meta.tmpl b/entc/gen/template/dialect/sql/meta.tmpl new file mode 100644 index 000000000..ec5d533f3 --- /dev/null +++ b/entc/gen/template/dialect/sql/meta.tmpl @@ -0,0 +1,42 @@ +{{/* constants needed for sql dialects. */}} +{{ define "dialect/sql/meta/constants" }} + // Table holds the table name of the {{ lower $.Name }} in the database. + Table = "{{ $.Table }}" + {{- range $_, $e := $.Edges }} + // {{ $e.TableConstant }} is the table the holds the {{ $e.Name }} relation/edge. + {{- if $e.M2M }} The primary key declared below.{{ end }} + {{ $e.TableConstant }} = "{{ $e.Rel.Table }}" + {{- if eq $.Table $e.Type.Table | not }} + // {{ $e.InverseTableConstant }} is the table name for the {{ $e.Type.Name }} entity. + // It exists in this package in order to avoid circular dependency with the "{{ $e.Type.Package }}" package. + {{ $e.InverseTableConstant }} = "{{ $e.Type.Table }}" + {{- end }} + {{- if not $e.M2M }} + // {{ $e.ColumnConstant }} is the table column denoting the {{ $e.Name }} relation/edge. + {{ $e.ColumnConstant }} = "{{ $e.Rel.Column }}" + {{- end }} + {{- end }} +{{ end }} + +{{/* variables needed for sql dialects. */}} +{{ define "dialect/sql/meta/variables" }} + // Columns holds all SQL columns are {{ lower $.Name }} fields. + var Columns = []string{ + {{ $.ID.Constant }}, + {{- range $_, $f := $.Fields }} + {{ $f.Constant }}, + {{- end }} + } + + {{ with $.NumM2M }} + var ( + {{- range $_, $e := $.Edges }} + {{- if $e.M2M }} + // {{ $e.PKConstant }} and {{ $e.ColumnConstant }}2 are the table columns denoting the + // primary key for the {{ $e.Name }} relation (M2M). + {{ $e.PKConstant }} = []string{"{{ index $e.Rel.Columns 0 }}", "{{ index $e.Rel.Columns 1 }}"} + {{- end }} + {{- end }} + ) + {{ end }} +{{ end }} \ No newline at end of file diff --git a/entc/gen/template/dialect/sql/predicate.tmpl b/entc/gen/template/dialect/sql/predicate.tmpl new file mode 100644 index 000000000..fb2796ea5 --- /dev/null +++ b/entc/gen/template/dialect/sql/predicate.tmpl @@ -0,0 +1,145 @@ +{{ define "dialect/sql/predicate/id" -}} + func(s *sql.Selector) { + {{- if $.ID.IsString }}id, _ := strconv.Atoi(id){{- end }} + s.Where(sql.EQ(s.C({{ $.ID.Constant }}), id)) + } +{{- end }} + +{{ define "dialect/sql/predicate/id/ops" -}} + {{- $op := $.Scope.Op -}} + {{- $arg := $.Scope.Arg -}} + func(s *sql.Selector) { + {{- if $op.Variadic }} + // if not arguments were provided, append the FALSE constants, + // since we can't apply "IN ()". This will make this predicate falsy. + if len({{ $arg }}) == 0 { + s.Where(sql.False()) + return + } + v := make([]interface{}, len({{ $arg }})) + for i := range v { + {{ if $.ID.IsString }}v[i], _ = strconv.Atoi({{ $arg }}[i]){{ else }}v[i] = {{ $arg }}[i]{{ end }} + } + {{- else if $.ID.IsString }} + v, _ := strconv.Atoi({{ $arg }}) + {{- end }} + s.Where(sql.{{ $op.Name }}(s.C({{ $.ID.Constant }}), v{{ if $op.Variadic }}...{{ end }})) + } +{{- end }} + +{{ define "dialect/sql/predicate/field" -}} + {{- $f := $.Scope.Field -}} + func(s *sql.Selector) { + s.Where(sql.EQ(s.C({{ $f.Constant }}), v)) + } +{{- end }} + +{{ define "dialect/sql/predicate/field/ops" -}} + {{- $f := $.Scope.Field -}} + {{- $op := $.Scope.Op -}} + {{- $arg := $.Scope.Arg -}} + func(s *sql.Selector) { + {{- if $op.Variadic }} + // if not arguments were provided, append the FALSE constants, + // since we can't apply "IN ()". This will make this predicate falsy. + if len({{ $arg }}) == 0 { + s.Where(sql.False()) + return + } + {{- end }} + s.Where(sql.{{ $op.Name }}(s.C({{ $f.Constant }}), v{{ if $op.Variadic }}...{{ end }})) + } +{{- end }} + +{{ define "dialect/sql/predicate/edge/has" -}} + {{- $e := $.Scope.Edge -}} + func(s *sql.Selector) { + {{- if $e.M2M }} + t1 := s.Table() + s.Where( + sql.In( + t1.C({{ $.ID.Constant }}), + sql.Select({{ $e.PKConstant }}[{{ if $e.IsInverse }}1{{ else }}0{{ end }}]).From(sql.Table({{ $e.TableConstant }})), + ), + ) + {{- else if or $e.M2O (and $e.O2O $e.IsInverse) }}{{/* M2O || (O2O with inverse edge) */}} + t1 := s.Table() + s.Where(sql.NotNull(t1.C({{ $e.ColumnConstant }}))) + {{- else }}{{/* O2M || (O2O with assoc edge) */}} + t1 := s.Table() + s.Where( + sql.In( + t1.C({{ $.ID.Constant }}), + sql.Select({{ $e.ColumnConstant }}). + From(sql.Table({{ $e.TableConstant }})). + Where(sql.NotNull({{ $e.ColumnConstant }})), + ), + ) + {{- end }} + } +{{- end }} + +{{ define "dialect/sql/predicate/edge/haswith" -}} + {{- $e := $.Scope.Edge -}} + func(s *sql.Selector) { + {{- if $e.M2M }} + {{ $i := 1 }}{{ $j := 0 }}{{- if $e.IsInverse }}{{ $i = 0 }}{{ $j = 1 }}{{ end -}} + t1 := s.Table() + t2 := sql.Table( + {{- if ne $.Table $e.Type.Table -}} + {{ $e.InverseTableConstant }} + {{- else -}} + Table + {{- end -}} + ) + t3 := sql.Table({{ $e.TableConstant }}) + t4 := sql.Select(t3.C({{ $e.PKConstant }}[{{ $j }}])). + From(t3). + Join(t2). + On(t3.C({{ $e.PKConstant }}[{{ $i }}]), t2.C({{ $e.Type.ID.Constant }})) + t5 := sql.Select().From(t2) + for _, p := range preds { + p(t5) + } + t4.FromSelect(t5) + s.Where(sql.In(t1.C({{ $.ID.Constant }}), t4)) + {{- else if or $e.M2O (and $e.O2O $e.IsInverse) }}{{/* M2O || (O2O with inverse edge) */}} + t1 := s.Table() + t2 := sql.Select({{ $e.Type.ID.Constant }}).From(sql.Table( + {{- if ne $.Table $e.Type.Table -}} + {{ $e.InverseTableConstant }} + {{- else -}} + {{ $e.TableConstant }} + {{- end -}} + )) + for _, p := range preds { + p(t2) + } + s.Where(sql.In(t1.C({{ $e.ColumnConstant }}), t2)) + {{- else }}{{/* O2M || (O2O with assoc edge) */}} + t1 := s.Table() + t2 := sql.Select({{ $e.ColumnConstant }}).From(sql.Table({{ $e.TableConstant }})) + for _, p := range preds { + p(t2) + } + s.Where(sql.In(t1.C({{ $.ID.Constant }}), t2)) + {{- end }} + } +{{- end }} + +{{ define "dialect/sql/predicate/or" -}} + func(s *sql.Selector) { + for i, p := range predicates { + if i > 0 { + s.Or() + } + p(s) + } + } +{{- end }} + +{{ define "dialect/sql/predicate/not" -}} + func(s *sql.Selector) { + p(s.Not()) + } +{{- end }} diff --git a/entc/gen/template/dialect/sql/query.tmpl b/entc/gen/template/dialect/sql/query.tmpl index 10b44c54c..cc8bea6f3 100644 --- a/entc/gen/template/dialect/sql/query.tmpl +++ b/entc/gen/template/dialect/sql/query.tmpl @@ -66,7 +66,6 @@ func ({{ $receiver }} *{{ $builder }}) sqlIDs(ctx context.Context) ([]{{ $.ID.Ty return ids, nil } - func ({{ $receiver }} *{{ $builder }}) sqlQuery() *sql.Selector { t1 := sql.Table({{ $.Package }}.Table) selector := sql.Select(t1.Columns({{ $.Package }}.Columns...)...).From(t1) @@ -78,7 +77,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlQuery() *sql.Selector { p(selector) } for _, p := range {{ $receiver }}.order { - p.SQL(selector) + p(selector) } if offset := {{ $receiver }}.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -90,5 +89,75 @@ func ({{ $receiver }} *{{ $builder }}) sqlQuery() *sql.Selector { } return selector } +{{ end }} +{{/* query/path defines the query generation for path of a given edge. */}} +{{ define "dialect/sql/query/path" }} + {{- $e := $.Scope.Edge }} {{/* the edge we need to genegrate the path to. */}} + {{- $receiver := $.Scope.Receiver }} + + {{- if $e.M2M }} + {{ $i := 1 }}{{ $j := 0 }}{{- if $e.IsInverse }}{{ $i = 0 }}{{ $j = 1 }}{{ end -}} + t1 := sql.Table({{ $e.Type.Package }}.Table) + t2 := {{ $receiver }}.sqlQuery() + t2.Select(t2.C({{ $.Package }}.{{ $.ID.Constant }})) + t3 := sql.Table({{ $.Package }}.{{ $e.TableConstant }}) + t4 := sql.Select(t3.C({{ $.Package }}.{{ $e.PKConstant }}[{{ $i }}])). + From(t3). + Join(t2). + On(t3.C({{ $.Package }}.{{ $e.PKConstant }}[{{ $j }}]), t2.C({{ $.Package }}.{{ $.ID.Constant }})) + query.sql = sql.Select(). + From(t1). + Join(t4). + On(t1.C({{ $e.Type.Package }}.{{ $e.Type.ID.Constant }}), t4.C({{ $.Package }}.{{ $e.PKConstant }}[{{ $i }}])) + {{- else if or $e.M2O (and $e.O2O $e.IsInverse) }}{{/* M2O || (O2O with inverse edge) */}} + t1 := sql.Table({{ $e.Type.Package }}.Table) + t2 := {{ $receiver }}.sqlQuery() + t2.Select(t2.C({{ $.Package }}.{{ $e.ColumnConstant }})) + query.sql = sql.Select(t1.Columns({{ $e.Type.Package }}.Columns...)...). + From(t1). + Join(t2). + On(t1.C({{ $e.Type.Package }}.{{ $e.Type.ID.Constant }}), t2.C({{ $.Package }}.{{ $e.ColumnConstant }})) + {{- else }}{{/* O2M || (O2O with assoc edge) */}} + t1 := sql.Table({{ $e.Type.Package }}.Table) + t2 := {{ $receiver }}.sqlQuery() + t2.Select(t2.C({{ $.Package }}.{{ $.ID.Constant }})) + query.sql = sql.Select(). + From(t1). + Join(t2). + On(t1.C({{ $.Package }}.{{ $e.ColumnConstant }}), t2.C({{ $.Package }}.{{ $.ID.Constant }})) + {{- end }} +{{ end }} + +{{/* query/from defines the query generation for an edge query from a given node. */}} +{{ define "dialect/sql/query/from" }} + {{- $n := $ }} {{/* the node we start the query from. */}} + {{- $e := $.Scope.Edge }} {{/* the edge we need to genegrate the path to. */}} + {{- $receiver := $.Scope.Receiver -}} + + id := {{ $receiver }}.{{- if $n.ID.IsString }}id(){{ else }}ID{{ end }} + {{- if $e.M2M }} + {{ $i := 1 }}{{ $j := 0 }}{{- if $e.IsInverse }}{{ $i = 0 }}{{ $j = 1 }}{{ end -}} + t1 := sql.Table({{ $e.Type.Package }}.Table) + t2 := sql.Table({{ $n.Package }}.Table) + t3 := sql.Table({{ $n.Package }}.{{ $e.TableConstant }}) + t4 := sql.Select(t3.C({{ $n.Package }}.{{ $e.PKConstant }}[{{ $i }}])). + From(t3). + Join(t2). + On(t3.C({{ $n.Package }}.{{ $e.PKConstant }}[{{ $j }}]), t2.C({{ $n.Package }}.{{ $n.ID.Constant }})). + Where(sql.EQ(t2.C({{ $n.Package }}.{{ $n.ID.Constant }}), id)) + query.sql = sql.Select(). + From(t1). + Join(t4). + On(t1.C({{ $e.Type.Package }}.{{ $e.Type.ID.Constant }}), t4.C({{ $n.Package }}.{{ $e.PKConstant }}[{{ $i }}])) + {{- else if or $e.M2O (and $e.O2O $e.IsInverse) }}{{/* M2O || (O2O with inverse edge) */}} + t1 := sql.Table({{ $e.Type.Package }}.Table) + t2 := sql.Select({{ $n.Package }}.{{ $e.ColumnConstant }}). + From(sql.Table({{ $n.Package }}.{{ $e.TableConstant }})). + Where(sql.EQ({{ $n.Package }}.{{ $n.ID.Constant }}, id)) + query.sql = sql.Select().From(t1).Join(t2).On(t1.C({{ $e.Type.Package }}.{{ $e.Type.ID.Constant }}), t2.C({{ $n.Package }}.{{ $e.ColumnConstant }})) + {{- else }}{{/* O2M || (O2O with assoc edge) */}} + query.sql = sql.Select().From(sql.Table({{ $e.Type.Package }}.Table)). + Where(sql.EQ({{ $n.Package }}.{{ $e.ColumnConstant }}, id)) + {{- end }} {{ end }} \ No newline at end of file diff --git a/entc/gen/template/ent.tmpl b/entc/gen/template/ent.tmpl index c4f3923dd..be58e5363 100644 --- a/entc/gen/template/ent.tmpl +++ b/entc/gen/template/ent.tmpl @@ -23,69 +23,13 @@ type {{ $.Name }} struct { {{ end -}} } +{{ range $_, $storage := $.Storage }} + {{ $tmpl := printf "dialect/%s/decode/one" $storage }} + {{ xtemplate $tmpl $ }} +{{ end }} + {{ $receiver := $.Receiver }} -// FromResponse scans the gremlin response data into {{ $.Name }}. -func ({{ $receiver }} *{{ $.Name }}) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - {{- $scan := print "v" $receiver }} - var {{ $scan }} struct { - ID {{ $.ID.Type }} `json:"id,omitempty"` - {{ range $_, $f := $.Fields }} - {{- pascal $f.Name }} {{ if $f.IsTime }}int64{{ else }}{{ if $f.Nullable }}*{{ end }}{{ $f.Type }}{{ end }} `json:"{{ $f.Name }},omitempty"` - {{ end }} - } - if err := vmap.Decode(&{{ $scan }}); err != nil { - return err - } - {{ $receiver }}.ID = {{ $scan }}.ID - {{ range $_, $f := $.Fields }} - {{- $receiver }}.{{ pascal $f.Name }} = {{- if $f.IsTime }}time.Unix({{ $scan }}.{{- pascal $f.Name }}, 0) {{ else }}{{- $scan }}.{{- pascal $f.Name }}{{ end }} - {{ end -}} - return nil -} - -// FromRows scans the sql response data into {{ $.Name }}. -func ({{ $receiver }} *{{ $.Name }}) FromRows(rows *sql.Rows) error { - {{- $scan = print "v" $receiver }} - var {{ $scan }} struct { - ID {{ if $.ID.IsString }}int{{ else }}{{ $.ID.Type }}{{ end }} - {{ range $_, $f := $.Fields }} - {{- pascal $f.Name }} {{ if or $f.Nullable $f.Optional }}{{ $f.NullType }}{{ else }}{{ $f.Type }}{{ end }} - {{ end }} - } - // the order here should be the same as in the `{{ $.Package }}.Columns`. - if err := rows.Scan( - &{{ $scan }}.ID, - {{- range $_, $f := $.Fields }} - &{{ $scan }}.{{- pascal $f.Name }}, - {{- end }} - ); err != nil { - return err - } - {{ $receiver }}.ID = {{ if $.ID.IsString }}strconv.Itoa({{ $scan }}.ID){{ else }}{{ $scan }}.ID{{ end }} - {{- range $_, $f := $.Fields }} - {{- if $f.Nullable }} - {{- if $f.IsTime }} - {{ $receiver }}.{{ pascal $f.Name }} = &{{ $scan }}.{{ pascal $f.Name }} - {{- else }} - if {{ $scan }}.{{- pascal $f.Name }}.Valid { - {{ $receiver }}.{{ pascal $f.Name }} = new({{ $f.Type }}) - *{{ $receiver }}.{{ pascal $f.Name }} = {{ printf "%s.%s" $scan (pascal $f.Name) | $f.NullTypeField }} - } - {{- end }} - {{- else if $f.Optional }} - {{ $receiver }}.{{ pascal $f.Name }} = {{ printf "%s.%s" $scan (pascal $f.Name) | $f.NullTypeField }} - {{- else }} - {{ $receiver }}.{{ pascal $f.Name }} = {{ $scan }}.{{ pascal $f.Name }} - {{- end }} - {{- end }} - return nil -} - {{ range $_, $e := $.Edges }} {{ $func := print "Query" (pascal $e.Name) }} // {{ $func }} queries the {{ $e.Name }} edge of the {{ $.Name }}. @@ -142,45 +86,12 @@ func ({{ $receiver }} *{{ $.Name }}) id() int { // {{ $slice }} is a parsable slice of {{ $.Name }}. type {{ $slice }} []*{{ $.Name }} -// FromResponse scans the gremlin response data into {{ $slice }}. -func ({{ $receiver }} *{{ $slice }}) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - {{- $scan = print "v" $receiver }} - var {{ $scan }} []struct { - ID {{ $.ID.Type }} `json:"id,omitempty"` - {{ range $_, $f := $.Fields }} - {{- pascal $f.Name }} {{ if $f.IsTime }}int64{{ else }}{{ if $f.Nullable }}*{{ end }}{{ $f.Type }}{{ end }} `json:"{{ $f.Name }},omitempty"` - {{ end }} - } - if err := vmap.Decode(&{{ $scan }}); err != nil { - return err - } - for _, v := range {{ $scan }} { - *{{ $receiver }} = append(*{{ $receiver }}, &{{ $.Name }}{ - ID: v.ID, - {{ range $_, $f := $.Fields }} - {{- pascal $f.Name }}: {{- if $f.IsTime }}time.Unix(v.{{ pascal $f.Name }}, 0) {{ else }}v.{{ pascal $f.Name }}{{ end }}, - {{ end -}} - }) - } - return nil -} - -// FromRows scans the sql response data into {{ $slice }}. -func ({{ $receiver }} *{{ $slice }}) FromRows(rows *sql.Rows) error { - for rows.Next() { - {{- $scan = print "v" $receiver }} - {{ $scan }} := &{{ $.Name }}{} - if err := {{ $scan }}.FromRows(rows); err != nil { - return err - } - *{{ $receiver }} = append(*{{ $receiver }}, {{ $scan }}) - } - return nil -} +{{ range $_, $storage := $.Storage }} + {{ with extend $ "Slice" $slice }} + {{ $tmpl := printf "dialect/%s/decode/many" $storage }} + {{ xtemplate $tmpl . }} + {{ end }} +{{ end }} func ({{ $receiver }} {{ $slice }}) config(cfg config) { for i := range {{ $receiver }} { diff --git a/entc/gen/template/example.tmpl b/entc/gen/template/example.tmpl index 6a59e7e4c..c6e701fac 100644 --- a/entc/gen/template/example.tmpl +++ b/entc/gen/template/example.tmpl @@ -8,42 +8,32 @@ import ( "os" "net/url" + "fbc/ent/dialect/sql" {{ range $_, $n := $.Nodes }} "{{ $n.Config.Package }}/{{ $n.Package }}" {{- end }} - - "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" ) {{ $env := upper $pkg | printf "%s_INTEGRATION_ENDPOINT" }} -// endpoint for the database. In order to run the tests locally, run the following command: +// dsn for the database. In order to run the tests locally, run the following command: // -// {{ $env }}="http://localhost:8182" go test -v +// {{ $env }}="root:pass@tcp(localhost:3306)/test?parseTime=True" go test -v // -var endpoint *gremlin.Endpoint - -func init() { - if e, ok := os.LookupEnv("{{ $env }}"); ok { - if u, err := url.Parse(e); err == nil { - endpoint = &gremlin.Endpoint{u} - } - } -} +var dsn string {{ range $_, $n := $.Nodes -}} func Example{{ pascal $n.Name }}() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the {{ lower $n.Name }}'s edges. {{ range $i, $e := $n.Edges }} {{- if not $e.IsInverse }} diff --git a/entc/gen/template/import.tmpl b/entc/gen/template/import.tmpl index 4a2c3513d..7a25b4609 100644 --- a/entc/gen/template/import.tmpl +++ b/entc/gen/template/import.tmpl @@ -17,12 +17,10 @@ import ( "fbc/ent" "fbc/ent/dialect" - "fbc/ent/dialect/sql" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" - "fbc/ent/dialect/gremlin/graph/dsl/g" - "fbc/ent/dialect/gremlin/graph/dsl/p" - "fbc/ent/dialect/gremlin/encoding/graphson" + {{ range $_, $storage := $.Storage -}} + {{ range $_, $import := $storage.Imports -}} + "{{ $import }}" + {{ end -}} + {{ end -}} ) {{ end }} diff --git a/entc/gen/template/meta.tmpl b/entc/gen/template/meta.tmpl index 9a2693a1b..bc1f87138 100644 --- a/entc/gen/template/meta.tmpl +++ b/entc/gen/template/meta.tmpl @@ -7,14 +7,8 @@ const ( // Label holds the string label denoting the {{ lower $.Name }} type in the database. Label = "{{ $.Label }}" - {{ range $_, $e := $.Edges }}{{ $label := $e.Constant -}} - {{ if $e.IsInverse }}{{- $label = $e.InverseConstant -}} - // {{ $label }} holds the string label denoting the {{ lower $e.Name }} inverse edge type in the database. - {{ else -}} - // {{ $label }} holds the string label denoting the {{ lower $e.Name }} edge type in the database. - {{ end -}} - {{ $label }} = "{{ $e.Label }}" - {{ end -}} + // {{ $.ID.Constant }} holds the string denoting the id field in the database. + {{ $.ID.Constant }} = "{{ snake $.ID.Name }}" {{ range $_, $f := $.Fields -}}{{ $field := $f.Constant -}} // {{ $field }} holds the string denoting the {{ lower $f.Name }} vertex property in the database. {{ $field }} = "{{ snake $f.Name }}" @@ -24,44 +18,17 @@ const ( {{ $default }} {{ if $f.Type.Numeric }} {{ $f.Type }} {{ end }} = {{ printf "%#v" $f.Default }} {{ end -}} {{ end -}} - // {{ $.ID.Constant }} holds the string denoting the id field in the database. - {{ $.ID.Constant }} = "{{ snake $.ID.Name }}" - // Table holds the table name of the {{ lower $.Name }} in the database. - Table = "{{ $.Table }}" - {{- range $_, $e := $.Edges }} - // {{ $e.TableConstant }} is the table the holds the {{ $e.Name }} relation/edge. - {{- if $e.M2M }} The primary key declared below.{{ end }} - {{ $e.TableConstant }} = "{{ $e.Rel.Table }}" - {{- if eq $.Table $e.Type.Table | not }} - // {{ $e.InverseTableConstant }} is the table name for the {{ $e.Type.Name }} entity. - // It exists in this package in order to avoid circular dependency with the "{{ $e.Type.Package }}" package. - {{ $e.InverseTableConstant }} = "{{ $e.Type.Table }}" - {{- end }} - {{- if not $e.M2M }} - // {{ $e.ColumnConstant }} is the table column denoting the {{ $e.Name }} relation/edge. - {{ $e.ColumnConstant }} = "{{ $e.Rel.Column }}" - {{- end }} - {{- end }} + {{ range $_, $storage := $.Storage }} + {{ $tmpl := printf "dialect/%s/meta/constants" $storage }} + {{ xtemplate $tmpl $ }} + {{ end }} ) -// Columns holds all SQL columns are {{ lower $.Name }} fields. -var Columns = []string{ - {{ $.ID.Constant }}, - {{- range $_, $f := $.Fields }} - {{ $f.Constant }}, - {{- end }} -} - -{{ with $.NumM2M }} - var ( - {{- range $_, $e := $.Edges }} - {{- if $e.M2M }} - // {{ $e.PKConstant }} and {{ $e.ColumnConstant }}2 are the table columns denoting the - // primary key for the {{ $e.Name }} relation (M2M). - {{ $e.PKConstant }} = []string{"{{ index $e.Rel.Columns 0 }}", "{{ index $e.Rel.Columns 1 }}"} - {{- end }} - {{- end }} - ) +{{ range $_, $storage := $.Storage }} + {{ $tmpl := printf "dialect/%s/meta/variables" $storage }} + {{ if hasTemplate $tmpl }} + {{ xtemplate $tmpl $ }} + {{ end }} {{ end }} {{ if $.HasValidators }} diff --git a/entc/gen/template/predicate.tmpl b/entc/gen/template/predicate.tmpl index 044258376..2d925864c 100644 --- a/entc/gen/template/predicate.tmpl +++ b/entc/gen/template/predicate.tmpl @@ -11,20 +11,22 @@ import ( {{ range $_, $n := $.Nodes -}} // {{ $n.Name }} is the predicate function for {{ $n.Package }} builders. -type {{ $n.Name }} func(interface{}) +type {{ $n.Name }} func({{ if gt (len $.Storage) 1 }}interface{}{{ else }}{{ (index $.Storage 0).Builder }}{{ end }}) -// {{ $n.Name }}PerDialect construct a predicate for both gremlin traversal and sql selector. -func {{ $n.Name }}PerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) {{ $n.Name }} { +{{ if gt (len $.Storage) 1 }} +// {{ $n.Name }}PerDialect construct a predicate for graph traversals based on dialect type. +func {{ $n.Name }}PerDialect({{ range $i, $storage := $.Storage }}{{ if $i }},{{ end }}f{{ $i }} func({{ $storage.Builder }}){{ end }}) {{ $n.Name }} { return {{ $n.Name }}(func (v interface{}) { switch v := v.(type) { - case *sql.Selector: - f1(v) - case *dsl.Traversal: - f2(v) + {{- range $i, $storage := $.Storage }} + case {{ $storage.Builder }}: + f{{ $i }}(v) + {{- end }} default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } }) } {{ end }} +{{ end }} {{ end }} \ No newline at end of file diff --git a/entc/gen/template/where.tmpl b/entc/gen/template/where.tmpl index 66736e3ff..171c22d79 100644 --- a/entc/gen/template/where.tmpl +++ b/entc/gen/template/where.tmpl @@ -6,49 +6,26 @@ // ID filters vertices based on their identifier. func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { - return predicate.{{ $.Name }}PerDialect( - func(s *sql.Selector) { - {{- if $.ID.IsString }}id, _ := strconv.Atoi(id){{- end }} - s.Where(sql.EQ(s.C({{ $.ID.Constant }}), id)) - }, - func(t *dsl.Traversal) { - t.HasID(id) - }, + return predicate.{{ $.Name }}{{ if gt (len $.Storage) 1 }}PerDialect{{ end }}( + {{ range $_, $storage := $.Storage -}} + {{ $tmpl := printf "dialect/%s/predicate/id" $storage }} + {{- xtemplate $tmpl $ }}, + {{ end -}} ) } {{ range $_, $op := ops $.ID }} - {{ $r := "id" }}{{ if $op.Variadic }}{{ $r = "ids" }}{{ end }} + {{ $arg := "id" }}{{ if $op.Variadic }}{{ $arg = "ids" }}{{ end }} {{ $func := printf "ID%s" $op.Name }} // {{ $func }} applies the {{ $op.Name }} predicate on the ID field. - func {{ $func }}({{ $r }} {{ if $op.Variadic }}...{{ end }}{{ $.ID.Type }}) predicate.{{ $.Name }} { - return predicate.{{ $.Name }}PerDialect( - func(s *sql.Selector) { - {{- if $op.Variadic }} - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len({{ $r }}) == 0 { - s.Where(sql.False()) - return - } - v := make([]interface{}, len({{ $r }})) - for i := range v { - {{ if $.ID.IsString }}v[i], _ = strconv.Atoi({{ $r }}[i]){{ else }}v[i] = {{ $r }}[i]{{ end }} - } - {{- else if $.ID.IsString }} - v, _ := strconv.Atoi({{ $r }}) - {{- end }} - s.Where(sql.{{ $op.Name }}(s.C({{ $.ID.Constant }}), v{{ if $op.Variadic }}...{{ end }})) - }, - func(t *dsl.Traversal) { - {{- if $op.Variadic }} - v := make([]interface{}, len({{ $r }})) - for i := range v { - v[i] = {{ $r }}[i] - } - {{- end }} - t.HasID(p.{{ $op.Gremlin }}({{ if $op.Variadic }}v...{{ else }}{{ $r }}{{ end }})) - }, + func {{ $func }}({{ $arg }} {{ if $op.Variadic }}...{{ end }}{{ $.ID.Type }}) predicate.{{ $.Name }} { + return predicate.{{ $.Name }}{{ if gt (len $.Storage) 1 }}PerDialect{{ end }}( + {{ range $_, $storage := $.Storage -}} + {{- with extend $ "Arg" $arg "Op" $op -}} + {{ $tmpl := printf "dialect/%s/predicate/id/ops" $storage }} + {{- xtemplate $tmpl . }}, + {{ end -}} + {{ end -}} ) } {{ end }} @@ -57,44 +34,36 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { {{ $func := pascal $f.Name }} // {{ $func }} applies equality check predicate on the {{ quote $f.Name }} field. It's identical to {{ $func }}EQ. func {{ $func }}(v {{ $f.Type }}) predicate.{{ $.Name }} { - return predicate.{{ $.Name }}PerDialect( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C({{ $f.Constant }}), v)) - }, - func(t *dsl.Traversal) { - t.Has(Label, {{ $f.Constant }}, p.EQ(v)) - }, + return predicate.{{ $.Name }}{{ if gt (len $.Storage) 1 }}PerDialect{{ end }}( + {{ range $_, $storage := $.Storage -}} + {{- with extend $ "Field" $f -}} + {{ $tmpl := printf "dialect/%s/predicate/field" $storage }} + {{- xtemplate $tmpl . }}, + {{ end -}} + {{ end -}} ) } {{ end }} {{ range $_, $f := $.Fields }} {{ range $_, $op := (ops $f) }} - {{ $r := "v" }}{{ if $op.Variadic }}{{ $r = "vs" }}{{ end }} + {{ $arg := "v" }}{{ if $op.Variadic }}{{ $arg = "vs" }}{{ end }} {{ $func := print (pascal $f.Name) ($op.Name) }} // {{ $func }} applies the {{ $op.Name }} predicate on the {{ quote $f.Name }} field. - func {{ $func }}({{ $r }} {{ if $op.Variadic }}...{{ end }}{{ $f.Type }}) predicate.{{ $.Name }} { + func {{ $func }}({{ $arg }} {{ if $op.Variadic }}...{{ end }}{{ $f.Type }}) predicate.{{ $.Name }} { {{- if $op.Variadic }} - v := make([]interface{}, len({{ $r }})) + v := make([]interface{}, len({{ $arg }})) for i := range v { - v[i] = {{ $r }}[i] + v[i] = {{ $arg }}[i] } {{- end }} - return predicate.{{ $.Name }}PerDialect( - func(s *sql.Selector) { - {{- if $op.Variadic }} - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len({{ $r }}) == 0 { - s.Where(sql.False()) - return - } - {{- end }} - s.Where(sql.{{ $op.Name }}(s.C({{ $f.Constant }}), v{{ if $op.Variadic }}...{{ end }})) - }, - func(t *dsl.Traversal) { - t.Has(Label, {{ $f.Constant }}, p.{{ $op.Gremlin }}(v{{ if $op.Variadic }}...{{ end }})) - }, + return predicate.{{ $.Name }}{{ if gt (len $.Storage) 1 }}PerDialect{{ end }}( + {{ range $_, $storage := $.Storage -}} + {{- with extend $ "Arg" $arg "Field" $f "Op" $op -}} + {{ $tmpl := printf "dialect/%s/predicate/field/ops" $storage }} + {{- xtemplate $tmpl . }}, + {{ end -}} + {{ end -}} ) } {{ end }} @@ -102,121 +71,27 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { {{ range $_, $e := $.Edges }} {{ $func := pascal $e.Name | printf "Has%s" }} - {{ $label := $e.Constant }} - {{ $direction := "Out" }} - {{ $inverse_direction := "In" }} - {{ if $e.IsInverse }} - {{ $direction = "In" }} - {{ $inverse_direction = "Out" }} - {{/* avoid circular dependecies */}} - {{ $label = $e.InverseConstant }} - {{ end }} // {{ $func }} applies the HasEdge predicate on the {{ quote $e.Name }} edge. func {{ $func }}() predicate.{{ $.Name }} { - return predicate.{{ $.Name }}PerDialect( - func(s *sql.Selector) { - {{- if $e.M2M }} - t1 := s.Table() - s.Where( - sql.In( - t1.C({{ $.ID.Constant }}), - sql.Select({{ $e.PKConstant }}[{{ if $e.IsInverse }}1{{ else }}0{{ end }}]).From(sql.Table({{ $e.TableConstant }})), - ), - ) - {{- else if or $e.M2O (and $e.O2O $e.IsInverse) }}{{/* M2O || (O2O with inverse edge) */}} - t1 := s.Table() - s.Where(sql.NotNull(t1.C({{ $e.ColumnConstant }}))) - {{- else }}{{/* O2M || (O2O with assoc edge) */}} - t1 := s.Table() - s.Where( - sql.In( - t1.C({{ $.ID.Constant }}), - sql.Select({{ $e.ColumnConstant }}). - From(sql.Table({{ $e.TableConstant }})). - Where(sql.NotNull({{ $e.ColumnConstant }})), - ), - ) - {{- end }} - }, - func(t *dsl.Traversal) { - {{- /* if it's an edge with self-reference, take the two vertices */}} - {{- if $e.SelfRef }} - t.Both({{ $label }}) - {{- else }} - t.{{ $direction }}E({{ $label }}).{{ $direction }}V() - {{- end }} - }, + return predicate.{{ $.Name }}{{ if gt (len $.Storage) 1 }}PerDialect{{ end }}( + {{ range $_, $storage := $.Storage -}} + {{- with extend $ "Edge" $e -}} + {{ $tmpl := printf "dialect/%s/predicate/edge/has" $storage }} + {{- xtemplate $tmpl . }}, + {{ end -}} + {{ end -}} ) } {{ $func = printf "%sWith" $func }} // {{ $func }} applies the HasEdge predicate on the {{ quote $e.Name }} edge with a given conditions (other predicates). func {{ $func }}(preds ...predicate.{{ $e.Type.Name }}) predicate.{{ $.Name }} { - return predicate.{{ $.Name }}PerDialect( - func(s *sql.Selector) { - {{- if $e.M2M }} - {{ $i := 1 }}{{ $j := 0 }}{{- if $e.IsInverse }}{{ $i = 0 }}{{ $j = 1 }}{{ end -}} - t1 := s.Table() - t2 := sql.Table( - {{- if ne $.Table $e.Type.Table -}} - {{ $e.InverseTableConstant }} - {{- else -}} - Table - {{- end -}} - ) - t3 := sql.Table({{ $e.TableConstant }}) - t4 := sql.Select(t3.C({{ $e.PKConstant }}[{{ $j }}])). - From(t3). - Join(t2). - On(t3.C({{ $e.PKConstant }}[{{ $i }}]), t2.C({{ $e.Type.ID.Constant }})) - t5 := sql.Select().From(t2) - for _, p := range preds { - p(t5) - } - t4.FromSelect(t5) - s.Where(sql.In(t1.C({{ $.ID.Constant }}), t4)) - {{- else if or $e.M2O (and $e.O2O $e.IsInverse) }}{{/* M2O || (O2O with inverse edge) */}} - t1 := s.Table() - t2 := sql.Select({{ $e.Type.ID.Constant }}).From(sql.Table( - {{- if ne $.Table $e.Type.Table -}} - {{ $e.InverseTableConstant }} - {{- else -}} - {{ $e.TableConstant }} - {{- end -}} - )) - for _, p := range preds { - p(t2) - } - s.Where(sql.In(t1.C({{ $e.ColumnConstant }}), t2)) - {{- else }}{{/* O2M || (O2O with assoc edge) */}} - t1 := s.Table() - t2 := sql.Select({{ $e.ColumnConstant }}).From(sql.Table({{ $e.TableConstant }})) - for _, p := range preds { - p(t2) - } - s.Where(sql.In(t1.C({{ $.ID.Constant }}), t2)) - {{- end }} - }, - func(t *dsl.Traversal) { - {{- if $e.SelfRef }}{{/* selfref means it should be true in one of the directions */}} - in, out := __.InV(), __.OutV() - for _, p := range preds { - p(in) - p(out) - } - t.Where( - __.Or( - __.OutE({{ $label }}).Where(in), - __.InE({{ $label }}).Where(out), - ), - ) - {{- else }} - tr := __.{{ $inverse_direction }}V() - for _, p := range preds { - p(tr) - } - t.{{ $direction }}E({{ $label }}).Where(tr).{{ $direction }}V() - {{- end }} - }, + return predicate.{{ $.Name }}{{ if gt (len $.Storage) 1 }}PerDialect{{ end }}( + {{ range $_, $storage := $.Storage -}} + {{- with extend $ "Edge" $e -}} + {{ $tmpl := printf "dialect/%s/predicate/edge/haswith" $storage }} + {{- xtemplate $tmpl . }}, + {{ end -}} + {{ end -}} ) } {{ end }} @@ -224,38 +99,21 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { // Or groups list of predicates with the or operator between them. func Or(predicates ...predicate.{{ $.Name }}) predicate.{{ $.Name }} { - return predicate.{{ $.Name }}PerDialect( - func(s *sql.Selector) { - for i, p := range predicates { - if i > 0 { - s.Or() - } - p(s) - } - }, - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, + return predicate.{{ $.Name }}{{ if gt (len $.Storage) 1 }}PerDialect{{ end }}( + {{ range $_, $storage := $.Storage -}} + {{ $tmpl := printf "dialect/%s/predicate/or" $storage }} + {{- xtemplate $tmpl . }}, + {{ end -}} ) } // Not applies the not operator on the given predicate. func Not(p predicate.{{ $.Name }}) predicate.{{ $.Name }} { - return predicate.{{ $.Name }}PerDialect( - func(s *sql.Selector) { - p(s.Not()) - }, - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, + return predicate.{{ $.Name }}{{ if gt (len $.Storage) 1 }}PerDialect{{ end }}( + {{ range $_, $storage := $.Storage -}} + {{ $tmpl := printf "dialect/%s/predicate/not" $storage }} + {{- xtemplate $tmpl . }}, + {{ end -}} ) } diff --git a/entc/integration/compose/docker-compose.yaml b/entc/integration/compose/docker-compose.yaml index 8a36f8fd7..6e9dee8c0 100644 --- a/entc/integration/compose/docker-compose.yaml +++ b/entc/integration/compose/docker-compose.yaml @@ -3,7 +3,7 @@ version: "3.7" services: mysql: - image: mysql:5.7.26 + image: mysql:5.7.23 environment: MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: pass diff --git a/entc/integration/ent/card.go b/entc/integration/ent/card.go index 586cf9870..f22bba426 100644 --- a/entc/integration/ent/card.go +++ b/entc/integration/ent/card.go @@ -20,24 +20,6 @@ type Card struct { Number string `json:"number,omitempty"` } -// FromResponse scans the gremlin response data into Card. -func (c *Card) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vc struct { - ID string `json:"id,omitempty"` - Number string `json:"number,omitempty"` - } - if err := vmap.Decode(&vc); err != nil { - return err - } - c.ID = vc.ID - c.Number = vc.Number - return nil -} - // FromRows scans the sql response data into Card. func (c *Card) FromRows(rows *sql.Rows) error { var vc struct { @@ -56,6 +38,24 @@ func (c *Card) FromRows(rows *sql.Rows) error { return nil } +// FromResponse scans the gremlin response data into Card. +func (c *Card) FromResponse(res *gremlin.Response) error { + vmap, err := res.ReadValueMap() + if err != nil { + return err + } + var vc struct { + ID string `json:"id,omitempty"` + Number string `json:"number,omitempty"` + } + if err := vmap.Decode(&vc); err != nil { + return err + } + c.ID = vc.ID + c.Number = vc.Number + return nil +} + // QueryOwner queries the owner edge of the Card. func (c *Card) QueryOwner() *UserQuery { return (&CardClient{c.config}).QueryOwner(c) @@ -98,6 +98,18 @@ func (c *Card) id() int { // Cards is a parsable slice of Card. type Cards []*Card +// FromRows scans the sql response data into Cards. +func (c *Cards) FromRows(rows *sql.Rows) error { + for rows.Next() { + vc := &Card{} + if err := vc.FromRows(rows); err != nil { + return err + } + *c = append(*c, vc) + } + return nil +} + // FromResponse scans the gremlin response data into Cards. func (c *Cards) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -120,18 +132,6 @@ func (c *Cards) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into Cards. -func (c *Cards) FromRows(rows *sql.Rows) error { - for rows.Next() { - vc := &Card{} - if err := vc.FromRows(rows); err != nil { - return err - } - *c = append(*c, vc) - } - return nil -} - func (c Cards) config(cfg config) { for i := range c { c[i].config = cfg diff --git a/entc/integration/ent/card/card.go b/entc/integration/ent/card/card.go index 896efbe39..e50bd1735 100644 --- a/entc/integration/ent/card/card.go +++ b/entc/integration/ent/card/card.go @@ -9,12 +9,11 @@ import ( const ( // Label holds the string label denoting the card type in the database. Label = "card" - // OwnerInverseLabel holds the string label denoting the owner inverse edge type in the database. - OwnerInverseLabel = "user_card" - // FieldNumber holds the string denoting the number vertex property in the database. - FieldNumber = "number" // FieldID holds the string denoting the id field in the database. FieldID = "id" + // FieldNumber holds the string denoting the number vertex property in the database. + FieldNumber = "number" + // Table holds the table name of the card in the database. Table = "cards" // OwnerTable is the table the holds the owner relation/edge. @@ -24,6 +23,9 @@ const ( OwnerInverseTable = "users" // OwnerColumn is the table column denoting the owner relation/edge. OwnerColumn = "owner_id" + + // OwnerInverseLabel holds the string label denoting the owner inverse edge type in the database. + OwnerInverseLabel = "user_card" ) // Columns holds all SQL columns are card fields. diff --git a/entc/integration/ent/card_query.go b/entc/integration/ent/card_query.go index 9aa964e32..6dc802554 100644 --- a/entc/integration/ent/card_query.go +++ b/entc/integration/ent/card_query.go @@ -384,7 +384,7 @@ func (cq *CardQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range cq.order { - p.SQL(selector) + p(selector) } if offset := cq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -457,7 +457,7 @@ func (cq *CardQuery) gremlinQuery() *dsl.Traversal { if len(cq.order) > 0 { v.Order() for _, p := range cq.order { - p.Gremlin(v) + p(v) } } switch limit, offset := cq.limit, cq.offset; { diff --git a/entc/integration/ent/card_update.go b/entc/integration/ent/card_update.go index 618766c12..c64825e32 100644 --- a/entc/integration/ent/card_update.go +++ b/entc/integration/ent/card_update.go @@ -84,8 +84,7 @@ func (cu *CardUpdate) Save(ctx context.Context) (int, error) { case dialect.MySQL, dialect.SQLite: return cu.sqlSave(ctx) case dialect.Neptune: - vertices, err := cu.gremlinSave(ctx) - return len(vertices), err + return cu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } @@ -192,21 +191,16 @@ func (cu *CardUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (cu *CardUpdate) gremlinSave(ctx context.Context) ([]*Card, error) { +func (cu *CardUpdate) gremlinSave(ctx context.Context) (int, error) { res := &gremlin.Response{} query, bindings := cu.gremlin().Query() if err := cu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return 0, err } if err, ok := isConstantError(res); ok { - return nil, err + return 0, err } - var cs Cards - cs.config(cu.config) - if err := cs.FromResponse(res); err != nil { - return nil, err - } - return cs, nil + return res.ReadInt() } func (cu *CardUpdate) gremlin() *dsl.Traversal { @@ -237,7 +231,7 @@ func (cu *CardUpdate) gremlin() *dsl.Traversal { test: __.Is(p.NEQ(0)).Constant(NewErrUniqueEdge(card.Label, user.CardLabel, id)), }) } - v.ValueMap(true) + v.Count() if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), diff --git a/entc/integration/ent/comment.go b/entc/integration/ent/comment.go index e3621a67e..fc91633f5 100644 --- a/entc/integration/ent/comment.go +++ b/entc/integration/ent/comment.go @@ -18,6 +18,21 @@ type Comment struct { ID string `json:"id,omitempty"` } +// FromRows scans the sql response data into Comment. +func (c *Comment) FromRows(rows *sql.Rows) error { + var vc struct { + ID int + } + // the order here should be the same as in the `comment.Columns`. + if err := rows.Scan( + &vc.ID, + ); err != nil { + return err + } + c.ID = strconv.Itoa(vc.ID) + return nil +} + // FromResponse scans the gremlin response data into Comment. func (c *Comment) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -34,21 +49,6 @@ func (c *Comment) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into Comment. -func (c *Comment) FromRows(rows *sql.Rows) error { - var vc struct { - ID int - } - // the order here should be the same as in the `comment.Columns`. - if err := rows.Scan( - &vc.ID, - ); err != nil { - return err - } - c.ID = strconv.Itoa(vc.ID) - return nil -} - // Update returns a builder for updating this Comment. // Note that, you need to call Comment.Unwrap() before calling this method, if this Comment // was returned from a transaction, and the transaction was committed or rolled back. @@ -85,6 +85,18 @@ func (c *Comment) id() int { // Comments is a parsable slice of Comment. type Comments []*Comment +// FromRows scans the sql response data into Comments. +func (c *Comments) FromRows(rows *sql.Rows) error { + for rows.Next() { + vc := &Comment{} + if err := vc.FromRows(rows); err != nil { + return err + } + *c = append(*c, vc) + } + return nil +} + // FromResponse scans the gremlin response data into Comments. func (c *Comments) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -105,18 +117,6 @@ func (c *Comments) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into Comments. -func (c *Comments) FromRows(rows *sql.Rows) error { - for rows.Next() { - vc := &Comment{} - if err := vc.FromRows(rows); err != nil { - return err - } - *c = append(*c, vc) - } - return nil -} - func (c Comments) config(cfg config) { for i := range c { c[i].config = cfg diff --git a/entc/integration/ent/comment/comment.go b/entc/integration/ent/comment/comment.go index f49f317ca..81e607fae 100644 --- a/entc/integration/ent/comment/comment.go +++ b/entc/integration/ent/comment/comment.go @@ -7,6 +7,7 @@ const ( Label = "comment" // FieldID holds the string denoting the id field in the database. FieldID = "id" + // Table holds the table name of the comment in the database. Table = "comments" ) diff --git a/entc/integration/ent/comment_query.go b/entc/integration/ent/comment_query.go index 3a552bc89..b87d71163 100644 --- a/entc/integration/ent/comment_query.go +++ b/entc/integration/ent/comment_query.go @@ -351,7 +351,7 @@ func (cq *CommentQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range cq.order { - p.SQL(selector) + p(selector) } if offset := cq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -424,7 +424,7 @@ func (cq *CommentQuery) gremlinQuery() *dsl.Traversal { if len(cq.order) > 0 { v.Order() for _, p := range cq.order { - p.Gremlin(v) + p(v) } } switch limit, offset := cq.limit, cq.offset; { diff --git a/entc/integration/ent/comment_update.go b/entc/integration/ent/comment_update.go index 4920a5ea5..f79b018eb 100644 --- a/entc/integration/ent/comment_update.go +++ b/entc/integration/ent/comment_update.go @@ -35,8 +35,7 @@ func (cu *CommentUpdate) Save(ctx context.Context) (int, error) { case dialect.MySQL, dialect.SQLite: return cu.sqlSave(ctx) case dialect.Neptune: - vertices, err := cu.gremlinSave(ctx) - return len(vertices), err + return cu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } @@ -97,21 +96,16 @@ func (cu *CommentUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (cu *CommentUpdate) gremlinSave(ctx context.Context) ([]*Comment, error) { +func (cu *CommentUpdate) gremlinSave(ctx context.Context) (int, error) { res := &gremlin.Response{} query, bindings := cu.gremlin().Query() if err := cu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return 0, err } if err, ok := isConstantError(res); ok { - return nil, err + return 0, err } - var cs Comments - cs.config(cu.config) - if err := cs.FromResponse(res); err != nil { - return nil, err - } - return cs, nil + return res.ReadInt() } func (cu *CommentUpdate) gremlin() *dsl.Traversal { @@ -122,7 +116,7 @@ func (cu *CommentUpdate) gremlin() *dsl.Traversal { var ( trs []*dsl.Traversal ) - v.ValueMap(true) + v.Count() trs = append(trs, v) return dsl.Join(trs...) } diff --git a/entc/integration/ent/ent.go b/entc/integration/ent/ent.go index 83dfa9980..73351a955 100644 --- a/entc/integration/ent/ent.go +++ b/entc/integration/ent/ent.go @@ -16,41 +16,52 @@ import ( ) // Order applies an ordering on either graph traversal or sql selector. -type Order struct { - SQL func(*sql.Selector) - Gremlin func(*dsl.Traversal) +type Order func(interface{}) + +// OrderPerDialect construct the "order by" clause for graph traversals based on dialect type. +func OrderPerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) Order { + return Order(func(v interface{}) { + switch v := v.(type) { + case *sql.Selector: + f0(v) + case *dsl.Traversal: + f1(v) + default: + panic(fmt.Sprintf("unknown type for order: %T", v)) + } + }) } // Asc applies the given fields in ASC order. func Asc(fields ...string) Order { - return Order{ - SQL: func(s *sql.Selector) { + return OrderPerDialect( + func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) } }, - Gremlin: func(tr *dsl.Traversal) { + func(tr *dsl.Traversal) { for _, f := range fields { tr.By(f, dsl.Incr) } }, - } + ) } // Desc applies the given fields in DESC order. func Desc(fields ...string) Order { - return Order{ - SQL: func(s *sql.Selector) { + return OrderPerDialect( + func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) } }, - Gremlin: func(tr *dsl.Traversal) { + func(tr *dsl.Traversal) { for _, f := range fields { tr.By(f, dsl.Decr) } }, - } + ) } // Aggregate applies an aggregation step on the group-by traversal/selector. @@ -241,6 +252,31 @@ func (e *ErrConstraintFailed) Unwrap() error { return e.wrap } +// IsConstraintFailure returns a boolean indicating whether the error is a constraint failure. +func IsConstraintFailure(err error) bool { + _, ok := err.(*ErrConstraintFailed) + return ok +} + +func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { + // Error number 1062 is ER_DUP_ENTRY in mysql, and "UNIQUE constraint failed" is SQLite prefix. + if msg := err.Error(); strings.HasPrefix(msg, "Error 1062") || strings.HasPrefix(msg, "UNIQUE constraint failed") { + return &ErrConstraintFailed{msg, err}, true + } + return nil, false +} + +// rollback calls to tx.Rollback and wraps the given error with the rollback error if occurred. +func rollback(tx dialect.Tx, err error) error { + if rerr := tx.Rollback(); rerr != nil { + err = fmt.Errorf("%s: %v", err.Error(), rerr) + } + if err, ok := isSQLConstraintError(err); ok { + return err + } + return err +} + // Code implements the dsl.Node interface. func (e ErrConstraintFailed) Code() (string, []interface{}) { return strconv.Quote(e.prefix() + e.msg), nil @@ -274,12 +310,6 @@ func NewErrUniqueEdge(label, edge, id string) *ErrConstraintFailed { return &ErrConstraintFailed{msg: fmt.Sprintf("edge %s.%s with id: %#v", label, edge, id)} } -// IsConstraintFailure returns a boolean indicating whether the error is a constraint failure. -func IsConstraintFailure(err error) bool { - _, ok := err.(*ErrConstraintFailed) - return ok -} - // isConstantError indicates if the given response holds a gremlin constant containing an error. func isConstantError(r *gremlin.Response) (*ErrConstraintFailed, bool) { e := &ErrConstraintFailed{} @@ -289,25 +319,6 @@ func isConstantError(r *gremlin.Response) (*ErrConstraintFailed, bool) { return e, true } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { - // Error number 1062 is ER_DUP_ENTRY in mysql, and "UNIQUE constraint failed" is SQLite prefix. - if msg := err.Error(); strings.HasPrefix(msg, "Error 1062") || strings.HasPrefix(msg, "UNIQUE constraint failed") { - return &ErrConstraintFailed{msg, err}, true - } - return nil, false -} - -// rollback calls to tx.Rollback and wraps the given error with the rollback error if occurred. -func rollback(tx dialect.Tx, err error) error { - if rerr := tx.Rollback(); rerr != nil { - err = fmt.Errorf("%s: %v", err.Error(), rerr) - } - if err, ok := isSQLConstraintError(err); ok { - return err - } - return err -} - // keys returns the keys/ids from the edge map. func keys(m map[string]struct{}) []string { s := make([]string, 0, len(m)) diff --git a/entc/integration/ent/example_test.go b/entc/integration/ent/example_test.go index 890e98446..d718db131 100644 --- a/entc/integration/ent/example_test.go +++ b/entc/integration/ent/example_test.go @@ -5,38 +5,28 @@ package ent import ( "context" "log" - "net/url" - "os" "time" - "fbc/ent/dialect/gremlin" + "fbc/ent/dialect/sql" ) -// endpoint for the database. In order to run the tests locally, run the following command: +// dsn for the database. In order to run the tests locally, run the following command: // -// ENT_INTEGRATION_ENDPOINT="http://localhost:8182" go test -v +// ENT_INTEGRATION_ENDPOINT="root:pass@tcp(localhost:3306)/test?parseTime=True" go test -v // -var endpoint *gremlin.Endpoint - -func init() { - if e, ok := os.LookupEnv("ENT_INTEGRATION_ENDPOINT"); ok { - if u, err := url.Parse(e); err == nil { - endpoint = &gremlin.Endpoint{u} - } - } -} +var dsn string func ExampleCard() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the card's edges. // create card vertex with its edges. @@ -51,16 +41,16 @@ func ExampleCard() { // Output: } func ExampleComment() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the comment's edges. // create comment vertex with its edges. @@ -74,16 +64,16 @@ func ExampleComment() { // Output: } func ExampleFieldType() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the fieldtype's edges. // create fieldtype vertex with its edges. @@ -112,16 +102,16 @@ func ExampleFieldType() { // Output: } func ExampleFile() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the file's edges. // create file vertex with its edges. @@ -137,16 +127,16 @@ func ExampleFile() { // Output: } func ExampleGroup() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the group's edges. f0 := client.File. Create(). @@ -206,16 +196,16 @@ func ExampleGroup() { // Output: } func ExampleGroupInfo() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the groupinfo's edges. // create groupinfo vertex with its edges. @@ -231,16 +221,16 @@ func ExampleGroupInfo() { // Output: } func ExampleNode() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the node's edges. n1 := client.Node. Create(). @@ -267,16 +257,16 @@ func ExampleNode() { // Output: } func ExamplePet() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the pet's edges. // create pet vertex with its edges. @@ -291,16 +281,16 @@ func ExamplePet() { // Output: } func ExampleUser() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the user's edges. c0 := client.Card. Create(). diff --git a/entc/integration/ent/fieldtype.go b/entc/integration/ent/fieldtype.go index 2f7dbb40f..345927740 100644 --- a/entc/integration/ent/fieldtype.go +++ b/entc/integration/ent/fieldtype.go @@ -48,52 +48,6 @@ type FieldType struct { NullableInt64 *int64 `json:"nullable_int64,omitempty"` } -// FromResponse scans the gremlin response data into FieldType. -func (ft *FieldType) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vft struct { - ID string `json:"id,omitempty"` - Int int `json:"int,omitempty"` - Int8 int8 `json:"int8,omitempty"` - Int16 int16 `json:"int16,omitempty"` - Int32 int32 `json:"int32,omitempty"` - Int64 int64 `json:"int64,omitempty"` - OptionalInt int `json:"optional_int,omitempty"` - OptionalInt8 int8 `json:"optional_int8,omitempty"` - OptionalInt16 int16 `json:"optional_int16,omitempty"` - OptionalInt32 int32 `json:"optional_int32,omitempty"` - OptionalInt64 int64 `json:"optional_int64,omitempty"` - NullableInt *int `json:"nullable_int,omitempty"` - NullableInt8 *int8 `json:"nullable_int8,omitempty"` - NullableInt16 *int16 `json:"nullable_int16,omitempty"` - NullableInt32 *int32 `json:"nullable_int32,omitempty"` - NullableInt64 *int64 `json:"nullable_int64,omitempty"` - } - if err := vmap.Decode(&vft); err != nil { - return err - } - ft.ID = vft.ID - ft.Int = vft.Int - ft.Int8 = vft.Int8 - ft.Int16 = vft.Int16 - ft.Int32 = vft.Int32 - ft.Int64 = vft.Int64 - ft.OptionalInt = vft.OptionalInt - ft.OptionalInt8 = vft.OptionalInt8 - ft.OptionalInt16 = vft.OptionalInt16 - ft.OptionalInt32 = vft.OptionalInt32 - ft.OptionalInt64 = vft.OptionalInt64 - ft.NullableInt = vft.NullableInt - ft.NullableInt8 = vft.NullableInt8 - ft.NullableInt16 = vft.NullableInt16 - ft.NullableInt32 = vft.NullableInt32 - ft.NullableInt64 = vft.NullableInt64 - return nil -} - // FromRows scans the sql response data into FieldType. func (ft *FieldType) FromRows(rows *sql.Rows) error { var vft struct { @@ -169,6 +123,52 @@ func (ft *FieldType) FromRows(rows *sql.Rows) error { return nil } +// FromResponse scans the gremlin response data into FieldType. +func (ft *FieldType) FromResponse(res *gremlin.Response) error { + vmap, err := res.ReadValueMap() + if err != nil { + return err + } + var vft struct { + ID string `json:"id,omitempty"` + Int int `json:"int,omitempty"` + Int8 int8 `json:"int8,omitempty"` + Int16 int16 `json:"int16,omitempty"` + Int32 int32 `json:"int32,omitempty"` + Int64 int64 `json:"int64,omitempty"` + OptionalInt int `json:"optional_int,omitempty"` + OptionalInt8 int8 `json:"optional_int8,omitempty"` + OptionalInt16 int16 `json:"optional_int16,omitempty"` + OptionalInt32 int32 `json:"optional_int32,omitempty"` + OptionalInt64 int64 `json:"optional_int64,omitempty"` + NullableInt *int `json:"nullable_int,omitempty"` + NullableInt8 *int8 `json:"nullable_int8,omitempty"` + NullableInt16 *int16 `json:"nullable_int16,omitempty"` + NullableInt32 *int32 `json:"nullable_int32,omitempty"` + NullableInt64 *int64 `json:"nullable_int64,omitempty"` + } + if err := vmap.Decode(&vft); err != nil { + return err + } + ft.ID = vft.ID + ft.Int = vft.Int + ft.Int8 = vft.Int8 + ft.Int16 = vft.Int16 + ft.Int32 = vft.Int32 + ft.Int64 = vft.Int64 + ft.OptionalInt = vft.OptionalInt + ft.OptionalInt8 = vft.OptionalInt8 + ft.OptionalInt16 = vft.OptionalInt16 + ft.OptionalInt32 = vft.OptionalInt32 + ft.OptionalInt64 = vft.OptionalInt64 + ft.NullableInt = vft.NullableInt + ft.NullableInt8 = vft.NullableInt8 + ft.NullableInt16 = vft.NullableInt16 + ft.NullableInt32 = vft.NullableInt32 + ft.NullableInt64 = vft.NullableInt64 + return nil +} + // Update returns a builder for updating this FieldType. // Note that, you need to call FieldType.Unwrap() before calling this method, if this FieldType // was returned from a transaction, and the transaction was committed or rolled back. @@ -230,6 +230,18 @@ func (ft *FieldType) id() int { // FieldTypes is a parsable slice of FieldType. type FieldTypes []*FieldType +// FromRows scans the sql response data into FieldTypes. +func (ft *FieldTypes) FromRows(rows *sql.Rows) error { + for rows.Next() { + vft := &FieldType{} + if err := vft.FromRows(rows); err != nil { + return err + } + *ft = append(*ft, vft) + } + return nil +} + // FromResponse scans the gremlin response data into FieldTypes. func (ft *FieldTypes) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -280,18 +292,6 @@ func (ft *FieldTypes) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into FieldTypes. -func (ft *FieldTypes) FromRows(rows *sql.Rows) error { - for rows.Next() { - vft := &FieldType{} - if err := vft.FromRows(rows); err != nil { - return err - } - *ft = append(*ft, vft) - } - return nil -} - func (ft FieldTypes) config(cfg config) { for i := range ft { ft[i].config = cfg diff --git a/entc/integration/ent/fieldtype/fieldtype.go b/entc/integration/ent/fieldtype/fieldtype.go index f939de7d3..67a5b3516 100644 --- a/entc/integration/ent/fieldtype/fieldtype.go +++ b/entc/integration/ent/fieldtype/fieldtype.go @@ -5,6 +5,8 @@ package fieldtype const ( // Label holds the string label denoting the fieldtype type in the database. Label = "field_type" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" // FieldInt holds the string denoting the int vertex property in the database. FieldInt = "int" // FieldInt8 holds the string denoting the int8 vertex property in the database. @@ -35,8 +37,7 @@ const ( FieldNullableInt32 = "nullable_int32" // FieldNullableInt64 holds the string denoting the nullable_int64 vertex property in the database. FieldNullableInt64 = "nullable_int64" - // FieldID holds the string denoting the id field in the database. - FieldID = "id" + // Table holds the table name of the fieldtype in the database. Table = "field_types" ) diff --git a/entc/integration/ent/fieldtype_query.go b/entc/integration/ent/fieldtype_query.go index 569716a0d..19d6dc1c7 100644 --- a/entc/integration/ent/fieldtype_query.go +++ b/entc/integration/ent/fieldtype_query.go @@ -364,7 +364,7 @@ func (ftq *FieldTypeQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range ftq.order { - p.SQL(selector) + p(selector) } if offset := ftq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -437,7 +437,7 @@ func (ftq *FieldTypeQuery) gremlinQuery() *dsl.Traversal { if len(ftq.order) > 0 { v.Order() for _, p := range ftq.order { - p.Gremlin(v) + p(v) } } switch limit, offset := ftq.limit, ftq.offset; { diff --git a/entc/integration/ent/fieldtype_update.go b/entc/integration/ent/fieldtype_update.go index fa26289dc..c046645f8 100644 --- a/entc/integration/ent/fieldtype_update.go +++ b/entc/integration/ent/fieldtype_update.go @@ -220,8 +220,7 @@ func (ftu *FieldTypeUpdate) Save(ctx context.Context) (int, error) { case dialect.MySQL, dialect.SQLite: return ftu.sqlSave(ctx) case dialect.Neptune: - vertices, err := ftu.gremlinSave(ctx) - return len(vertices), err + return ftu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } @@ -353,21 +352,16 @@ func (ftu *FieldTypeUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (ftu *FieldTypeUpdate) gremlinSave(ctx context.Context) ([]*FieldType, error) { +func (ftu *FieldTypeUpdate) gremlinSave(ctx context.Context) (int, error) { res := &gremlin.Response{} query, bindings := ftu.gremlin().Query() if err := ftu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return 0, err } if err, ok := isConstantError(res); ok { - return nil, err + return 0, err } - var fts FieldTypes - fts.config(ftu.config) - if err := fts.FromResponse(res); err != nil { - return nil, err - } - return fts, nil + return res.ReadInt() } func (ftu *FieldTypeUpdate) gremlin() *dsl.Traversal { @@ -423,7 +417,7 @@ func (ftu *FieldTypeUpdate) gremlin() *dsl.Traversal { if ftu.nullable_int64 != nil { v.Property(dsl.Single, fieldtype.FieldNullableInt64, *ftu.nullable_int64) } - v.ValueMap(true) + v.Count() trs = append(trs, v) return dsl.Join(trs...) } diff --git a/entc/integration/ent/file.go b/entc/integration/ent/file.go index d4705cc85..8533134aa 100644 --- a/entc/integration/ent/file.go +++ b/entc/integration/ent/file.go @@ -22,26 +22,6 @@ type File struct { Name string `json:"name,omitempty"` } -// FromResponse scans the gremlin response data into File. -func (f *File) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vf struct { - ID string `json:"id,omitempty"` - Size int `json:"size,omitempty"` - Name string `json:"name,omitempty"` - } - if err := vmap.Decode(&vf); err != nil { - return err - } - f.ID = vf.ID - f.Size = vf.Size - f.Name = vf.Name - return nil -} - // FromRows scans the sql response data into File. func (f *File) FromRows(rows *sql.Rows) error { var vf struct { @@ -63,6 +43,26 @@ func (f *File) FromRows(rows *sql.Rows) error { return nil } +// FromResponse scans the gremlin response data into File. +func (f *File) FromResponse(res *gremlin.Response) error { + vmap, err := res.ReadValueMap() + if err != nil { + return err + } + var vf struct { + ID string `json:"id,omitempty"` + Size int `json:"size,omitempty"` + Name string `json:"name,omitempty"` + } + if err := vmap.Decode(&vf); err != nil { + return err + } + f.ID = vf.ID + f.Size = vf.Size + f.Name = vf.Name + return nil +} + // Update returns a builder for updating this File. // Note that, you need to call File.Unwrap() before calling this method, if this File // was returned from a transaction, and the transaction was committed or rolled back. @@ -101,6 +101,18 @@ func (f *File) id() int { // Files is a parsable slice of File. type Files []*File +// FromRows scans the sql response data into Files. +func (f *Files) FromRows(rows *sql.Rows) error { + for rows.Next() { + vf := &File{} + if err := vf.FromRows(rows); err != nil { + return err + } + *f = append(*f, vf) + } + return nil +} + // FromResponse scans the gremlin response data into Files. func (f *Files) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -125,18 +137,6 @@ func (f *Files) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into Files. -func (f *Files) FromRows(rows *sql.Rows) error { - for rows.Next() { - vf := &File{} - if err := vf.FromRows(rows); err != nil { - return err - } - *f = append(*f, vf) - } - return nil -} - func (f Files) config(cfg config) { for i := range f { f[i].config = cfg diff --git a/entc/integration/ent/file/file.go b/entc/integration/ent/file/file.go index b8023cbca..3f5b8266e 100644 --- a/entc/integration/ent/file/file.go +++ b/entc/integration/ent/file/file.go @@ -9,12 +9,13 @@ import ( const ( // Label holds the string label denoting the file type in the database. Label = "file" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" // FieldSize holds the string denoting the size vertex property in the database. FieldSize = "size" // FieldName holds the string denoting the name vertex property in the database. FieldName = "name" - // FieldID holds the string denoting the id field in the database. - FieldID = "id" + // Table holds the table name of the file in the database. Table = "files" ) diff --git a/entc/integration/ent/file_query.go b/entc/integration/ent/file_query.go index 0651380c6..d7a36892e 100644 --- a/entc/integration/ent/file_query.go +++ b/entc/integration/ent/file_query.go @@ -364,7 +364,7 @@ func (fq *FileQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range fq.order { - p.SQL(selector) + p(selector) } if offset := fq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -437,7 +437,7 @@ func (fq *FileQuery) gremlinQuery() *dsl.Traversal { if len(fq.order) > 0 { v.Order() for _, p := range fq.order { - p.Gremlin(v) + p(v) } } switch limit, offset := fq.limit, fq.offset; { diff --git a/entc/integration/ent/file_update.go b/entc/integration/ent/file_update.go index b3377e644..81f988391 100644 --- a/entc/integration/ent/file_update.go +++ b/entc/integration/ent/file_update.go @@ -54,8 +54,7 @@ func (fu *FileUpdate) Save(ctx context.Context) (int, error) { case dialect.MySQL, dialect.SQLite: return fu.sqlSave(ctx) case dialect.Neptune: - vertices, err := fu.gremlinSave(ctx) - return len(vertices), err + return fu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } @@ -135,21 +134,16 @@ func (fu *FileUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (fu *FileUpdate) gremlinSave(ctx context.Context) ([]*File, error) { +func (fu *FileUpdate) gremlinSave(ctx context.Context) (int, error) { res := &gremlin.Response{} query, bindings := fu.gremlin().Query() if err := fu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return 0, err } if err, ok := isConstantError(res); ok { - return nil, err + return 0, err } - var fs Files - fs.config(fu.config) - if err := fs.FromResponse(res); err != nil { - return nil, err - } - return fs, nil + return res.ReadInt() } func (fu *FileUpdate) gremlin() *dsl.Traversal { @@ -166,7 +160,7 @@ func (fu *FileUpdate) gremlin() *dsl.Traversal { if fu.name != nil { v.Property(dsl.Single, file.FieldName, *fu.name) } - v.ValueMap(true) + v.Count() trs = append(trs, v) return dsl.Join(trs...) } diff --git a/entc/integration/ent/group.go b/entc/integration/ent/group.go index 8a5749c29..97f62efc4 100644 --- a/entc/integration/ent/group.go +++ b/entc/integration/ent/group.go @@ -29,32 +29,6 @@ type Group struct { Name string `json:"name,omitempty"` } -// FromResponse scans the gremlin response data into Group. -func (gr *Group) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vgr struct { - ID string `json:"id,omitempty"` - Active bool `json:"active,omitempty"` - Expire int64 `json:"expire,omitempty"` - Type *string `json:"type,omitempty"` - MaxUsers int `json:"max_users,omitempty"` - Name string `json:"name,omitempty"` - } - if err := vmap.Decode(&vgr); err != nil { - return err - } - gr.ID = vgr.ID - gr.Active = vgr.Active - gr.Expire = time.Unix(vgr.Expire, 0) - gr.Type = vgr.Type - gr.MaxUsers = vgr.MaxUsers - gr.Name = vgr.Name - return nil -} - // FromRows scans the sql response data into Group. func (gr *Group) FromRows(rows *sql.Rows) error { var vgr struct { @@ -88,6 +62,32 @@ func (gr *Group) FromRows(rows *sql.Rows) error { return nil } +// FromResponse scans the gremlin response data into Group. +func (gr *Group) FromResponse(res *gremlin.Response) error { + vmap, err := res.ReadValueMap() + if err != nil { + return err + } + var vgr struct { + ID string `json:"id,omitempty"` + Active bool `json:"active,omitempty"` + Expire int64 `json:"expire,omitempty"` + Type *string `json:"type,omitempty"` + MaxUsers int `json:"max_users,omitempty"` + Name string `json:"name,omitempty"` + } + if err := vmap.Decode(&vgr); err != nil { + return err + } + gr.ID = vgr.ID + gr.Active = vgr.Active + gr.Expire = time.Unix(vgr.Expire, 0) + gr.Type = vgr.Type + gr.MaxUsers = vgr.MaxUsers + gr.Name = vgr.Name + return nil +} + // QueryFiles queries the files edge of the Group. func (gr *Group) QueryFiles() *FileQuery { return (&GroupClient{gr.config}).QueryFiles(gr) @@ -151,6 +151,18 @@ func (gr *Group) id() int { // Groups is a parsable slice of Group. type Groups []*Group +// FromRows scans the sql response data into Groups. +func (gr *Groups) FromRows(rows *sql.Rows) error { + for rows.Next() { + vgr := &Group{} + if err := vgr.FromRows(rows); err != nil { + return err + } + *gr = append(*gr, vgr) + } + return nil +} + // FromResponse scans the gremlin response data into Groups. func (gr *Groups) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -181,18 +193,6 @@ func (gr *Groups) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into Groups. -func (gr *Groups) FromRows(rows *sql.Rows) error { - for rows.Next() { - vgr := &Group{} - if err := vgr.FromRows(rows); err != nil { - return err - } - *gr = append(*gr, vgr) - } - return nil -} - func (gr Groups) config(cfg config) { for i := range gr { gr[i].config = cfg diff --git a/entc/integration/ent/group/group.go b/entc/integration/ent/group/group.go index 48e105134..8de580dd6 100644 --- a/entc/integration/ent/group/group.go +++ b/entc/integration/ent/group/group.go @@ -9,14 +9,8 @@ import ( const ( // Label holds the string label denoting the group type in the database. Label = "group" - // FilesLabel holds the string label denoting the files edge type in the database. - FilesLabel = "group_files" - // BlockedLabel holds the string label denoting the blocked edge type in the database. - BlockedLabel = "group_blocked" - // UsersInverseLabel holds the string label denoting the users inverse edge type in the database. - UsersInverseLabel = "user_groups" - // InfoLabel holds the string label denoting the info edge type in the database. - InfoLabel = "group_info" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" // FieldActive holds the string denoting the active vertex property in the database. FieldActive = "active" // DefaultActive holds the default value for the active field. @@ -31,8 +25,7 @@ const ( DefaultMaxUsers int = 10 // FieldName holds the string denoting the name vertex property in the database. FieldName = "name" - // FieldID holds the string denoting the id field in the database. - FieldID = "id" + // Table holds the table name of the group in the database. Table = "groups" // FilesTable is the table the holds the files relation/edge. @@ -61,6 +54,15 @@ const ( InfoInverseTable = "group_infos" // InfoColumn is the table column denoting the info relation/edge. InfoColumn = "info_id" + + // FilesLabel holds the string label denoting the files edge type in the database. + FilesLabel = "group_files" + // BlockedLabel holds the string label denoting the blocked edge type in the database. + BlockedLabel = "group_blocked" + // UsersInverseLabel holds the string label denoting the users inverse edge type in the database. + UsersInverseLabel = "user_groups" + // InfoLabel holds the string label denoting the info edge type in the database. + InfoLabel = "group_info" ) // Columns holds all SQL columns are group fields. diff --git a/entc/integration/ent/group_query.go b/entc/integration/ent/group_query.go index 5ac127b9a..63291601b 100644 --- a/entc/integration/ent/group_query.go +++ b/entc/integration/ent/group_query.go @@ -448,7 +448,7 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range gq.order { - p.SQL(selector) + p(selector) } if offset := gq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -521,7 +521,7 @@ func (gq *GroupQuery) gremlinQuery() *dsl.Traversal { if len(gq.order) > 0 { v.Order() for _, p := range gq.order { - p.Gremlin(v) + p(v) } } switch limit, offset := gq.limit, gq.offset; { diff --git a/entc/integration/ent/group_update.go b/entc/integration/ent/group_update.go index c35877ecf..c81be5f2e 100644 --- a/entc/integration/ent/group_update.go +++ b/entc/integration/ent/group_update.go @@ -270,8 +270,7 @@ func (gu *GroupUpdate) Save(ctx context.Context) (int, error) { case dialect.MySQL, dialect.SQLite: return gu.sqlSave(ctx) case dialect.Neptune: - vertices, err := gu.gremlinSave(ctx) - return len(vertices), err + return gu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } @@ -520,21 +519,16 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (gu *GroupUpdate) gremlinSave(ctx context.Context) ([]*Group, error) { +func (gu *GroupUpdate) gremlinSave(ctx context.Context) (int, error) { res := &gremlin.Response{} query, bindings := gu.gremlin().Query() if err := gu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return 0, err } if err, ok := isConstantError(res); ok { - return nil, err + return 0, err } - var grs Groups - grs.config(gu.config) - if err := grs.FromResponse(res); err != nil { - return nil, err - } - return grs, nil + return res.ReadInt() } func (gu *GroupUpdate) gremlin() *dsl.Traversal { @@ -602,7 +596,7 @@ func (gu *GroupUpdate) gremlin() *dsl.Traversal { for id := range gu.info { v.AddE(group.InfoLabel).To(g.V(id)).OutV() } - v.ValueMap(true) + v.Count() if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), diff --git a/entc/integration/ent/groupinfo.go b/entc/integration/ent/groupinfo.go index 86c933e87..5062d5501 100644 --- a/entc/integration/ent/groupinfo.go +++ b/entc/integration/ent/groupinfo.go @@ -22,26 +22,6 @@ type GroupInfo struct { MaxUsers int `json:"max_users,omitempty"` } -// FromResponse scans the gremlin response data into GroupInfo. -func (gi *GroupInfo) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vgi struct { - ID string `json:"id,omitempty"` - Desc string `json:"desc,omitempty"` - MaxUsers int `json:"max_users,omitempty"` - } - if err := vmap.Decode(&vgi); err != nil { - return err - } - gi.ID = vgi.ID - gi.Desc = vgi.Desc - gi.MaxUsers = vgi.MaxUsers - return nil -} - // FromRows scans the sql response data into GroupInfo. func (gi *GroupInfo) FromRows(rows *sql.Rows) error { var vgi struct { @@ -63,6 +43,26 @@ func (gi *GroupInfo) FromRows(rows *sql.Rows) error { return nil } +// FromResponse scans the gremlin response data into GroupInfo. +func (gi *GroupInfo) FromResponse(res *gremlin.Response) error { + vmap, err := res.ReadValueMap() + if err != nil { + return err + } + var vgi struct { + ID string `json:"id,omitempty"` + Desc string `json:"desc,omitempty"` + MaxUsers int `json:"max_users,omitempty"` + } + if err := vmap.Decode(&vgi); err != nil { + return err + } + gi.ID = vgi.ID + gi.Desc = vgi.Desc + gi.MaxUsers = vgi.MaxUsers + return nil +} + // QueryGroups queries the groups edge of the GroupInfo. func (gi *GroupInfo) QueryGroups() *GroupQuery { return (&GroupInfoClient{gi.config}).QueryGroups(gi) @@ -106,6 +106,18 @@ func (gi *GroupInfo) id() int { // GroupInfos is a parsable slice of GroupInfo. type GroupInfos []*GroupInfo +// FromRows scans the sql response data into GroupInfos. +func (gi *GroupInfos) FromRows(rows *sql.Rows) error { + for rows.Next() { + vgi := &GroupInfo{} + if err := vgi.FromRows(rows); err != nil { + return err + } + *gi = append(*gi, vgi) + } + return nil +} + // FromResponse scans the gremlin response data into GroupInfos. func (gi *GroupInfos) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -130,18 +142,6 @@ func (gi *GroupInfos) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into GroupInfos. -func (gi *GroupInfos) FromRows(rows *sql.Rows) error { - for rows.Next() { - vgi := &GroupInfo{} - if err := vgi.FromRows(rows); err != nil { - return err - } - *gi = append(*gi, vgi) - } - return nil -} - func (gi GroupInfos) config(cfg config) { for i := range gi { gi[i].config = cfg diff --git a/entc/integration/ent/groupinfo/groupinfo.go b/entc/integration/ent/groupinfo/groupinfo.go index f0fc885c0..f7251ce77 100644 --- a/entc/integration/ent/groupinfo/groupinfo.go +++ b/entc/integration/ent/groupinfo/groupinfo.go @@ -5,16 +5,15 @@ package groupinfo const ( // Label holds the string label denoting the groupinfo type in the database. Label = "group_info" - // GroupsInverseLabel holds the string label denoting the groups inverse edge type in the database. - GroupsInverseLabel = "group_info" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" // FieldDesc holds the string denoting the desc vertex property in the database. FieldDesc = "desc" // FieldMaxUsers holds the string denoting the max_users vertex property in the database. FieldMaxUsers = "max_users" // DefaultMaxUsers holds the default value for the max_users field. DefaultMaxUsers int = 10000 - // FieldID holds the string denoting the id field in the database. - FieldID = "id" + // Table holds the table name of the groupinfo in the database. Table = "group_infos" // GroupsTable is the table the holds the groups relation/edge. @@ -24,6 +23,9 @@ const ( GroupsInverseTable = "groups" // GroupsColumn is the table column denoting the groups relation/edge. GroupsColumn = "info_id" + + // GroupsInverseLabel holds the string label denoting the groups inverse edge type in the database. + GroupsInverseLabel = "group_info" ) // Columns holds all SQL columns are groupinfo fields. diff --git a/entc/integration/ent/groupinfo_query.go b/entc/integration/ent/groupinfo_query.go index 21ee8e79f..c1bdd62e3 100644 --- a/entc/integration/ent/groupinfo_query.go +++ b/entc/integration/ent/groupinfo_query.go @@ -384,7 +384,7 @@ func (giq *GroupInfoQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range giq.order { - p.SQL(selector) + p(selector) } if offset := giq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -457,7 +457,7 @@ func (giq *GroupInfoQuery) gremlinQuery() *dsl.Traversal { if len(giq.order) > 0 { v.Order() for _, p := range giq.order { - p.Gremlin(v) + p(v) } } switch limit, offset := giq.limit, giq.offset; { diff --git a/entc/integration/ent/groupinfo_update.go b/entc/integration/ent/groupinfo_update.go index 3c4b49923..1c0fd805c 100644 --- a/entc/integration/ent/groupinfo_update.go +++ b/entc/integration/ent/groupinfo_update.go @@ -103,8 +103,7 @@ func (giu *GroupInfoUpdate) Save(ctx context.Context) (int, error) { case dialect.MySQL, dialect.SQLite: return giu.sqlSave(ctx) case dialect.Neptune: - vertices, err := giu.gremlinSave(ctx) - return len(vertices), err + return giu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } @@ -230,21 +229,16 @@ func (giu *GroupInfoUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (giu *GroupInfoUpdate) gremlinSave(ctx context.Context) ([]*GroupInfo, error) { +func (giu *GroupInfoUpdate) gremlinSave(ctx context.Context) (int, error) { res := &gremlin.Response{} query, bindings := giu.gremlin().Query() if err := giu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return 0, err } if err, ok := isConstantError(res); ok { - return nil, err + return 0, err } - var gis GroupInfos - gis.config(giu.config) - if err := gis.FromResponse(res); err != nil { - return nil, err - } - return gis, nil + return res.ReadInt() } func (giu *GroupInfoUpdate) gremlin() *dsl.Traversal { @@ -278,7 +272,7 @@ func (giu *GroupInfoUpdate) gremlin() *dsl.Traversal { test: __.Is(p.NEQ(0)).Constant(NewErrUniqueEdge(groupinfo.Label, group.InfoLabel, id)), }) } - v.ValueMap(true) + v.Count() if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), diff --git a/entc/integration/ent/node.go b/entc/integration/ent/node.go index 21f2f7664..d8f4d0982 100644 --- a/entc/integration/ent/node.go +++ b/entc/integration/ent/node.go @@ -20,24 +20,6 @@ type Node struct { Value int `json:"value,omitempty"` } -// FromResponse scans the gremlin response data into Node. -func (n *Node) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vn struct { - ID string `json:"id,omitempty"` - Value int `json:"value,omitempty"` - } - if err := vmap.Decode(&vn); err != nil { - return err - } - n.ID = vn.ID - n.Value = vn.Value - return nil -} - // FromRows scans the sql response data into Node. func (n *Node) FromRows(rows *sql.Rows) error { var vn struct { @@ -56,6 +38,24 @@ func (n *Node) FromRows(rows *sql.Rows) error { return nil } +// FromResponse scans the gremlin response data into Node. +func (n *Node) FromResponse(res *gremlin.Response) error { + vmap, err := res.ReadValueMap() + if err != nil { + return err + } + var vn struct { + ID string `json:"id,omitempty"` + Value int `json:"value,omitempty"` + } + if err := vmap.Decode(&vn); err != nil { + return err + } + n.ID = vn.ID + n.Value = vn.Value + return nil +} + // QueryPrev queries the prev edge of the Node. func (n *Node) QueryPrev() *NodeQuery { return (&NodeClient{n.config}).QueryPrev(n) @@ -103,6 +103,18 @@ func (n *Node) id() int { // Nodes is a parsable slice of Node. type Nodes []*Node +// FromRows scans the sql response data into Nodes. +func (n *Nodes) FromRows(rows *sql.Rows) error { + for rows.Next() { + vn := &Node{} + if err := vn.FromRows(rows); err != nil { + return err + } + *n = append(*n, vn) + } + return nil +} + // FromResponse scans the gremlin response data into Nodes. func (n *Nodes) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -125,18 +137,6 @@ func (n *Nodes) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into Nodes. -func (n *Nodes) FromRows(rows *sql.Rows) error { - for rows.Next() { - vn := &Node{} - if err := vn.FromRows(rows); err != nil { - return err - } - *n = append(*n, vn) - } - return nil -} - func (n Nodes) config(cfg config) { for i := range n { n[i].config = cfg diff --git a/entc/integration/ent/node/node.go b/entc/integration/ent/node/node.go index e5679462b..4901004a7 100644 --- a/entc/integration/ent/node/node.go +++ b/entc/integration/ent/node/node.go @@ -5,14 +5,11 @@ package node const ( // Label holds the string label denoting the node type in the database. Label = "node" - // PrevInverseLabel holds the string label denoting the prev inverse edge type in the database. - PrevInverseLabel = "node_next" - // NextLabel holds the string label denoting the next edge type in the database. - NextLabel = "node_next" - // FieldValue holds the string denoting the value vertex property in the database. - FieldValue = "value" // FieldID holds the string denoting the id field in the database. FieldID = "id" + // FieldValue holds the string denoting the value vertex property in the database. + FieldValue = "value" + // Table holds the table name of the node in the database. Table = "nodes" // PrevTable is the table the holds the prev relation/edge. @@ -23,6 +20,11 @@ const ( NextTable = "nodes" // NextColumn is the table column denoting the next relation/edge. NextColumn = "prev_id" + + // PrevInverseLabel holds the string label denoting the prev inverse edge type in the database. + PrevInverseLabel = "node_next" + // NextLabel holds the string label denoting the next edge type in the database. + NextLabel = "node_next" ) // Columns holds all SQL columns are node fields. diff --git a/entc/integration/ent/node_query.go b/entc/integration/ent/node_query.go index ffa8e42ed..fb2cba166 100644 --- a/entc/integration/ent/node_query.go +++ b/entc/integration/ent/node_query.go @@ -402,7 +402,7 @@ func (nq *NodeQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range nq.order { - p.SQL(selector) + p(selector) } if offset := nq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -475,7 +475,7 @@ func (nq *NodeQuery) gremlinQuery() *dsl.Traversal { if len(nq.order) > 0 { v.Order() for _, p := range nq.order { - p.Gremlin(v) + p(v) } } switch limit, offset := nq.limit, nq.offset; { diff --git a/entc/integration/ent/node_update.go b/entc/integration/ent/node_update.go index 39b36559e..ad4ea0c93 100644 --- a/entc/integration/ent/node_update.go +++ b/entc/integration/ent/node_update.go @@ -119,8 +119,7 @@ func (nu *NodeUpdate) Save(ctx context.Context) (int, error) { case dialect.MySQL, dialect.SQLite: return nu.sqlSave(ctx) case dialect.Neptune: - vertices, err := nu.gremlinSave(ctx) - return len(vertices), err + return nu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } @@ -258,21 +257,16 @@ func (nu *NodeUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (nu *NodeUpdate) gremlinSave(ctx context.Context) ([]*Node, error) { +func (nu *NodeUpdate) gremlinSave(ctx context.Context) (int, error) { res := &gremlin.Response{} query, bindings := nu.gremlin().Query() if err := nu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return 0, err } if err, ok := isConstantError(res); ok { - return nil, err + return 0, err } - var ns Nodes - ns.config(nu.config) - if err := ns.FromResponse(res); err != nil { - return nil, err - } - return ns, nil + return res.ReadInt() } func (nu *NodeUpdate) gremlin() *dsl.Traversal { @@ -314,7 +308,7 @@ func (nu *NodeUpdate) gremlin() *dsl.Traversal { test: __.Is(p.NEQ(0)).Constant(NewErrUniqueEdge(node.Label, node.NextLabel, id)), }) } - v.ValueMap(true) + v.Count() if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), diff --git a/entc/integration/ent/pet.go b/entc/integration/ent/pet.go index 7c12d03de..44b7dbb15 100644 --- a/entc/integration/ent/pet.go +++ b/entc/integration/ent/pet.go @@ -20,24 +20,6 @@ type Pet struct { Name string `json:"name,omitempty"` } -// FromResponse scans the gremlin response data into Pet. -func (pe *Pet) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vpe struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - } - if err := vmap.Decode(&vpe); err != nil { - return err - } - pe.ID = vpe.ID - pe.Name = vpe.Name - return nil -} - // FromRows scans the sql response data into Pet. func (pe *Pet) FromRows(rows *sql.Rows) error { var vpe struct { @@ -56,6 +38,24 @@ func (pe *Pet) FromRows(rows *sql.Rows) error { return nil } +// FromResponse scans the gremlin response data into Pet. +func (pe *Pet) FromResponse(res *gremlin.Response) error { + vmap, err := res.ReadValueMap() + if err != nil { + return err + } + var vpe struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + } + if err := vmap.Decode(&vpe); err != nil { + return err + } + pe.ID = vpe.ID + pe.Name = vpe.Name + return nil +} + // QueryTeam queries the team edge of the Pet. func (pe *Pet) QueryTeam() *UserQuery { return (&PetClient{pe.config}).QueryTeam(pe) @@ -103,6 +103,18 @@ func (pe *Pet) id() int { // Pets is a parsable slice of Pet. type Pets []*Pet +// FromRows scans the sql response data into Pets. +func (pe *Pets) FromRows(rows *sql.Rows) error { + for rows.Next() { + vpe := &Pet{} + if err := vpe.FromRows(rows); err != nil { + return err + } + *pe = append(*pe, vpe) + } + return nil +} + // FromResponse scans the gremlin response data into Pets. func (pe *Pets) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -125,18 +137,6 @@ func (pe *Pets) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into Pets. -func (pe *Pets) FromRows(rows *sql.Rows) error { - for rows.Next() { - vpe := &Pet{} - if err := vpe.FromRows(rows); err != nil { - return err - } - *pe = append(*pe, vpe) - } - return nil -} - func (pe Pets) config(cfg config) { for i := range pe { pe[i].config = cfg diff --git a/entc/integration/ent/pet/pet.go b/entc/integration/ent/pet/pet.go index a33574242..527140f89 100644 --- a/entc/integration/ent/pet/pet.go +++ b/entc/integration/ent/pet/pet.go @@ -5,14 +5,11 @@ package pet const ( // Label holds the string label denoting the pet type in the database. Label = "pet" - // TeamInverseLabel holds the string label denoting the team inverse edge type in the database. - TeamInverseLabel = "user_team" - // OwnerInverseLabel holds the string label denoting the owner inverse edge type in the database. - OwnerInverseLabel = "user_pets" - // FieldName holds the string denoting the name vertex property in the database. - FieldName = "name" // FieldID holds the string denoting the id field in the database. FieldID = "id" + // FieldName holds the string denoting the name vertex property in the database. + FieldName = "name" + // Table holds the table name of the pet in the database. Table = "pets" // TeamTable is the table the holds the team relation/edge. @@ -29,6 +26,11 @@ const ( OwnerInverseTable = "users" // OwnerColumn is the table column denoting the owner relation/edge. OwnerColumn = "owner_id" + + // TeamInverseLabel holds the string label denoting the team inverse edge type in the database. + TeamInverseLabel = "user_team" + // OwnerInverseLabel holds the string label denoting the owner inverse edge type in the database. + OwnerInverseLabel = "user_pets" ) // Columns holds all SQL columns are pet fields. diff --git a/entc/integration/ent/pet_query.go b/entc/integration/ent/pet_query.go index e9eadce97..c2111903f 100644 --- a/entc/integration/ent/pet_query.go +++ b/entc/integration/ent/pet_query.go @@ -403,7 +403,7 @@ func (pq *PetQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range pq.order { - p.SQL(selector) + p(selector) } if offset := pq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -476,7 +476,7 @@ func (pq *PetQuery) gremlinQuery() *dsl.Traversal { if len(pq.order) > 0 { v.Order() for _, p := range pq.order { - p.Gremlin(v) + p(v) } } switch limit, offset := pq.limit, pq.offset; { diff --git a/entc/integration/ent/pet_update.go b/entc/integration/ent/pet_update.go index bf8817a1e..340b5079d 100644 --- a/entc/integration/ent/pet_update.go +++ b/entc/integration/ent/pet_update.go @@ -112,8 +112,7 @@ func (pu *PetUpdate) Save(ctx context.Context) (int, error) { case dialect.MySQL, dialect.SQLite: return pu.sqlSave(ctx) case dialect.Neptune: - vertices, err := pu.gremlinSave(ctx) - return len(vertices), err + return pu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } @@ -245,21 +244,16 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (pu *PetUpdate) gremlinSave(ctx context.Context) ([]*Pet, error) { +func (pu *PetUpdate) gremlinSave(ctx context.Context) (int, error) { res := &gremlin.Response{} query, bindings := pu.gremlin().Query() if err := pu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return 0, err } if err, ok := isConstantError(res); ok { - return nil, err + return 0, err } - var pes Pets - pes.config(pu.config) - if err := pes.FromResponse(res); err != nil { - return nil, err - } - return pes, nil + return res.ReadInt() } func (pu *PetUpdate) gremlin() *dsl.Traversal { @@ -297,7 +291,7 @@ func (pu *PetUpdate) gremlin() *dsl.Traversal { for id := range pu.owner { v.AddE(user.PetsLabel).From(g.V(id)).InV() } - v.ValueMap(true) + v.Count() if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), diff --git a/entc/integration/ent/predicate/predicate.go b/entc/integration/ent/predicate/predicate.go index d53111c71..1fab64d55 100644 --- a/entc/integration/ent/predicate/predicate.go +++ b/entc/integration/ent/predicate/predicate.go @@ -12,14 +12,14 @@ import ( // Card is the predicate function for card builders. type Card func(interface{}) -// CardPerDialect construct a predicate for both gremlin traversal and sql selector. -func CardPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Card { +// CardPerDialect construct a predicate for graph traversals based on dialect type. +func CardPerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) Card { return Card(func(v interface{}) { switch v := v.(type) { case *sql.Selector: - f1(v) + f0(v) case *dsl.Traversal: - f2(v) + f1(v) default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } @@ -29,14 +29,14 @@ func CardPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Card { // Comment is the predicate function for comment builders. type Comment func(interface{}) -// CommentPerDialect construct a predicate for both gremlin traversal and sql selector. -func CommentPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Comment { +// CommentPerDialect construct a predicate for graph traversals based on dialect type. +func CommentPerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) Comment { return Comment(func(v interface{}) { switch v := v.(type) { case *sql.Selector: - f1(v) + f0(v) case *dsl.Traversal: - f2(v) + f1(v) default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } @@ -46,14 +46,14 @@ func CommentPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Comment // FieldType is the predicate function for fieldtype builders. type FieldType func(interface{}) -// FieldTypePerDialect construct a predicate for both gremlin traversal and sql selector. -func FieldTypePerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) FieldType { +// FieldTypePerDialect construct a predicate for graph traversals based on dialect type. +func FieldTypePerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) FieldType { return FieldType(func(v interface{}) { switch v := v.(type) { case *sql.Selector: - f1(v) + f0(v) case *dsl.Traversal: - f2(v) + f1(v) default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } @@ -63,14 +63,14 @@ func FieldTypePerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) FieldT // File is the predicate function for file builders. type File func(interface{}) -// FilePerDialect construct a predicate for both gremlin traversal and sql selector. -func FilePerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) File { +// FilePerDialect construct a predicate for graph traversals based on dialect type. +func FilePerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) File { return File(func(v interface{}) { switch v := v.(type) { case *sql.Selector: - f1(v) + f0(v) case *dsl.Traversal: - f2(v) + f1(v) default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } @@ -80,14 +80,14 @@ func FilePerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) File { // Group is the predicate function for group builders. type Group func(interface{}) -// GroupPerDialect construct a predicate for both gremlin traversal and sql selector. -func GroupPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Group { +// GroupPerDialect construct a predicate for graph traversals based on dialect type. +func GroupPerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) Group { return Group(func(v interface{}) { switch v := v.(type) { case *sql.Selector: - f1(v) + f0(v) case *dsl.Traversal: - f2(v) + f1(v) default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } @@ -97,14 +97,14 @@ func GroupPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Group { // GroupInfo is the predicate function for groupinfo builders. type GroupInfo func(interface{}) -// GroupInfoPerDialect construct a predicate for both gremlin traversal and sql selector. -func GroupInfoPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) GroupInfo { +// GroupInfoPerDialect construct a predicate for graph traversals based on dialect type. +func GroupInfoPerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) GroupInfo { return GroupInfo(func(v interface{}) { switch v := v.(type) { case *sql.Selector: - f1(v) + f0(v) case *dsl.Traversal: - f2(v) + f1(v) default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } @@ -114,14 +114,14 @@ func GroupInfoPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) GroupI // Node is the predicate function for node builders. type Node func(interface{}) -// NodePerDialect construct a predicate for both gremlin traversal and sql selector. -func NodePerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Node { +// NodePerDialect construct a predicate for graph traversals based on dialect type. +func NodePerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) Node { return Node(func(v interface{}) { switch v := v.(type) { case *sql.Selector: - f1(v) + f0(v) case *dsl.Traversal: - f2(v) + f1(v) default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } @@ -131,14 +131,14 @@ func NodePerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Node { // Pet is the predicate function for pet builders. type Pet func(interface{}) -// PetPerDialect construct a predicate for both gremlin traversal and sql selector. -func PetPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Pet { +// PetPerDialect construct a predicate for graph traversals based on dialect type. +func PetPerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) Pet { return Pet(func(v interface{}) { switch v := v.(type) { case *sql.Selector: - f1(v) + f0(v) case *dsl.Traversal: - f2(v) + f1(v) default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } @@ -148,14 +148,14 @@ func PetPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Pet { // User is the predicate function for user builders. type User func(interface{}) -// UserPerDialect construct a predicate for both gremlin traversal and sql selector. -func UserPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) User { +// UserPerDialect construct a predicate for graph traversals based on dialect type. +func UserPerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) User { return User(func(v interface{}) { switch v := v.(type) { case *sql.Selector: - f1(v) + f0(v) case *dsl.Traversal: - f2(v) + f1(v) default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } diff --git a/entc/integration/ent/user.go b/entc/integration/ent/user.go index 70afc6bc3..0daaa974c 100644 --- a/entc/integration/ent/user.go +++ b/entc/integration/ent/user.go @@ -28,32 +28,6 @@ type User struct { Phone string `json:"phone,omitempty"` } -// FromResponse scans the gremlin response data into User. -func (u *User) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vu struct { - ID string `json:"id,omitempty"` - Age int `json:"age,omitempty"` - Name string `json:"name,omitempty"` - Last string `json:"last,omitempty"` - Nickname string `json:"nickname,omitempty"` - Phone string `json:"phone,omitempty"` - } - if err := vmap.Decode(&vu); err != nil { - return err - } - u.ID = vu.ID - u.Age = vu.Age - u.Name = vu.Name - u.Last = vu.Last - u.Nickname = vu.Nickname - u.Phone = vu.Phone - return nil -} - // FromRows scans the sql response data into User. func (u *User) FromRows(rows *sql.Rows) error { var vu struct { @@ -84,6 +58,32 @@ func (u *User) FromRows(rows *sql.Rows) error { return nil } +// FromResponse scans the gremlin response data into User. +func (u *User) FromResponse(res *gremlin.Response) error { + vmap, err := res.ReadValueMap() + if err != nil { + return err + } + var vu struct { + ID string `json:"id,omitempty"` + Age int `json:"age,omitempty"` + Name string `json:"name,omitempty"` + Last string `json:"last,omitempty"` + Nickname string `json:"nickname,omitempty"` + Phone string `json:"phone,omitempty"` + } + if err := vmap.Decode(&vu); err != nil { + return err + } + u.ID = vu.ID + u.Age = vu.Age + u.Name = vu.Name + u.Last = vu.Last + u.Nickname = vu.Nickname + u.Phone = vu.Phone + return nil +} + // QueryCard queries the card edge of the User. func (u *User) QueryCard() *CardQuery { return (&UserClient{u.config}).QueryCard(u) @@ -180,6 +180,18 @@ func (u *User) id() int { // Users is a parsable slice of User. type Users []*User +// FromRows scans the sql response data into Users. +func (u *Users) FromRows(rows *sql.Rows) error { + for rows.Next() { + vu := &User{} + if err := vu.FromRows(rows); err != nil { + return err + } + *u = append(*u, vu) + } + return nil +} + // FromResponse scans the gremlin response data into Users. func (u *Users) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -210,18 +222,6 @@ func (u *Users) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into Users. -func (u *Users) FromRows(rows *sql.Rows) error { - for rows.Next() { - vu := &User{} - if err := vu.FromRows(rows); err != nil { - return err - } - *u = append(*u, vu) - } - return nil -} - func (u Users) config(cfg config) { for i := range u { u[i].config = cfg diff --git a/entc/integration/ent/user/user.go b/entc/integration/ent/user/user.go index 11af89ae9..01c88827d 100644 --- a/entc/integration/ent/user/user.go +++ b/entc/integration/ent/user/user.go @@ -5,28 +5,8 @@ package user const ( // Label holds the string label denoting the user type in the database. Label = "user" - // CardLabel holds the string label denoting the card edge type in the database. - CardLabel = "user_card" - // PetsLabel holds the string label denoting the pets edge type in the database. - PetsLabel = "user_pets" - // FilesLabel holds the string label denoting the files edge type in the database. - FilesLabel = "user_files" - // GroupsLabel holds the string label denoting the groups edge type in the database. - GroupsLabel = "user_groups" - // FriendsLabel holds the string label denoting the friends edge type in the database. - FriendsLabel = "user_friends" - // FollowersInverseLabel holds the string label denoting the followers inverse edge type in the database. - FollowersInverseLabel = "user_following" - // FollowingLabel holds the string label denoting the following edge type in the database. - FollowingLabel = "user_following" - // TeamLabel holds the string label denoting the team edge type in the database. - TeamLabel = "user_team" - // SpouseLabel holds the string label denoting the spouse edge type in the database. - SpouseLabel = "user_spouse" - // ChildrenInverseLabel holds the string label denoting the children inverse edge type in the database. - ChildrenInverseLabel = "user_parent" - // ParentLabel holds the string label denoting the parent edge type in the database. - ParentLabel = "user_parent" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" // FieldAge holds the string denoting the age vertex property in the database. FieldAge = "age" // FieldName holds the string denoting the name vertex property in the database. @@ -39,8 +19,7 @@ const ( FieldNickname = "nickname" // FieldPhone holds the string denoting the phone vertex property in the database. FieldPhone = "phone" - // FieldID holds the string denoting the id field in the database. - FieldID = "id" + // Table holds the table name of the user in the database. Table = "users" // CardTable is the table the holds the card relation/edge. @@ -94,6 +73,29 @@ const ( ParentTable = "users" // ParentColumn is the table column denoting the parent relation/edge. ParentColumn = "parent_id" + + // CardLabel holds the string label denoting the card edge type in the database. + CardLabel = "user_card" + // PetsLabel holds the string label denoting the pets edge type in the database. + PetsLabel = "user_pets" + // FilesLabel holds the string label denoting the files edge type in the database. + FilesLabel = "user_files" + // GroupsLabel holds the string label denoting the groups edge type in the database. + GroupsLabel = "user_groups" + // FriendsLabel holds the string label denoting the friends edge type in the database. + FriendsLabel = "user_friends" + // FollowersInverseLabel holds the string label denoting the followers inverse edge type in the database. + FollowersInverseLabel = "user_following" + // FollowingLabel holds the string label denoting the following edge type in the database. + FollowingLabel = "user_following" + // TeamLabel holds the string label denoting the team edge type in the database. + TeamLabel = "user_team" + // SpouseLabel holds the string label denoting the spouse edge type in the database. + SpouseLabel = "user_spouse" + // ChildrenInverseLabel holds the string label denoting the children inverse edge type in the database. + ChildrenInverseLabel = "user_parent" + // ParentLabel holds the string label denoting the parent edge type in the database. + ParentLabel = "user_parent" ) // Columns holds all SQL columns are user fields. diff --git a/entc/integration/ent/user_query.go b/entc/integration/ent/user_query.go index 5d2b3c663..b5208bf7c 100644 --- a/entc/integration/ent/user_query.go +++ b/entc/integration/ent/user_query.go @@ -597,7 +597,7 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range uq.order { - p.SQL(selector) + p(selector) } if offset := uq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -670,7 +670,7 @@ func (uq *UserQuery) gremlinQuery() *dsl.Traversal { if len(uq.order) > 0 { v.Order() for _, p := range uq.order { - p.Gremlin(v) + p(v) } } switch limit, offset := uq.limit, uq.offset; { diff --git a/entc/integration/ent/user_update.go b/entc/integration/ent/user_update.go index 63d0b1202..08e204d9e 100644 --- a/entc/integration/ent/user_update.go +++ b/entc/integration/ent/user_update.go @@ -526,8 +526,7 @@ func (uu *UserUpdate) Save(ctx context.Context) (int, error) { case dialect.MySQL, dialect.SQLite: return uu.sqlSave(ctx) case dialect.Neptune: - vertices, err := uu.gremlinSave(ctx) - return len(vertices), err + return uu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } @@ -1058,21 +1057,16 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (uu *UserUpdate) gremlinSave(ctx context.Context) ([]*User, error) { +func (uu *UserUpdate) gremlinSave(ctx context.Context) (int, error) { res := &gremlin.Response{} query, bindings := uu.gremlin().Query() if err := uu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return 0, err } if err, ok := isConstantError(res); ok { - return nil, err + return 0, err } - var us Users - us.config(uu.config) - if err := us.FromResponse(res); err != nil { - return nil, err - } - return us, nil + return res.ReadInt() } func (uu *UserUpdate) gremlin() *dsl.Traversal { @@ -1217,7 +1211,7 @@ func (uu *UserUpdate) gremlin() *dsl.Traversal { for id := range uu.parent { v.AddE(user.ParentLabel).To(g.V(id)).OutV() } - v.ValueMap(true) + v.Count() if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), diff --git a/entc/integration/generate.go b/entc/integration/generate.go index 9ef1609e1..55fdfebbd 100644 --- a/entc/integration/generate.go +++ b/entc/integration/generate.go @@ -1,6 +1,6 @@ package integration -//go:generate go run ../cmd/entc/entc.go generate ./ent/schema -//go:generate go run ../cmd/entc/entc.go generate ./plugin/ent/schema +//go:generate go run ../cmd/entc/entc.go generate --storage=sql,gremlin ./ent/schema +//go:generate go run ../cmd/entc/entc.go generate --storage=sql,gremlin ./plugin/ent/schema //go:generate go run ../cmd/entc/entc.go generate ./migrate/entv1/schema //go:generate go run ../cmd/entc/entc.go generate ./migrate/entv2/schema diff --git a/entc/integration/migrate/entv1/ent.go b/entc/integration/migrate/entv1/ent.go index 81f57ca4e..eb55a8be8 100644 --- a/entc/integration/migrate/entv1/ent.go +++ b/entc/integration/migrate/entv1/ent.go @@ -4,62 +4,41 @@ package entv1 import ( "fmt" - "strconv" "strings" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/encoding/graphson" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" "fbc/ent/dialect/sql" ) // Order applies an ordering on either graph traversal or sql selector. -type Order struct { - SQL func(*sql.Selector) - Gremlin func(*dsl.Traversal) -} +type Order func(*sql.Selector) // Asc applies the given fields in ASC order. func Asc(fields ...string) Order { - return Order{ - SQL: func(s *sql.Selector) { + return Order( + func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) } }, - Gremlin: func(tr *dsl.Traversal) { - for _, f := range fields { - tr.By(f, dsl.Incr) - } - }, - } + ) } // Desc applies the given fields in DESC order. func Desc(fields ...string) Order { - return Order{ - SQL: func(s *sql.Selector) { + return Order( + func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) } }, - Gremlin: func(tr *dsl.Traversal) { - for _, f := range fields { - tr.By(f, dsl.Decr) - } - }, - } + ) } // Aggregate applies an aggregation step on the group-by traversal/selector. type Aggregate struct { // SQL the column wrapped with the aggregation function. SQL func(*sql.Selector) string - // Gremlin gets two labels as parameters. The first used in the `As` step for the predicate, - // and the second is an optional name for the next predicates (or for later usage). - Gremlin func(string, string) (string, *dsl.Traversal) } // As is a pseudo aggregation function for renaming another other functions with custom names. For example: @@ -73,114 +52,51 @@ func As(fn Aggregate, end string) Aggregate { SQL: func(s *sql.Selector) string { return sql.As(fn.SQL(s), end) }, - Gremlin: func(start, _ string) (string, *dsl.Traversal) { - return fn.Gremlin(start, end) - }, } } -// DefaultCountLabel is the default label name for the Count aggregation function. -// It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. -// In order to "count" 2 or more fields and avoid conflicting, use the `entv1.As(entv1.Count(field), "custom_name")` -// function with custom name in order to override it. -const DefaultCountLabel = "count" - // Count applies the "count" aggregation function on each group. func Count() Aggregate { return Aggregate{ SQL: func(s *sql.Selector) string { return sql.Count("*") }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = DefaultCountLabel - } - return end, __.As(start).Count(dsl.Local).As(end) - }, } } -// DefaultMaxLabel is the default label name for the Max aggregation function. -// It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. -// In order to "max" 2 or more fields and avoid conflicting, use the `entv1.As(entv1.Max(field), "custom_name")` -// function with custom name in order to override it. -const DefaultMaxLabel = "max" - // Max applies the "max" aggregation function on the given field of each group. func Max(field string) Aggregate { return Aggregate{ SQL: func(s *sql.Selector) string { return sql.Max(s.C(field)) }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = DefaultMaxLabel - } - return end, __.As(start).Unfold().Values(field).Max().As(end) - }, } } -// DefaultMeanLabel is the default label name for the Mean aggregation function. -// It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. -// In order to "mean" 2 or more fields and avoid conflicting, use the `entv1.As(entv1.Mean(field), "custom_name")` -// function with custom name in order to override it. -const DefaultMeanLabel = "mean" - // Mean applies the "mean" aggregation function on the given field of each group. func Mean(field string) Aggregate { return Aggregate{ SQL: func(s *sql.Selector) string { return sql.Avg(s.C(field)) }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = DefaultMeanLabel - } - return end, __.As(start).Unfold().Values(field).Mean().As(end) - }, } } -// DefaultMinLabel is the default label name for the Min aggregation function. -// It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. -// In order to "min" 2 or more fields and avoid conflicting, use the `entv1.As(entv1.Min(field), "custom_name")` -// function with custom name in order to override it. -const DefaultMinLabel = "min" - // Min applies the "min" aggregation function on the given field of each group. func Min(field string) Aggregate { return Aggregate{ SQL: func(s *sql.Selector) string { return sql.Min(s.C(field)) }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = DefaultMinLabel - } - return end, __.As(start).Unfold().Values(field).Min().As(end) - }, } } -// DefaultSumLabel is the default label name for the Sum aggregation function. -// It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. -// In order to "sum" 2 or more fields and avoid conflicting, use the `entv1.As(entv1.Sum(field), "custom_name")` -// function with custom name in order to override it. -const DefaultSumLabel = "sum" - // Sum applies the "sum" aggregation function on the given field of each group. func Sum(field string) Aggregate { return Aggregate{ SQL: func(s *sql.Selector) string { return sql.Sum(s.C(field)) }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = DefaultSumLabel - } - return end, __.As(start).Unfold().Values(field).Sum().As(end) - }, } } @@ -241,54 +157,12 @@ func (e *ErrConstraintFailed) Unwrap() error { return e.wrap } -// Code implements the dsl.Node interface. -func (e ErrConstraintFailed) Code() (string, []interface{}) { - return strconv.Quote(e.prefix() + e.msg), nil -} - -func (e *ErrConstraintFailed) UnmarshalGraphson(b []byte) error { - var v [1]*string - if err := graphson.Unmarshal(b, &v); err != nil { - return err - } - if v[0] == nil { - return fmt.Errorf("entv1: missing string value") - } - if !strings.HasPrefix(*v[0], e.prefix()) { - return fmt.Errorf("entv1: invalid string for error: %s", *v[0]) - } - e.msg = strings.TrimPrefix(*v[0], e.prefix()) - return nil -} - -// prefix returns the prefix used for gremlin constants. -func (ErrConstraintFailed) prefix() string { return "Error: " } - -// NewErrUniqueField creates a constraint error for unique fields. -func NewErrUniqueField(label, field string, v interface{}) *ErrConstraintFailed { - return &ErrConstraintFailed{msg: fmt.Sprintf("field %s.%s with value: %#v", label, field, v)} -} - -// NewErrUniqueEdge creates a constraint error for unique edges. -func NewErrUniqueEdge(label, edge, id string) *ErrConstraintFailed { - return &ErrConstraintFailed{msg: fmt.Sprintf("edge %s.%s with id: %#v", label, edge, id)} -} - // IsConstraintFailure returns a boolean indicating whether the error is a constraint failure. func IsConstraintFailure(err error) bool { _, ok := err.(*ErrConstraintFailed) return ok } -// isConstantError indicates if the given response holds a gremlin constant containing an error. -func isConstantError(r *gremlin.Response) (*ErrConstraintFailed, bool) { - e := &ErrConstraintFailed{} - if err := graphson.Unmarshal(r.Result.Data, e); err != nil { - return nil, false - } - return e, true -} - func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { // Error number 1062 is ER_DUP_ENTRY in mysql, and "UNIQUE constraint failed" is SQLite prefix. if msg := err.Error(); strings.HasPrefix(msg, "Error 1062") || strings.HasPrefix(msg, "UNIQUE constraint failed") { diff --git a/entc/integration/migrate/entv1/example_test.go b/entc/integration/migrate/entv1/example_test.go index f067ff292..6930b982c 100644 --- a/entc/integration/migrate/entv1/example_test.go +++ b/entc/integration/migrate/entv1/example_test.go @@ -5,37 +5,27 @@ package entv1 import ( "context" "log" - "net/url" - "os" - "fbc/ent/dialect/gremlin" + "fbc/ent/dialect/sql" ) -// endpoint for the database. In order to run the tests locally, run the following command: +// dsn for the database. In order to run the tests locally, run the following command: // -// ENTV1_INTEGRATION_ENDPOINT="http://localhost:8182" go test -v +// ENTV1_INTEGRATION_ENDPOINT="root:pass@tcp(localhost:3306)/test?parseTime=True" go test -v // -var endpoint *gremlin.Endpoint - -func init() { - if e, ok := os.LookupEnv("ENTV1_INTEGRATION_ENDPOINT"); ok { - if u, err := url.Parse(e); err == nil { - endpoint = &gremlin.Endpoint{u} - } - } -} +var dsn string func ExampleUser() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the user's edges. // create user vertex with its edges. diff --git a/entc/integration/migrate/entv1/predicate/predicate.go b/entc/integration/migrate/entv1/predicate/predicate.go index 5afc8d13c..ae84c5ad0 100644 --- a/entc/integration/migrate/entv1/predicate/predicate.go +++ b/entc/integration/migrate/entv1/predicate/predicate.go @@ -3,25 +3,8 @@ package predicate import ( - "fmt" - - "fbc/ent/dialect/gremlin/graph/dsl" "fbc/ent/dialect/sql" ) // User is the predicate function for user builders. -type User func(interface{}) - -// UserPerDialect construct a predicate for both gremlin traversal and sql selector. -func UserPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) User { - return User(func(v interface{}) { - switch v := v.(type) { - case *sql.Selector: - f1(v) - case *dsl.Traversal: - f2(v) - default: - panic(fmt.Sprintf("unknown type for predicate: %T", v)) - } - }) -} +type User func(*sql.Selector) diff --git a/entc/integration/migrate/entv1/user.go b/entc/integration/migrate/entv1/user.go index 4ae1162d1..fe754e7c7 100644 --- a/entc/integration/migrate/entv1/user.go +++ b/entc/integration/migrate/entv1/user.go @@ -7,7 +7,6 @@ import ( "fmt" "strconv" - "fbc/ent/dialect/gremlin" "fbc/ent/dialect/sql" ) @@ -24,28 +23,6 @@ type User struct { Address string `json:"address,omitempty"` } -// FromResponse scans the gremlin response data into User. -func (u *User) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vu struct { - ID string `json:"id,omitempty"` - Age int32 `json:"age,omitempty"` - Name string `json:"name,omitempty"` - Address string `json:"address,omitempty"` - } - if err := vmap.Decode(&vu); err != nil { - return err - } - u.ID = vu.ID - u.Age = vu.Age - u.Name = vu.Name - u.Address = vu.Address - return nil -} - // FromRows scans the sql response data into User. func (u *User) FromRows(rows *sql.Rows) error { var vu struct { @@ -109,32 +86,6 @@ func (u *User) id() int { // Users is a parsable slice of User. type Users []*User -// FromResponse scans the gremlin response data into Users. -func (u *Users) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vu []struct { - ID string `json:"id,omitempty"` - Age int32 `json:"age,omitempty"` - Name string `json:"name,omitempty"` - Address string `json:"address,omitempty"` - } - if err := vmap.Decode(&vu); err != nil { - return err - } - for _, v := range vu { - *u = append(*u, &User{ - ID: v.ID, - Age: v.Age, - Name: v.Name, - Address: v.Address, - }) - } - return nil -} - // FromRows scans the sql response data into Users. func (u *Users) FromRows(rows *sql.Rows) error { for rows.Next() { diff --git a/entc/integration/migrate/entv1/user/user.go b/entc/integration/migrate/entv1/user/user.go index b5b8d208d..3e06dbb32 100644 --- a/entc/integration/migrate/entv1/user/user.go +++ b/entc/integration/migrate/entv1/user/user.go @@ -9,14 +9,15 @@ import ( const ( // Label holds the string label denoting the user type in the database. Label = "user" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" // FieldAge holds the string denoting the age vertex property in the database. FieldAge = "age" // FieldName holds the string denoting the name vertex property in the database. FieldName = "name" // FieldAddress holds the string denoting the address vertex property in the database. FieldAddress = "address" - // FieldID holds the string denoting the id field in the database. - FieldID = "id" + // Table holds the table name of the user in the database. Table = "users" ) diff --git a/entc/integration/migrate/entv1/user/where.go b/entc/integration/migrate/entv1/user/where.go index 434ad70fd..06749a732 100644 --- a/entc/integration/migrate/entv1/user/where.go +++ b/entc/integration/migrate/entv1/user/where.go @@ -7,106 +7,82 @@ import ( "fbc/ent/entc/integration/migrate/entv1/predicate" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" - "fbc/ent/dialect/gremlin/graph/dsl/p" "fbc/ent/dialect/sql" ) // ID filters vertices based on their identifier. func ID(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) }, - func(t *dsl.Traversal) { - t.HasID(id) - }, ) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.EQ(id)) - }, ) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.NEQ(id)) - }, ) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.GT(id)) - }, ) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.GTE(id)) - }, ) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.LT(id)) - }, ) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.LTE(id)) - }, ) } // IDIn applies the In predicate on the ID field. func IDIn(ids ...string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -120,19 +96,12 @@ func IDIn(ids ...string) predicate.User { } s.Where(sql.In(s.C(FieldID), v...)) }, - func(t *dsl.Traversal) { - v := make([]interface{}, len(ids)) - for i := range v { - v[i] = ids[i] - } - t.HasID(p.Within(v...)) - }, ) } // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -146,121 +115,87 @@ func IDNotIn(ids ...string) predicate.User { } s.Where(sql.NotIn(s.C(FieldID), v...)) }, - func(t *dsl.Traversal) { - v := make([]interface{}, len(ids)) - for i := range v { - v[i] = ids[i] - } - t.HasID(p.Without(v...)) - }, ) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int32) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.EQ(v)) - }, ) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.EQ(v)) - }, ) } // Address applies equality check predicate on the "address" field. It's identical to AddressEQ. func Address(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAddress), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.EQ(v)) - }, ) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int32) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.EQ(v)) - }, ) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int32) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.NEQ(v)) - }, ) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int32) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.GT(v)) - }, ) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int32) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.GTE(v)) - }, ) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int32) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.LT(v)) - }, ) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int32) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.LTE(v)) - }, ) } @@ -270,7 +205,7 @@ func AgeIn(vs ...int32) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -280,9 +215,6 @@ func AgeIn(vs ...int32) predicate.User { } s.Where(sql.In(s.C(FieldAge), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.Within(v...)) - }, ) } @@ -292,7 +224,7 @@ func AgeNotIn(vs ...int32) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -302,81 +234,60 @@ func AgeNotIn(vs ...int32) predicate.User { } s.Where(sql.NotIn(s.C(FieldAge), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.Without(v...)) - }, ) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.EQ(v)) - }, ) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.NEQ(v)) - }, ) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.GT(v)) - }, ) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.GTE(v)) - }, ) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.LT(v)) - }, ) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.LTE(v)) - }, ) } @@ -386,7 +297,7 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -396,9 +307,6 @@ func NameIn(vs ...string) predicate.User { } s.Where(sql.In(s.C(FieldName), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.Within(v...)) - }, ) } @@ -408,7 +316,7 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -418,117 +326,87 @@ func NameNotIn(vs ...string) predicate.User { } s.Where(sql.NotIn(s.C(FieldName), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.Without(v...)) - }, ) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.Containing(v)) - }, ) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.StartingWith(v)) - }, ) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.EndingWith(v)) - }, ) } // AddressEQ applies the EQ predicate on the "address" field. func AddressEQ(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAddress), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.EQ(v)) - }, ) } // AddressNEQ applies the NEQ predicate on the "address" field. func AddressNEQ(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAddress), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.NEQ(v)) - }, ) } // AddressGT applies the GT predicate on the "address" field. func AddressGT(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAddress), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.GT(v)) - }, ) } // AddressGTE applies the GTE predicate on the "address" field. func AddressGTE(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAddress), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.GTE(v)) - }, ) } // AddressLT applies the LT predicate on the "address" field. func AddressLT(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAddress), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.LT(v)) - }, ) } // AddressLTE applies the LTE predicate on the "address" field. func AddressLTE(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAddress), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.LTE(v)) - }, ) } @@ -538,7 +416,7 @@ func AddressIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -548,9 +426,6 @@ func AddressIn(vs ...string) predicate.User { } s.Where(sql.In(s.C(FieldAddress), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.Within(v...)) - }, ) } @@ -560,7 +435,7 @@ func AddressNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -570,51 +445,39 @@ func AddressNotIn(vs ...string) predicate.User { } s.Where(sql.NotIn(s.C(FieldAddress), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.Without(v...)) - }, ) } // AddressContains applies the Contains predicate on the "address" field. func AddressContains(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldAddress), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.Containing(v)) - }, ) } // AddressHasPrefix applies the HasPrefix predicate on the "address" field. func AddressHasPrefix(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldAddress), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.StartingWith(v)) - }, ) } // AddressHasSuffix applies the HasSuffix predicate on the "address" field. func AddressHasSuffix(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldAddress), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAddress, p.EndingWith(v)) - }, ) } // Or groups list of predicates with the or operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { for i, p := range predicates { if i > 0 { @@ -623,28 +486,14 @@ func Or(predicates ...predicate.User) predicate.User { p(s) } }, - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, ) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { p(s.Not()) }, - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, ) } diff --git a/entc/integration/migrate/entv1/user_create.go b/entc/integration/migrate/entv1/user_create.go index 93433f50f..9ea963c09 100644 --- a/entc/integration/migrate/entv1/user_create.go +++ b/entc/integration/migrate/entv1/user_create.go @@ -11,9 +11,6 @@ import ( "fbc/ent/entc/integration/migrate/entv1/user" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -65,8 +62,6 @@ func (uc *UserCreate) Save(ctx context.Context) (*User, error) { switch uc.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uc.sqlSave(ctx) - case dialect.Neptune: - return uc.gremlinSave(ctx) default: return nil, errors.New("entv1: unsupported dialect") } @@ -117,33 +112,3 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return u, nil } - -func (uc *UserCreate) gremlinSave(ctx context.Context) (*User, error) { - res := &gremlin.Response{} - query, bindings := uc.gremlin().Query() - if err := uc.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - u := &User{config: uc.config} - if err := u.FromResponse(res); err != nil { - return nil, err - } - return u, nil -} - -func (uc *UserCreate) gremlin() *dsl.Traversal { - v := g.AddV(user.Label) - if uc.age != nil { - v.Property(dsl.Single, user.FieldAge, *uc.age) - } - if uc.name != nil { - v.Property(dsl.Single, user.FieldName, *uc.name) - } - if uc.address != nil { - v.Property(dsl.Single, user.FieldAddress, *uc.address) - } - return v.ValueMap(true) -} diff --git a/entc/integration/migrate/entv1/user_delete.go b/entc/integration/migrate/entv1/user_delete.go index 875f5c37e..7812862df 100644 --- a/entc/integration/migrate/entv1/user_delete.go +++ b/entc/integration/migrate/entv1/user_delete.go @@ -10,9 +10,6 @@ import ( "fbc/ent/entc/integration/migrate/entv1/user" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -33,8 +30,6 @@ func (ud *UserDelete) Exec(ctx context.Context) error { switch ud.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return ud.sqlExec(ctx) - case dialect.Neptune: - return ud.gremlinExec(ctx) default: return errors.New("entv1: unsupported dialect") } @@ -57,20 +52,6 @@ func (ud *UserDelete) sqlExec(ctx context.Context) error { return ud.driver.Exec(ctx, query, args, &res) } -func (ud *UserDelete) gremlinExec(ctx context.Context) error { - res := &gremlin.Response{} - query, bindings := ud.gremlin().Query() - return ud.driver.Exec(ctx, query, bindings, res) -} - -func (ud *UserDelete) gremlin() *dsl.Traversal { - t := g.V().HasLabel(user.Label) - for _, p := range ud.predicates { - p(t) - } - return t.Drop() -} - // UserDeleteOne is the builder for deleting a single User entity. type UserDeleteOne struct { ud *UserDelete diff --git a/entc/integration/migrate/entv1/user_query.go b/entc/integration/migrate/entv1/user_query.go index 1be45a142..96ba19a9c 100644 --- a/entc/integration/migrate/entv1/user_query.go +++ b/entc/integration/migrate/entv1/user_query.go @@ -12,10 +12,6 @@ import ( "fbc/ent/entc/integration/migrate/entv1/user" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -28,8 +24,7 @@ type UserQuery struct { unique []string predicates []predicate.User // intermediate queries. - sql *sql.Selector - gremlin *dsl.Traversal + sql *sql.Selector } // Where adds a new predicate for the builder. @@ -169,8 +164,6 @@ func (uq *UserQuery) All(ctx context.Context) ([]*User, error) { switch uq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uq.sqlAll(ctx) - case dialect.Neptune: - return uq.gremlinAll(ctx) default: return nil, errors.New("entv1: unsupported dialect") } @@ -190,8 +183,6 @@ func (uq *UserQuery) IDs(ctx context.Context) ([]string, error) { switch uq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uq.sqlIDs(ctx) - case dialect.Neptune: - return uq.gremlinIDs(ctx) default: return nil, errors.New("entv1: unsupported dialect") } @@ -211,8 +202,6 @@ func (uq *UserQuery) Count(ctx context.Context) (int, error) { switch uq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uq.sqlCount(ctx) - case dialect.Neptune: - return uq.gremlinCount(ctx) default: return 0, errors.New("entv1: unsupported dialect") } @@ -232,8 +221,6 @@ func (uq *UserQuery) Exist(ctx context.Context) (bool, error) { switch uq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uq.sqlExist(ctx) - case dialect.Neptune: - return uq.gremlinExist(ctx) default: return false, errors.New("entv1: unsupported dialect") } @@ -259,8 +246,7 @@ func (uq *UserQuery) Clone() *UserQuery { unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate queries. - sql: uq.sql.Clone(), - gremlin: uq.gremlin.Clone(), + sql: uq.sql.Clone(), } } @@ -285,8 +271,6 @@ func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy { switch uq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: group.sql = uq.sqlQuery() - case dialect.Neptune: - group.gremlin = uq.gremlinQuery() } return group } @@ -364,7 +348,7 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range uq.order { - p.SQL(selector) + p(selector) } if offset := uq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -377,91 +361,13 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { return selector } -func (uq *UserQuery) gremlinIDs(ctx context.Context) ([]string, error) { - res := &gremlin.Response{} - query, bindings := uq.gremlinQuery().Query() - if err := uq.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - vertices, err := res.ReadVertices() - if err != nil { - return nil, err - } - ids := make([]string, 0, len(vertices)) - for _, vertex := range vertices { - ids = append(ids, vertex.ID.(string)) - } - return ids, nil -} - -func (uq *UserQuery) gremlinAll(ctx context.Context) ([]*User, error) { - res := &gremlin.Response{} - query, bindings := uq.gremlinQuery().ValueMap(true).Query() - if err := uq.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - var us Users - if err := us.FromResponse(res); err != nil { - return nil, err - } - us.config(uq.config) - return us, nil -} - -func (uq *UserQuery) gremlinCount(ctx context.Context) (int, error) { - res := &gremlin.Response{} - query, bindings := uq.gremlinQuery().Count().Query() - if err := uq.driver.Exec(ctx, query, bindings, res); err != nil { - return 0, err - } - return res.ReadInt() -} - -func (uq *UserQuery) gremlinExist(ctx context.Context) (bool, error) { - res := &gremlin.Response{} - query, bindings := uq.gremlinQuery().HasNext().Query() - if err := uq.driver.Exec(ctx, query, bindings, res); err != nil { - return false, err - } - return res.ReadBool() -} - -func (uq *UserQuery) gremlinQuery() *dsl.Traversal { - v := g.V().HasLabel(user.Label) - if uq.gremlin != nil { - v = uq.gremlin.Clone() - } - for _, p := range uq.predicates { - p(v) - } - if len(uq.order) > 0 { - v.Order() - for _, p := range uq.order { - p.Gremlin(v) - } - } - 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 { - v.Dedup() - } - return v -} - // UserQuery is the builder for group-by User entities. type UserGroupBy struct { config fields []string fns []Aggregate // intermediate queries. - sql *sql.Selector - gremlin *dsl.Traversal + sql *sql.Selector } // Aggregate adds the given aggregation functions to the group-by query. @@ -475,8 +381,6 @@ func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error { switch ugb.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return ugb.sqlScan(ctx, v) - case dialect.Neptune: - return ugb.gremlinScan(ctx, v) default: return errors.New("ugb: unsupported dialect") } @@ -592,40 +496,3 @@ func (ugb *UserGroupBy) sqlQuery() *sql.Selector { } return selector.Select(columns...).GroupBy(ugb.fields...) } - -func (ugb *UserGroupBy) gremlinScan(ctx context.Context, v interface{}) error { - res := &gremlin.Response{} - query, bindings := ugb.gremlinQuery().Query() - if err := ugb.driver.Exec(ctx, query, bindings, res); err != nil { - return err - } - if len(ugb.fields)+len(ugb.fns) == 1 { - return res.ReadVal(v) - } - vm, err := res.ReadValueMap() - if err != nil { - return err - } - return vm.Decode(v) -} - -func (ugb *UserGroupBy) gremlinQuery() *dsl.Traversal { - var ( - trs []interface{} - names []interface{} - ) - for _, fn := range ugb.fns { - name, tr := fn.Gremlin("p", "") - trs = append(trs, tr) - names = append(names, name) - } - for _, f := range ugb.fields { - names = append(names, f) - trs = append(trs, __.As("p").Unfold().Values(f).As(f)) - } - return ugb.gremlin.Group(). - By(__.Values(ugb.fields...).Fold()). - By(__.Fold().Match(trs...).Select(names...)). - Select(dsl.Values). - Next() -} diff --git a/entc/integration/migrate/entv1/user_update.go b/entc/integration/migrate/entv1/user_update.go index 21c142972..790c51bbd 100644 --- a/entc/integration/migrate/entv1/user_update.go +++ b/entc/integration/migrate/entv1/user_update.go @@ -11,9 +11,6 @@ import ( "fbc/ent/entc/integration/migrate/entv1/user" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -68,9 +65,6 @@ func (uu *UserUpdate) Save(ctx context.Context) (int, error) { switch uu.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uu.sqlSave(ctx) - case dialect.Neptune: - vertices, err := uu.gremlinSave(ctx) - return len(vertices), err default: return 0, errors.New("entv1: unsupported dialect") } @@ -154,45 +148,6 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (uu *UserUpdate) gremlinSave(ctx context.Context) ([]*User, error) { - res := &gremlin.Response{} - query, bindings := uu.gremlin().Query() - if err := uu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - var us Users - us.config(uu.config) - if err := us.FromResponse(res); err != nil { - return nil, err - } - return us, nil -} - -func (uu *UserUpdate) gremlin() *dsl.Traversal { - v := g.V().HasLabel(user.Label) - for _, p := range uu.predicates { - p(v) - } - var ( - trs []*dsl.Traversal - ) - if uu.age != nil { - v.Property(dsl.Single, user.FieldAge, *uu.age) - } - if uu.name != nil { - v.Property(dsl.Single, user.FieldName, *uu.name) - } - if uu.address != nil { - v.Property(dsl.Single, user.FieldAddress, *uu.address) - } - v.ValueMap(true) - trs = append(trs, v) - return dsl.Join(trs...) -} - // UserUpdateOne is the builder for updating a single User entity. type UserUpdateOne struct { config @@ -238,8 +193,6 @@ func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error) { switch uuo.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uuo.sqlSave(ctx) - case dialect.Neptune: - return uuo.gremlinSave(ctx) default: return nil, errors.New("entv1: unsupported dialect") } @@ -328,38 +281,3 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } return u, nil } - -func (uuo *UserUpdateOne) gremlinSave(ctx context.Context) (*User, error) { - res := &gremlin.Response{} - query, bindings := uuo.gremlin(uuo.id).Query() - if err := uuo.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - u := &User{config: uuo.config} - if err := u.FromResponse(res); err != nil { - return nil, err - } - return u, nil -} - -func (uuo *UserUpdateOne) gremlin(id string) *dsl.Traversal { - v := g.V(id) - var ( - trs []*dsl.Traversal - ) - if uuo.age != nil { - v.Property(dsl.Single, user.FieldAge, *uuo.age) - } - if uuo.name != nil { - v.Property(dsl.Single, user.FieldName, *uuo.name) - } - if uuo.address != nil { - v.Property(dsl.Single, user.FieldAddress, *uuo.address) - } - v.ValueMap(true) - trs = append(trs, v) - return dsl.Join(trs...) -} diff --git a/entc/integration/migrate/entv2/ent.go b/entc/integration/migrate/entv2/ent.go index 40b4d990f..8e9f84cf3 100644 --- a/entc/integration/migrate/entv2/ent.go +++ b/entc/integration/migrate/entv2/ent.go @@ -4,62 +4,41 @@ package entv2 import ( "fmt" - "strconv" "strings" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/encoding/graphson" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" "fbc/ent/dialect/sql" ) // Order applies an ordering on either graph traversal or sql selector. -type Order struct { - SQL func(*sql.Selector) - Gremlin func(*dsl.Traversal) -} +type Order func(*sql.Selector) // Asc applies the given fields in ASC order. func Asc(fields ...string) Order { - return Order{ - SQL: func(s *sql.Selector) { + return Order( + func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) } }, - Gremlin: func(tr *dsl.Traversal) { - for _, f := range fields { - tr.By(f, dsl.Incr) - } - }, - } + ) } // Desc applies the given fields in DESC order. func Desc(fields ...string) Order { - return Order{ - SQL: func(s *sql.Selector) { + return Order( + func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) } }, - Gremlin: func(tr *dsl.Traversal) { - for _, f := range fields { - tr.By(f, dsl.Decr) - } - }, - } + ) } // Aggregate applies an aggregation step on the group-by traversal/selector. type Aggregate struct { // SQL the column wrapped with the aggregation function. SQL func(*sql.Selector) string - // Gremlin gets two labels as parameters. The first used in the `As` step for the predicate, - // and the second is an optional name for the next predicates (or for later usage). - Gremlin func(string, string) (string, *dsl.Traversal) } // As is a pseudo aggregation function for renaming another other functions with custom names. For example: @@ -73,114 +52,51 @@ func As(fn Aggregate, end string) Aggregate { SQL: func(s *sql.Selector) string { return sql.As(fn.SQL(s), end) }, - Gremlin: func(start, _ string) (string, *dsl.Traversal) { - return fn.Gremlin(start, end) - }, } } -// DefaultCountLabel is the default label name for the Count aggregation function. -// It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. -// In order to "count" 2 or more fields and avoid conflicting, use the `entv2.As(entv2.Count(field), "custom_name")` -// function with custom name in order to override it. -const DefaultCountLabel = "count" - // Count applies the "count" aggregation function on each group. func Count() Aggregate { return Aggregate{ SQL: func(s *sql.Selector) string { return sql.Count("*") }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = DefaultCountLabel - } - return end, __.As(start).Count(dsl.Local).As(end) - }, } } -// DefaultMaxLabel is the default label name for the Max aggregation function. -// It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. -// In order to "max" 2 or more fields and avoid conflicting, use the `entv2.As(entv2.Max(field), "custom_name")` -// function with custom name in order to override it. -const DefaultMaxLabel = "max" - // Max applies the "max" aggregation function on the given field of each group. func Max(field string) Aggregate { return Aggregate{ SQL: func(s *sql.Selector) string { return sql.Max(s.C(field)) }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = DefaultMaxLabel - } - return end, __.As(start).Unfold().Values(field).Max().As(end) - }, } } -// DefaultMeanLabel is the default label name for the Mean aggregation function. -// It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. -// In order to "mean" 2 or more fields and avoid conflicting, use the `entv2.As(entv2.Mean(field), "custom_name")` -// function with custom name in order to override it. -const DefaultMeanLabel = "mean" - // Mean applies the "mean" aggregation function on the given field of each group. func Mean(field string) Aggregate { return Aggregate{ SQL: func(s *sql.Selector) string { return sql.Avg(s.C(field)) }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = DefaultMeanLabel - } - return end, __.As(start).Unfold().Values(field).Mean().As(end) - }, } } -// DefaultMinLabel is the default label name for the Min aggregation function. -// It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. -// In order to "min" 2 or more fields and avoid conflicting, use the `entv2.As(entv2.Min(field), "custom_name")` -// function with custom name in order to override it. -const DefaultMinLabel = "min" - // Min applies the "min" aggregation function on the given field of each group. func Min(field string) Aggregate { return Aggregate{ SQL: func(s *sql.Selector) string { return sql.Min(s.C(field)) }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = DefaultMinLabel - } - return end, __.As(start).Unfold().Values(field).Min().As(end) - }, } } -// DefaultSumLabel is the default label name for the Sum aggregation function. -// It should be used as the struct-tag for decoding, or a map key for interaction with the returned response. -// In order to "sum" 2 or more fields and avoid conflicting, use the `entv2.As(entv2.Sum(field), "custom_name")` -// function with custom name in order to override it. -const DefaultSumLabel = "sum" - // Sum applies the "sum" aggregation function on the given field of each group. func Sum(field string) Aggregate { return Aggregate{ SQL: func(s *sql.Selector) string { return sql.Sum(s.C(field)) }, - Gremlin: func(start, end string) (string, *dsl.Traversal) { - if end == "" { - end = DefaultSumLabel - } - return end, __.As(start).Unfold().Values(field).Sum().As(end) - }, } } @@ -241,54 +157,12 @@ func (e *ErrConstraintFailed) Unwrap() error { return e.wrap } -// Code implements the dsl.Node interface. -func (e ErrConstraintFailed) Code() (string, []interface{}) { - return strconv.Quote(e.prefix() + e.msg), nil -} - -func (e *ErrConstraintFailed) UnmarshalGraphson(b []byte) error { - var v [1]*string - if err := graphson.Unmarshal(b, &v); err != nil { - return err - } - if v[0] == nil { - return fmt.Errorf("entv2: missing string value") - } - if !strings.HasPrefix(*v[0], e.prefix()) { - return fmt.Errorf("entv2: invalid string for error: %s", *v[0]) - } - e.msg = strings.TrimPrefix(*v[0], e.prefix()) - return nil -} - -// prefix returns the prefix used for gremlin constants. -func (ErrConstraintFailed) prefix() string { return "Error: " } - -// NewErrUniqueField creates a constraint error for unique fields. -func NewErrUniqueField(label, field string, v interface{}) *ErrConstraintFailed { - return &ErrConstraintFailed{msg: fmt.Sprintf("field %s.%s with value: %#v", label, field, v)} -} - -// NewErrUniqueEdge creates a constraint error for unique edges. -func NewErrUniqueEdge(label, edge, id string) *ErrConstraintFailed { - return &ErrConstraintFailed{msg: fmt.Sprintf("edge %s.%s with id: %#v", label, edge, id)} -} - // IsConstraintFailure returns a boolean indicating whether the error is a constraint failure. func IsConstraintFailure(err error) bool { _, ok := err.(*ErrConstraintFailed) return ok } -// isConstantError indicates if the given response holds a gremlin constant containing an error. -func isConstantError(r *gremlin.Response) (*ErrConstraintFailed, bool) { - e := &ErrConstraintFailed{} - if err := graphson.Unmarshal(r.Result.Data, e); err != nil { - return nil, false - } - return e, true -} - func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { // Error number 1062 is ER_DUP_ENTRY in mysql, and "UNIQUE constraint failed" is SQLite prefix. if msg := err.Error(); strings.HasPrefix(msg, "Error 1062") || strings.HasPrefix(msg, "UNIQUE constraint failed") { diff --git a/entc/integration/migrate/entv2/example_test.go b/entc/integration/migrate/entv2/example_test.go index c27c28ef7..6cf1b2f68 100644 --- a/entc/integration/migrate/entv2/example_test.go +++ b/entc/integration/migrate/entv2/example_test.go @@ -5,37 +5,27 @@ package entv2 import ( "context" "log" - "net/url" - "os" - "fbc/ent/dialect/gremlin" + "fbc/ent/dialect/sql" ) -// endpoint for the database. In order to run the tests locally, run the following command: +// dsn for the database. In order to run the tests locally, run the following command: // -// ENTV2_INTEGRATION_ENDPOINT="http://localhost:8182" go test -v +// ENTV2_INTEGRATION_ENDPOINT="root:pass@tcp(localhost:3306)/test?parseTime=True" go test -v // -var endpoint *gremlin.Endpoint - -func init() { - if e, ok := os.LookupEnv("ENTV2_INTEGRATION_ENDPOINT"); ok { - if u, err := url.Parse(e); err == nil { - endpoint = &gremlin.Endpoint{u} - } - } -} +var dsn string func ExampleGroup() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the group's edges. // create group vertex with its edges. @@ -49,16 +39,16 @@ func ExampleGroup() { // Output: } func ExamplePet() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the pet's edges. // create pet vertex with its edges. @@ -72,16 +62,16 @@ func ExamplePet() { // Output: } func ExampleUser() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the user's edges. // create user vertex with its edges. diff --git a/entc/integration/migrate/entv2/group.go b/entc/integration/migrate/entv2/group.go index d13179b6e..4af837038 100644 --- a/entc/integration/migrate/entv2/group.go +++ b/entc/integration/migrate/entv2/group.go @@ -7,7 +7,6 @@ import ( "fmt" "strconv" - "fbc/ent/dialect/gremlin" "fbc/ent/dialect/sql" ) @@ -18,22 +17,6 @@ type Group struct { ID string `json:"id,omitempty"` } -// FromResponse scans the gremlin response data into Group. -func (gr *Group) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vgr struct { - ID string `json:"id,omitempty"` - } - if err := vmap.Decode(&vgr); err != nil { - return err - } - gr.ID = vgr.ID - return nil -} - // FromRows scans the sql response data into Group. func (gr *Group) FromRows(rows *sql.Rows) error { var vgr struct { @@ -85,26 +68,6 @@ func (gr *Group) id() int { // Groups is a parsable slice of Group. type Groups []*Group -// FromResponse scans the gremlin response data into Groups. -func (gr *Groups) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vgr []struct { - ID string `json:"id,omitempty"` - } - if err := vmap.Decode(&vgr); err != nil { - return err - } - for _, v := range vgr { - *gr = append(*gr, &Group{ - ID: v.ID, - }) - } - return nil -} - // FromRows scans the sql response data into Groups. func (gr *Groups) FromRows(rows *sql.Rows) error { for rows.Next() { diff --git a/entc/integration/migrate/entv2/group/group.go b/entc/integration/migrate/entv2/group/group.go index 4f42180ec..613535975 100644 --- a/entc/integration/migrate/entv2/group/group.go +++ b/entc/integration/migrate/entv2/group/group.go @@ -7,6 +7,7 @@ const ( Label = "group" // FieldID holds the string denoting the id field in the database. FieldID = "id" + // Table holds the table name of the group in the database. Table = "groups" ) diff --git a/entc/integration/migrate/entv2/group/where.go b/entc/integration/migrate/entv2/group/where.go index d78f28815..2e229ec58 100644 --- a/entc/integration/migrate/entv2/group/where.go +++ b/entc/integration/migrate/entv2/group/where.go @@ -7,106 +7,82 @@ import ( "fbc/ent/entc/integration/migrate/entv2/predicate" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" - "fbc/ent/dialect/gremlin/graph/dsl/p" "fbc/ent/dialect/sql" ) // ID filters vertices based on their identifier. func ID(id string) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) }, - func(t *dsl.Traversal) { - t.HasID(id) - }, ) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.EQ(id)) - }, ) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.NEQ(id)) - }, ) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.GT(id)) - }, ) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.GTE(id)) - }, ) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.LT(id)) - }, ) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.LTE(id)) - }, ) } // IDIn applies the In predicate on the ID field. func IDIn(ids ...string) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -120,19 +96,12 @@ func IDIn(ids ...string) predicate.Group { } s.Where(sql.In(s.C(FieldID), v...)) }, - func(t *dsl.Traversal) { - v := make([]interface{}, len(ids)) - for i := range v { - v[i] = ids[i] - } - t.HasID(p.Within(v...)) - }, ) } // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...string) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -146,19 +115,12 @@ func IDNotIn(ids ...string) predicate.Group { } s.Where(sql.NotIn(s.C(FieldID), v...)) }, - func(t *dsl.Traversal) { - v := make([]interface{}, len(ids)) - for i := range v { - v[i] = ids[i] - } - t.HasID(p.Without(v...)) - }, ) } // Or groups list of predicates with the or operator between them. func Or(predicates ...predicate.Group) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { for i, p := range predicates { if i > 0 { @@ -167,28 +129,14 @@ func Or(predicates ...predicate.Group) predicate.Group { p(s) } }, - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, ) } // Not applies the not operator on the given predicate. func Not(p predicate.Group) predicate.Group { - return predicate.GroupPerDialect( + return predicate.Group( func(s *sql.Selector) { p(s.Not()) }, - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, ) } diff --git a/entc/integration/migrate/entv2/group_create.go b/entc/integration/migrate/entv2/group_create.go index c0d3e5d4e..5d8247705 100644 --- a/entc/integration/migrate/entv2/group_create.go +++ b/entc/integration/migrate/entv2/group_create.go @@ -10,9 +10,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/group" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -26,8 +23,6 @@ func (gc *GroupCreate) Save(ctx context.Context) (*Group, error) { switch gc.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return gc.sqlSave(ctx) - case dialect.Neptune: - return gc.gremlinSave(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -66,24 +61,3 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { } return gr, nil } - -func (gc *GroupCreate) gremlinSave(ctx context.Context) (*Group, error) { - res := &gremlin.Response{} - query, bindings := gc.gremlin().Query() - if err := gc.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - gr := &Group{config: gc.config} - if err := gr.FromResponse(res); err != nil { - return nil, err - } - return gr, nil -} - -func (gc *GroupCreate) gremlin() *dsl.Traversal { - v := g.AddV(group.Label) - return v.ValueMap(true) -} diff --git a/entc/integration/migrate/entv2/group_delete.go b/entc/integration/migrate/entv2/group_delete.go index e685b92b2..9db2258a3 100644 --- a/entc/integration/migrate/entv2/group_delete.go +++ b/entc/integration/migrate/entv2/group_delete.go @@ -10,9 +10,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/predicate" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -33,8 +30,6 @@ func (gd *GroupDelete) Exec(ctx context.Context) error { switch gd.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return gd.sqlExec(ctx) - case dialect.Neptune: - return gd.gremlinExec(ctx) default: return errors.New("entv2: unsupported dialect") } @@ -57,20 +52,6 @@ func (gd *GroupDelete) sqlExec(ctx context.Context) error { return gd.driver.Exec(ctx, query, args, &res) } -func (gd *GroupDelete) gremlinExec(ctx context.Context) error { - res := &gremlin.Response{} - query, bindings := gd.gremlin().Query() - return gd.driver.Exec(ctx, query, bindings, res) -} - -func (gd *GroupDelete) gremlin() *dsl.Traversal { - t := g.V().HasLabel(group.Label) - for _, p := range gd.predicates { - p(t) - } - return t.Drop() -} - // GroupDeleteOne is the builder for deleting a single Group entity. type GroupDeleteOne struct { gd *GroupDelete diff --git a/entc/integration/migrate/entv2/group_query.go b/entc/integration/migrate/entv2/group_query.go index 9ae38b2e0..b7ed4bac2 100644 --- a/entc/integration/migrate/entv2/group_query.go +++ b/entc/integration/migrate/entv2/group_query.go @@ -12,10 +12,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/predicate" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -28,8 +24,7 @@ type GroupQuery struct { unique []string predicates []predicate.Group // intermediate queries. - sql *sql.Selector - gremlin *dsl.Traversal + sql *sql.Selector } // Where adds a new predicate for the builder. @@ -169,8 +164,6 @@ func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error) { switch gq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return gq.sqlAll(ctx) - case dialect.Neptune: - return gq.gremlinAll(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -190,8 +183,6 @@ func (gq *GroupQuery) IDs(ctx context.Context) ([]string, error) { switch gq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return gq.sqlIDs(ctx) - case dialect.Neptune: - return gq.gremlinIDs(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -211,8 +202,6 @@ func (gq *GroupQuery) Count(ctx context.Context) (int, error) { switch gq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return gq.sqlCount(ctx) - case dialect.Neptune: - return gq.gremlinCount(ctx) default: return 0, errors.New("entv2: unsupported dialect") } @@ -232,8 +221,6 @@ func (gq *GroupQuery) Exist(ctx context.Context) (bool, error) { switch gq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return gq.sqlExist(ctx) - case dialect.Neptune: - return gq.gremlinExist(ctx) default: return false, errors.New("entv2: unsupported dialect") } @@ -259,8 +246,7 @@ func (gq *GroupQuery) Clone() *GroupQuery { unique: append([]string{}, gq.unique...), predicates: append([]predicate.Group{}, gq.predicates...), // clone intermediate queries. - sql: gq.sql.Clone(), - gremlin: gq.gremlin.Clone(), + sql: gq.sql.Clone(), } } @@ -272,8 +258,6 @@ func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy { switch gq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: group.sql = gq.sqlQuery() - case dialect.Neptune: - group.gremlin = gq.gremlinQuery() } return group } @@ -351,7 +335,7 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range gq.order { - p.SQL(selector) + p(selector) } if offset := gq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -364,91 +348,13 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { return selector } -func (gq *GroupQuery) gremlinIDs(ctx context.Context) ([]string, error) { - res := &gremlin.Response{} - query, bindings := gq.gremlinQuery().Query() - if err := gq.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - vertices, err := res.ReadVertices() - if err != nil { - return nil, err - } - ids := make([]string, 0, len(vertices)) - for _, vertex := range vertices { - ids = append(ids, vertex.ID.(string)) - } - return ids, nil -} - -func (gq *GroupQuery) gremlinAll(ctx context.Context) ([]*Group, error) { - res := &gremlin.Response{} - query, bindings := gq.gremlinQuery().ValueMap(true).Query() - if err := gq.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - var grs Groups - if err := grs.FromResponse(res); err != nil { - return nil, err - } - grs.config(gq.config) - return grs, nil -} - -func (gq *GroupQuery) gremlinCount(ctx context.Context) (int, error) { - res := &gremlin.Response{} - query, bindings := gq.gremlinQuery().Count().Query() - if err := gq.driver.Exec(ctx, query, bindings, res); err != nil { - return 0, err - } - return res.ReadInt() -} - -func (gq *GroupQuery) gremlinExist(ctx context.Context) (bool, error) { - res := &gremlin.Response{} - query, bindings := gq.gremlinQuery().HasNext().Query() - if err := gq.driver.Exec(ctx, query, bindings, res); err != nil { - return false, err - } - return res.ReadBool() -} - -func (gq *GroupQuery) gremlinQuery() *dsl.Traversal { - v := g.V().HasLabel(group.Label) - if gq.gremlin != nil { - v = gq.gremlin.Clone() - } - for _, p := range gq.predicates { - p(v) - } - if len(gq.order) > 0 { - v.Order() - for _, p := range gq.order { - p.Gremlin(v) - } - } - 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 { - v.Dedup() - } - return v -} - // GroupQuery is the builder for group-by Group entities. type GroupGroupBy struct { config fields []string fns []Aggregate // intermediate queries. - sql *sql.Selector - gremlin *dsl.Traversal + sql *sql.Selector } // Aggregate adds the given aggregation functions to the group-by query. @@ -462,8 +368,6 @@ func (ggb *GroupGroupBy) Scan(ctx context.Context, v interface{}) error { switch ggb.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return ggb.sqlScan(ctx, v) - case dialect.Neptune: - return ggb.gremlinScan(ctx, v) default: return errors.New("ggb: unsupported dialect") } @@ -579,40 +483,3 @@ func (ggb *GroupGroupBy) sqlQuery() *sql.Selector { } return selector.Select(columns...).GroupBy(ggb.fields...) } - -func (ggb *GroupGroupBy) gremlinScan(ctx context.Context, v interface{}) error { - res := &gremlin.Response{} - query, bindings := ggb.gremlinQuery().Query() - if err := ggb.driver.Exec(ctx, query, bindings, res); err != nil { - return err - } - if len(ggb.fields)+len(ggb.fns) == 1 { - return res.ReadVal(v) - } - vm, err := res.ReadValueMap() - if err != nil { - return err - } - return vm.Decode(v) -} - -func (ggb *GroupGroupBy) gremlinQuery() *dsl.Traversal { - var ( - trs []interface{} - names []interface{} - ) - for _, fn := range ggb.fns { - name, tr := fn.Gremlin("p", "") - trs = append(trs, tr) - names = append(names, name) - } - for _, f := range ggb.fields { - names = append(names, f) - trs = append(trs, __.As("p").Unfold().Values(f).As(f)) - } - return ggb.gremlin.Group(). - By(__.Values(ggb.fields...).Fold()). - By(__.Fold().Match(trs...).Select(names...)). - Select(dsl.Values). - Next() -} diff --git a/entc/integration/migrate/entv2/group_update.go b/entc/integration/migrate/entv2/group_update.go index e02cce71d..4da8ce779 100644 --- a/entc/integration/migrate/entv2/group_update.go +++ b/entc/integration/migrate/entv2/group_update.go @@ -11,9 +11,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/predicate" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -34,9 +31,6 @@ func (gu *GroupUpdate) Save(ctx context.Context) (int, error) { switch gu.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return gu.sqlSave(ctx) - case dialect.Neptune: - vertices, err := gu.gremlinSave(ctx) - return len(vertices), err default: return 0, errors.New("entv2: unsupported dialect") } @@ -97,36 +91,6 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (gu *GroupUpdate) gremlinSave(ctx context.Context) ([]*Group, error) { - res := &gremlin.Response{} - query, bindings := gu.gremlin().Query() - if err := gu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - var grs Groups - grs.config(gu.config) - if err := grs.FromResponse(res); err != nil { - return nil, err - } - return grs, nil -} - -func (gu *GroupUpdate) gremlin() *dsl.Traversal { - v := g.V().HasLabel(group.Label) - for _, p := range gu.predicates { - p(v) - } - var ( - trs []*dsl.Traversal - ) - v.ValueMap(true) - trs = append(trs, v) - return dsl.Join(trs...) -} - // GroupUpdateOne is the builder for updating a single Group entity. type GroupUpdateOne struct { config @@ -138,8 +102,6 @@ func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error) { switch guo.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return guo.sqlSave(ctx) - case dialect.Neptune: - return guo.gremlinSave(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -202,29 +164,3 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (gr *Group, err error) { } return gr, nil } - -func (guo *GroupUpdateOne) gremlinSave(ctx context.Context) (*Group, error) { - res := &gremlin.Response{} - query, bindings := guo.gremlin(guo.id).Query() - if err := guo.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - gr := &Group{config: guo.config} - if err := gr.FromResponse(res); err != nil { - return nil, err - } - return gr, nil -} - -func (guo *GroupUpdateOne) gremlin(id string) *dsl.Traversal { - v := g.V(id) - var ( - trs []*dsl.Traversal - ) - v.ValueMap(true) - trs = append(trs, v) - return dsl.Join(trs...) -} diff --git a/entc/integration/migrate/entv2/pet.go b/entc/integration/migrate/entv2/pet.go index 4783ed24a..2eb9666c6 100644 --- a/entc/integration/migrate/entv2/pet.go +++ b/entc/integration/migrate/entv2/pet.go @@ -7,7 +7,6 @@ import ( "fmt" "strconv" - "fbc/ent/dialect/gremlin" "fbc/ent/dialect/sql" ) @@ -18,22 +17,6 @@ type Pet struct { ID string `json:"id,omitempty"` } -// FromResponse scans the gremlin response data into Pet. -func (pe *Pet) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vpe struct { - ID string `json:"id,omitempty"` - } - if err := vmap.Decode(&vpe); err != nil { - return err - } - pe.ID = vpe.ID - return nil -} - // FromRows scans the sql response data into Pet. func (pe *Pet) FromRows(rows *sql.Rows) error { var vpe struct { @@ -85,26 +68,6 @@ func (pe *Pet) id() int { // Pets is a parsable slice of Pet. type Pets []*Pet -// FromResponse scans the gremlin response data into Pets. -func (pe *Pets) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vpe []struct { - ID string `json:"id,omitempty"` - } - if err := vmap.Decode(&vpe); err != nil { - return err - } - for _, v := range vpe { - *pe = append(*pe, &Pet{ - ID: v.ID, - }) - } - return nil -} - // FromRows scans the sql response data into Pets. func (pe *Pets) FromRows(rows *sql.Rows) error { for rows.Next() { diff --git a/entc/integration/migrate/entv2/pet/pet.go b/entc/integration/migrate/entv2/pet/pet.go index 3532d5a61..9e9122f34 100644 --- a/entc/integration/migrate/entv2/pet/pet.go +++ b/entc/integration/migrate/entv2/pet/pet.go @@ -7,6 +7,7 @@ const ( Label = "pet" // FieldID holds the string denoting the id field in the database. FieldID = "id" + // Table holds the table name of the pet in the database. Table = "pets" ) diff --git a/entc/integration/migrate/entv2/pet/where.go b/entc/integration/migrate/entv2/pet/where.go index 2c8e1f30a..aa1a648eb 100644 --- a/entc/integration/migrate/entv2/pet/where.go +++ b/entc/integration/migrate/entv2/pet/where.go @@ -7,106 +7,82 @@ import ( "fbc/ent/entc/integration/migrate/entv2/predicate" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" - "fbc/ent/dialect/gremlin/graph/dsl/p" "fbc/ent/dialect/sql" ) // ID filters vertices based on their identifier. func ID(id string) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) }, - func(t *dsl.Traversal) { - t.HasID(id) - }, ) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.EQ(id)) - }, ) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.NEQ(id)) - }, ) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.GT(id)) - }, ) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.GTE(id)) - }, ) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.LT(id)) - }, ) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.LTE(id)) - }, ) } // IDIn applies the In predicate on the ID field. func IDIn(ids ...string) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -120,19 +96,12 @@ func IDIn(ids ...string) predicate.Pet { } s.Where(sql.In(s.C(FieldID), v...)) }, - func(t *dsl.Traversal) { - v := make([]interface{}, len(ids)) - for i := range v { - v[i] = ids[i] - } - t.HasID(p.Within(v...)) - }, ) } // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...string) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -146,19 +115,12 @@ func IDNotIn(ids ...string) predicate.Pet { } s.Where(sql.NotIn(s.C(FieldID), v...)) }, - func(t *dsl.Traversal) { - v := make([]interface{}, len(ids)) - for i := range v { - v[i] = ids[i] - } - t.HasID(p.Without(v...)) - }, ) } // Or groups list of predicates with the or operator between them. func Or(predicates ...predicate.Pet) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { for i, p := range predicates { if i > 0 { @@ -167,28 +129,14 @@ func Or(predicates ...predicate.Pet) predicate.Pet { p(s) } }, - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, ) } // Not applies the not operator on the given predicate. func Not(p predicate.Pet) predicate.Pet { - return predicate.PetPerDialect( + return predicate.Pet( func(s *sql.Selector) { p(s.Not()) }, - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, ) } diff --git a/entc/integration/migrate/entv2/pet_create.go b/entc/integration/migrate/entv2/pet_create.go index 906a22fdd..96fc85923 100644 --- a/entc/integration/migrate/entv2/pet_create.go +++ b/entc/integration/migrate/entv2/pet_create.go @@ -10,9 +10,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/pet" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -26,8 +23,6 @@ func (pc *PetCreate) Save(ctx context.Context) (*Pet, error) { switch pc.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return pc.sqlSave(ctx) - case dialect.Neptune: - return pc.gremlinSave(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -66,24 +61,3 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { } return pe, nil } - -func (pc *PetCreate) gremlinSave(ctx context.Context) (*Pet, error) { - res := &gremlin.Response{} - query, bindings := pc.gremlin().Query() - if err := pc.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - pe := &Pet{config: pc.config} - if err := pe.FromResponse(res); err != nil { - return nil, err - } - return pe, nil -} - -func (pc *PetCreate) gremlin() *dsl.Traversal { - v := g.AddV(pet.Label) - return v.ValueMap(true) -} diff --git a/entc/integration/migrate/entv2/pet_delete.go b/entc/integration/migrate/entv2/pet_delete.go index 06e291da6..757631ee6 100644 --- a/entc/integration/migrate/entv2/pet_delete.go +++ b/entc/integration/migrate/entv2/pet_delete.go @@ -10,9 +10,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/predicate" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -33,8 +30,6 @@ func (pd *PetDelete) Exec(ctx context.Context) error { switch pd.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return pd.sqlExec(ctx) - case dialect.Neptune: - return pd.gremlinExec(ctx) default: return errors.New("entv2: unsupported dialect") } @@ -57,20 +52,6 @@ func (pd *PetDelete) sqlExec(ctx context.Context) error { return pd.driver.Exec(ctx, query, args, &res) } -func (pd *PetDelete) gremlinExec(ctx context.Context) error { - res := &gremlin.Response{} - query, bindings := pd.gremlin().Query() - return pd.driver.Exec(ctx, query, bindings, res) -} - -func (pd *PetDelete) gremlin() *dsl.Traversal { - t := g.V().HasLabel(pet.Label) - for _, p := range pd.predicates { - p(t) - } - return t.Drop() -} - // PetDeleteOne is the builder for deleting a single Pet entity. type PetDeleteOne struct { pd *PetDelete diff --git a/entc/integration/migrate/entv2/pet_query.go b/entc/integration/migrate/entv2/pet_query.go index ecf4f870c..c4076cd98 100644 --- a/entc/integration/migrate/entv2/pet_query.go +++ b/entc/integration/migrate/entv2/pet_query.go @@ -12,10 +12,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/predicate" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -28,8 +24,7 @@ type PetQuery struct { unique []string predicates []predicate.Pet // intermediate queries. - sql *sql.Selector - gremlin *dsl.Traversal + sql *sql.Selector } // Where adds a new predicate for the builder. @@ -169,8 +164,6 @@ func (pq *PetQuery) All(ctx context.Context) ([]*Pet, error) { switch pq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return pq.sqlAll(ctx) - case dialect.Neptune: - return pq.gremlinAll(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -190,8 +183,6 @@ func (pq *PetQuery) IDs(ctx context.Context) ([]string, error) { switch pq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return pq.sqlIDs(ctx) - case dialect.Neptune: - return pq.gremlinIDs(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -211,8 +202,6 @@ func (pq *PetQuery) Count(ctx context.Context) (int, error) { switch pq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return pq.sqlCount(ctx) - case dialect.Neptune: - return pq.gremlinCount(ctx) default: return 0, errors.New("entv2: unsupported dialect") } @@ -232,8 +221,6 @@ func (pq *PetQuery) Exist(ctx context.Context) (bool, error) { switch pq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return pq.sqlExist(ctx) - case dialect.Neptune: - return pq.gremlinExist(ctx) default: return false, errors.New("entv2: unsupported dialect") } @@ -259,8 +246,7 @@ func (pq *PetQuery) Clone() *PetQuery { unique: append([]string{}, pq.unique...), predicates: append([]predicate.Pet{}, pq.predicates...), // clone intermediate queries. - sql: pq.sql.Clone(), - gremlin: pq.gremlin.Clone(), + sql: pq.sql.Clone(), } } @@ -272,8 +258,6 @@ func (pq *PetQuery) GroupBy(field string, fields ...string) *PetGroupBy { switch pq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: group.sql = pq.sqlQuery() - case dialect.Neptune: - group.gremlin = pq.gremlinQuery() } return group } @@ -351,7 +335,7 @@ func (pq *PetQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range pq.order { - p.SQL(selector) + p(selector) } if offset := pq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -364,91 +348,13 @@ func (pq *PetQuery) sqlQuery() *sql.Selector { return selector } -func (pq *PetQuery) gremlinIDs(ctx context.Context) ([]string, error) { - res := &gremlin.Response{} - query, bindings := pq.gremlinQuery().Query() - if err := pq.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - vertices, err := res.ReadVertices() - if err != nil { - return nil, err - } - ids := make([]string, 0, len(vertices)) - for _, vertex := range vertices { - ids = append(ids, vertex.ID.(string)) - } - return ids, nil -} - -func (pq *PetQuery) gremlinAll(ctx context.Context) ([]*Pet, error) { - res := &gremlin.Response{} - query, bindings := pq.gremlinQuery().ValueMap(true).Query() - if err := pq.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - var pes Pets - if err := pes.FromResponse(res); err != nil { - return nil, err - } - pes.config(pq.config) - return pes, nil -} - -func (pq *PetQuery) gremlinCount(ctx context.Context) (int, error) { - res := &gremlin.Response{} - query, bindings := pq.gremlinQuery().Count().Query() - if err := pq.driver.Exec(ctx, query, bindings, res); err != nil { - return 0, err - } - return res.ReadInt() -} - -func (pq *PetQuery) gremlinExist(ctx context.Context) (bool, error) { - res := &gremlin.Response{} - query, bindings := pq.gremlinQuery().HasNext().Query() - if err := pq.driver.Exec(ctx, query, bindings, res); err != nil { - return false, err - } - return res.ReadBool() -} - -func (pq *PetQuery) gremlinQuery() *dsl.Traversal { - v := g.V().HasLabel(pet.Label) - if pq.gremlin != nil { - v = pq.gremlin.Clone() - } - for _, p := range pq.predicates { - p(v) - } - if len(pq.order) > 0 { - v.Order() - for _, p := range pq.order { - p.Gremlin(v) - } - } - 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 { - v.Dedup() - } - return v -} - // PetQuery is the builder for group-by Pet entities. type PetGroupBy struct { config fields []string fns []Aggregate // intermediate queries. - sql *sql.Selector - gremlin *dsl.Traversal + sql *sql.Selector } // Aggregate adds the given aggregation functions to the group-by query. @@ -462,8 +368,6 @@ func (pgb *PetGroupBy) Scan(ctx context.Context, v interface{}) error { switch pgb.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return pgb.sqlScan(ctx, v) - case dialect.Neptune: - return pgb.gremlinScan(ctx, v) default: return errors.New("pgb: unsupported dialect") } @@ -579,40 +483,3 @@ func (pgb *PetGroupBy) sqlQuery() *sql.Selector { } return selector.Select(columns...).GroupBy(pgb.fields...) } - -func (pgb *PetGroupBy) gremlinScan(ctx context.Context, v interface{}) error { - res := &gremlin.Response{} - query, bindings := pgb.gremlinQuery().Query() - if err := pgb.driver.Exec(ctx, query, bindings, res); err != nil { - return err - } - if len(pgb.fields)+len(pgb.fns) == 1 { - return res.ReadVal(v) - } - vm, err := res.ReadValueMap() - if err != nil { - return err - } - return vm.Decode(v) -} - -func (pgb *PetGroupBy) gremlinQuery() *dsl.Traversal { - var ( - trs []interface{} - names []interface{} - ) - for _, fn := range pgb.fns { - name, tr := fn.Gremlin("p", "") - trs = append(trs, tr) - names = append(names, name) - } - for _, f := range pgb.fields { - names = append(names, f) - trs = append(trs, __.As("p").Unfold().Values(f).As(f)) - } - return pgb.gremlin.Group(). - By(__.Values(pgb.fields...).Fold()). - By(__.Fold().Match(trs...).Select(names...)). - Select(dsl.Values). - Next() -} diff --git a/entc/integration/migrate/entv2/pet_update.go b/entc/integration/migrate/entv2/pet_update.go index a7ea8f07d..f539741eb 100644 --- a/entc/integration/migrate/entv2/pet_update.go +++ b/entc/integration/migrate/entv2/pet_update.go @@ -11,9 +11,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/predicate" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -34,9 +31,6 @@ func (pu *PetUpdate) Save(ctx context.Context) (int, error) { switch pu.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return pu.sqlSave(ctx) - case dialect.Neptune: - vertices, err := pu.gremlinSave(ctx) - return len(vertices), err default: return 0, errors.New("entv2: unsupported dialect") } @@ -97,36 +91,6 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (pu *PetUpdate) gremlinSave(ctx context.Context) ([]*Pet, error) { - res := &gremlin.Response{} - query, bindings := pu.gremlin().Query() - if err := pu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - var pes Pets - pes.config(pu.config) - if err := pes.FromResponse(res); err != nil { - return nil, err - } - return pes, nil -} - -func (pu *PetUpdate) gremlin() *dsl.Traversal { - v := g.V().HasLabel(pet.Label) - for _, p := range pu.predicates { - p(v) - } - var ( - trs []*dsl.Traversal - ) - v.ValueMap(true) - trs = append(trs, v) - return dsl.Join(trs...) -} - // PetUpdateOne is the builder for updating a single Pet entity. type PetUpdateOne struct { config @@ -138,8 +102,6 @@ func (puo *PetUpdateOne) Save(ctx context.Context) (*Pet, error) { switch puo.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return puo.sqlSave(ctx) - case dialect.Neptune: - return puo.gremlinSave(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -202,29 +164,3 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (pe *Pet, err error) { } return pe, nil } - -func (puo *PetUpdateOne) gremlinSave(ctx context.Context) (*Pet, error) { - res := &gremlin.Response{} - query, bindings := puo.gremlin(puo.id).Query() - if err := puo.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - pe := &Pet{config: puo.config} - if err := pe.FromResponse(res); err != nil { - return nil, err - } - return pe, nil -} - -func (puo *PetUpdateOne) gremlin(id string) *dsl.Traversal { - v := g.V(id) - var ( - trs []*dsl.Traversal - ) - v.ValueMap(true) - trs = append(trs, v) - return dsl.Join(trs...) -} diff --git a/entc/integration/migrate/entv2/predicate/predicate.go b/entc/integration/migrate/entv2/predicate/predicate.go index 3debf73f6..efb8c859c 100644 --- a/entc/integration/migrate/entv2/predicate/predicate.go +++ b/entc/integration/migrate/entv2/predicate/predicate.go @@ -3,59 +3,14 @@ package predicate import ( - "fmt" - - "fbc/ent/dialect/gremlin/graph/dsl" "fbc/ent/dialect/sql" ) // Group is the predicate function for group builders. -type Group func(interface{}) - -// GroupPerDialect construct a predicate for both gremlin traversal and sql selector. -func GroupPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Group { - return Group(func(v interface{}) { - switch v := v.(type) { - case *sql.Selector: - f1(v) - case *dsl.Traversal: - f2(v) - default: - panic(fmt.Sprintf("unknown type for predicate: %T", v)) - } - }) -} +type Group func(*sql.Selector) // Pet is the predicate function for pet builders. -type Pet func(interface{}) - -// PetPerDialect construct a predicate for both gremlin traversal and sql selector. -func PetPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Pet { - return Pet(func(v interface{}) { - switch v := v.(type) { - case *sql.Selector: - f1(v) - case *dsl.Traversal: - f2(v) - default: - panic(fmt.Sprintf("unknown type for predicate: %T", v)) - } - }) -} +type Pet func(*sql.Selector) // User is the predicate function for user builders. -type User func(interface{}) - -// UserPerDialect construct a predicate for both gremlin traversal and sql selector. -func UserPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) User { - return User(func(v interface{}) { - switch v := v.(type) { - case *sql.Selector: - f1(v) - case *dsl.Traversal: - f2(v) - default: - panic(fmt.Sprintf("unknown type for predicate: %T", v)) - } - }) -} +type User func(*sql.Selector) diff --git a/entc/integration/migrate/entv2/user.go b/entc/integration/migrate/entv2/user.go index 77ed43e28..e2c22d520 100644 --- a/entc/integration/migrate/entv2/user.go +++ b/entc/integration/migrate/entv2/user.go @@ -7,7 +7,6 @@ import ( "fmt" "strconv" - "fbc/ent/dialect/gremlin" "fbc/ent/dialect/sql" ) @@ -24,28 +23,6 @@ type User struct { Phone string `json:"phone,omitempty"` } -// FromResponse scans the gremlin response data into User. -func (u *User) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vu struct { - ID string `json:"id,omitempty"` - Age int `json:"age,omitempty"` - Name string `json:"name,omitempty"` - Phone string `json:"phone,omitempty"` - } - if err := vmap.Decode(&vu); err != nil { - return err - } - u.ID = vu.ID - u.Age = vu.Age - u.Name = vu.Name - u.Phone = vu.Phone - return nil -} - // FromRows scans the sql response data into User. func (u *User) FromRows(rows *sql.Rows) error { var vu struct { @@ -109,32 +86,6 @@ func (u *User) id() int { // Users is a parsable slice of User. type Users []*User -// FromResponse scans the gremlin response data into Users. -func (u *Users) FromResponse(res *gremlin.Response) error { - vmap, err := res.ReadValueMap() - if err != nil { - return err - } - var vu []struct { - ID string `json:"id,omitempty"` - Age int `json:"age,omitempty"` - Name string `json:"name,omitempty"` - Phone string `json:"phone,omitempty"` - } - if err := vmap.Decode(&vu); err != nil { - return err - } - for _, v := range vu { - *u = append(*u, &User{ - ID: v.ID, - Age: v.Age, - Name: v.Name, - Phone: v.Phone, - }) - } - return nil -} - // FromRows scans the sql response data into Users. func (u *Users) FromRows(rows *sql.Rows) error { for rows.Next() { diff --git a/entc/integration/migrate/entv2/user/user.go b/entc/integration/migrate/entv2/user/user.go index bef6ab94f..0b6d1fcb1 100644 --- a/entc/integration/migrate/entv2/user/user.go +++ b/entc/integration/migrate/entv2/user/user.go @@ -5,14 +5,15 @@ package user const ( // Label holds the string label denoting the user type in the database. Label = "user" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" // FieldAge holds the string denoting the age vertex property in the database. FieldAge = "age" // FieldName holds the string denoting the name vertex property in the database. FieldName = "name" // FieldPhone holds the string denoting the phone vertex property in the database. FieldPhone = "phone" - // FieldID holds the string denoting the id field in the database. - FieldID = "id" + // Table holds the table name of the user in the database. Table = "users" ) diff --git a/entc/integration/migrate/entv2/user/where.go b/entc/integration/migrate/entv2/user/where.go index ec1f9e7b0..1c0f9b1de 100644 --- a/entc/integration/migrate/entv2/user/where.go +++ b/entc/integration/migrate/entv2/user/where.go @@ -7,106 +7,82 @@ import ( "fbc/ent/entc/integration/migrate/entv2/predicate" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" - "fbc/ent/dialect/gremlin/graph/dsl/p" "fbc/ent/dialect/sql" ) // ID filters vertices based on their identifier. func ID(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) }, - func(t *dsl.Traversal) { - t.HasID(id) - }, ) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.EQ(id)) - }, ) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.NEQ(id)) - }, ) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.GT(id)) - }, ) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.GTE(id)) - }, ) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.LT(id)) - }, ) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { v, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), v)) }, - func(t *dsl.Traversal) { - t.HasID(p.LTE(id)) - }, ) } // IDIn applies the In predicate on the ID field. func IDIn(ids ...string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -120,19 +96,12 @@ func IDIn(ids ...string) predicate.User { } s.Where(sql.In(s.C(FieldID), v...)) }, - func(t *dsl.Traversal) { - v := make([]interface{}, len(ids)) - for i := range v { - v[i] = ids[i] - } - t.HasID(p.Within(v...)) - }, ) } // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -146,121 +115,87 @@ func IDNotIn(ids ...string) predicate.User { } s.Where(sql.NotIn(s.C(FieldID), v...)) }, - func(t *dsl.Traversal) { - v := make([]interface{}, len(ids)) - for i := range v { - v[i] = ids[i] - } - t.HasID(p.Without(v...)) - }, ) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.EQ(v)) - }, ) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.EQ(v)) - }, ) } // Phone applies equality check predicate on the "phone" field. It's identical to PhoneEQ. func Phone(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldPhone), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.EQ(v)) - }, ) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.EQ(v)) - }, ) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.NEQ(v)) - }, ) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.GT(v)) - }, ) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.GTE(v)) - }, ) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.LT(v)) - }, ) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.LTE(v)) - }, ) } @@ -270,7 +205,7 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -280,9 +215,6 @@ func AgeIn(vs ...int) predicate.User { } s.Where(sql.In(s.C(FieldAge), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.Within(v...)) - }, ) } @@ -292,7 +224,7 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -302,81 +234,60 @@ func AgeNotIn(vs ...int) predicate.User { } s.Where(sql.NotIn(s.C(FieldAge), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldAge, p.Without(v...)) - }, ) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.EQ(v)) - }, ) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.NEQ(v)) - }, ) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.GT(v)) - }, ) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.GTE(v)) - }, ) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.LT(v)) - }, ) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.LTE(v)) - }, ) } @@ -386,7 +297,7 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -396,9 +307,6 @@ func NameIn(vs ...string) predicate.User { } s.Where(sql.In(s.C(FieldName), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.Within(v...)) - }, ) } @@ -408,7 +316,7 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -418,117 +326,87 @@ func NameNotIn(vs ...string) predicate.User { } s.Where(sql.NotIn(s.C(FieldName), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.Without(v...)) - }, ) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.Containing(v)) - }, ) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.StartingWith(v)) - }, ) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldName, p.EndingWith(v)) - }, ) } // PhoneEQ applies the EQ predicate on the "phone" field. func PhoneEQ(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldPhone), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.EQ(v)) - }, ) } // PhoneNEQ applies the NEQ predicate on the "phone" field. func PhoneNEQ(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldPhone), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.NEQ(v)) - }, ) } // PhoneGT applies the GT predicate on the "phone" field. func PhoneGT(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldPhone), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.GT(v)) - }, ) } // PhoneGTE applies the GTE predicate on the "phone" field. func PhoneGTE(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldPhone), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.GTE(v)) - }, ) } // PhoneLT applies the LT predicate on the "phone" field. func PhoneLT(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldPhone), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.LT(v)) - }, ) } // PhoneLTE applies the LTE predicate on the "phone" field. func PhoneLTE(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldPhone), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.LTE(v)) - }, ) } @@ -538,7 +416,7 @@ func PhoneIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -548,9 +426,6 @@ func PhoneIn(vs ...string) predicate.User { } s.Where(sql.In(s.C(FieldPhone), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.Within(v...)) - }, ) } @@ -560,7 +435,7 @@ func PhoneNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -570,51 +445,39 @@ func PhoneNotIn(vs ...string) predicate.User { } s.Where(sql.NotIn(s.C(FieldPhone), v...)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.Without(v...)) - }, ) } // PhoneContains applies the Contains predicate on the "phone" field. func PhoneContains(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldPhone), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.Containing(v)) - }, ) } // PhoneHasPrefix applies the HasPrefix predicate on the "phone" field. func PhoneHasPrefix(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldPhone), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.StartingWith(v)) - }, ) } // PhoneHasSuffix applies the HasSuffix predicate on the "phone" field. func PhoneHasSuffix(v string) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldPhone), v)) }, - func(t *dsl.Traversal) { - t.Has(Label, FieldPhone, p.EndingWith(v)) - }, ) } // Or groups list of predicates with the or operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { for i, p := range predicates { if i > 0 { @@ -623,28 +486,14 @@ func Or(predicates ...predicate.User) predicate.User { p(s) } }, - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, ) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.UserPerDialect( + return predicate.User( func(s *sql.Selector) { p(s.Not()) }, - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, ) } diff --git a/entc/integration/migrate/entv2/user_create.go b/entc/integration/migrate/entv2/user_create.go index 7280d1486..f11717ef8 100644 --- a/entc/integration/migrate/entv2/user_create.go +++ b/entc/integration/migrate/entv2/user_create.go @@ -10,9 +10,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/user" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -56,8 +53,6 @@ func (uc *UserCreate) Save(ctx context.Context) (*User, error) { switch uc.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uc.sqlSave(ctx) - case dialect.Neptune: - return uc.gremlinSave(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -108,33 +103,3 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return u, nil } - -func (uc *UserCreate) gremlinSave(ctx context.Context) (*User, error) { - res := &gremlin.Response{} - query, bindings := uc.gremlin().Query() - if err := uc.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - u := &User{config: uc.config} - if err := u.FromResponse(res); err != nil { - return nil, err - } - return u, nil -} - -func (uc *UserCreate) gremlin() *dsl.Traversal { - v := g.AddV(user.Label) - if uc.age != nil { - v.Property(dsl.Single, user.FieldAge, *uc.age) - } - if uc.name != nil { - v.Property(dsl.Single, user.FieldName, *uc.name) - } - if uc.phone != nil { - v.Property(dsl.Single, user.FieldPhone, *uc.phone) - } - return v.ValueMap(true) -} diff --git a/entc/integration/migrate/entv2/user_delete.go b/entc/integration/migrate/entv2/user_delete.go index 65bb56798..4bdcb5bee 100644 --- a/entc/integration/migrate/entv2/user_delete.go +++ b/entc/integration/migrate/entv2/user_delete.go @@ -10,9 +10,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/user" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -33,8 +30,6 @@ func (ud *UserDelete) Exec(ctx context.Context) error { switch ud.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return ud.sqlExec(ctx) - case dialect.Neptune: - return ud.gremlinExec(ctx) default: return errors.New("entv2: unsupported dialect") } @@ -57,20 +52,6 @@ func (ud *UserDelete) sqlExec(ctx context.Context) error { return ud.driver.Exec(ctx, query, args, &res) } -func (ud *UserDelete) gremlinExec(ctx context.Context) error { - res := &gremlin.Response{} - query, bindings := ud.gremlin().Query() - return ud.driver.Exec(ctx, query, bindings, res) -} - -func (ud *UserDelete) gremlin() *dsl.Traversal { - t := g.V().HasLabel(user.Label) - for _, p := range ud.predicates { - p(t) - } - return t.Drop() -} - // UserDeleteOne is the builder for deleting a single User entity. type UserDeleteOne struct { ud *UserDelete diff --git a/entc/integration/migrate/entv2/user_query.go b/entc/integration/migrate/entv2/user_query.go index f585af2dc..c9e127edc 100644 --- a/entc/integration/migrate/entv2/user_query.go +++ b/entc/integration/migrate/entv2/user_query.go @@ -12,10 +12,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/user" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/__" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -28,8 +24,7 @@ type UserQuery struct { unique []string predicates []predicate.User // intermediate queries. - sql *sql.Selector - gremlin *dsl.Traversal + sql *sql.Selector } // Where adds a new predicate for the builder. @@ -169,8 +164,6 @@ func (uq *UserQuery) All(ctx context.Context) ([]*User, error) { switch uq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uq.sqlAll(ctx) - case dialect.Neptune: - return uq.gremlinAll(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -190,8 +183,6 @@ func (uq *UserQuery) IDs(ctx context.Context) ([]string, error) { switch uq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uq.sqlIDs(ctx) - case dialect.Neptune: - return uq.gremlinIDs(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -211,8 +202,6 @@ func (uq *UserQuery) Count(ctx context.Context) (int, error) { switch uq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uq.sqlCount(ctx) - case dialect.Neptune: - return uq.gremlinCount(ctx) default: return 0, errors.New("entv2: unsupported dialect") } @@ -232,8 +221,6 @@ func (uq *UserQuery) Exist(ctx context.Context) (bool, error) { switch uq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uq.sqlExist(ctx) - case dialect.Neptune: - return uq.gremlinExist(ctx) default: return false, errors.New("entv2: unsupported dialect") } @@ -259,8 +246,7 @@ func (uq *UserQuery) Clone() *UserQuery { unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate queries. - sql: uq.sql.Clone(), - gremlin: uq.gremlin.Clone(), + sql: uq.sql.Clone(), } } @@ -285,8 +271,6 @@ func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy { switch uq.driver.Dialect() { case dialect.MySQL, dialect.SQLite: group.sql = uq.sqlQuery() - case dialect.Neptune: - group.gremlin = uq.gremlinQuery() } return group } @@ -364,7 +348,7 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range uq.order { - p.SQL(selector) + p(selector) } if offset := uq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -377,91 +361,13 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { return selector } -func (uq *UserQuery) gremlinIDs(ctx context.Context) ([]string, error) { - res := &gremlin.Response{} - query, bindings := uq.gremlinQuery().Query() - if err := uq.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - vertices, err := res.ReadVertices() - if err != nil { - return nil, err - } - ids := make([]string, 0, len(vertices)) - for _, vertex := range vertices { - ids = append(ids, vertex.ID.(string)) - } - return ids, nil -} - -func (uq *UserQuery) gremlinAll(ctx context.Context) ([]*User, error) { - res := &gremlin.Response{} - query, bindings := uq.gremlinQuery().ValueMap(true).Query() - if err := uq.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - var us Users - if err := us.FromResponse(res); err != nil { - return nil, err - } - us.config(uq.config) - return us, nil -} - -func (uq *UserQuery) gremlinCount(ctx context.Context) (int, error) { - res := &gremlin.Response{} - query, bindings := uq.gremlinQuery().Count().Query() - if err := uq.driver.Exec(ctx, query, bindings, res); err != nil { - return 0, err - } - return res.ReadInt() -} - -func (uq *UserQuery) gremlinExist(ctx context.Context) (bool, error) { - res := &gremlin.Response{} - query, bindings := uq.gremlinQuery().HasNext().Query() - if err := uq.driver.Exec(ctx, query, bindings, res); err != nil { - return false, err - } - return res.ReadBool() -} - -func (uq *UserQuery) gremlinQuery() *dsl.Traversal { - v := g.V().HasLabel(user.Label) - if uq.gremlin != nil { - v = uq.gremlin.Clone() - } - for _, p := range uq.predicates { - p(v) - } - if len(uq.order) > 0 { - v.Order() - for _, p := range uq.order { - p.Gremlin(v) - } - } - 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 { - v.Dedup() - } - return v -} - // UserQuery is the builder for group-by User entities. type UserGroupBy struct { config fields []string fns []Aggregate // intermediate queries. - sql *sql.Selector - gremlin *dsl.Traversal + sql *sql.Selector } // Aggregate adds the given aggregation functions to the group-by query. @@ -475,8 +381,6 @@ func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error { switch ugb.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return ugb.sqlScan(ctx, v) - case dialect.Neptune: - return ugb.gremlinScan(ctx, v) default: return errors.New("ugb: unsupported dialect") } @@ -592,40 +496,3 @@ func (ugb *UserGroupBy) sqlQuery() *sql.Selector { } return selector.Select(columns...).GroupBy(ugb.fields...) } - -func (ugb *UserGroupBy) gremlinScan(ctx context.Context, v interface{}) error { - res := &gremlin.Response{} - query, bindings := ugb.gremlinQuery().Query() - if err := ugb.driver.Exec(ctx, query, bindings, res); err != nil { - return err - } - if len(ugb.fields)+len(ugb.fns) == 1 { - return res.ReadVal(v) - } - vm, err := res.ReadValueMap() - if err != nil { - return err - } - return vm.Decode(v) -} - -func (ugb *UserGroupBy) gremlinQuery() *dsl.Traversal { - var ( - trs []interface{} - names []interface{} - ) - for _, fn := range ugb.fns { - name, tr := fn.Gremlin("p", "") - trs = append(trs, tr) - names = append(names, name) - } - for _, f := range ugb.fields { - names = append(names, f) - trs = append(trs, __.As("p").Unfold().Values(f).As(f)) - } - return ugb.gremlin.Group(). - By(__.Values(ugb.fields...).Fold()). - By(__.Fold().Match(trs...).Select(names...)). - Select(dsl.Values). - Next() -} diff --git a/entc/integration/migrate/entv2/user_update.go b/entc/integration/migrate/entv2/user_update.go index 39ec41c88..7f6b44bf8 100644 --- a/entc/integration/migrate/entv2/user_update.go +++ b/entc/integration/migrate/entv2/user_update.go @@ -11,9 +11,6 @@ import ( "fbc/ent/entc/integration/migrate/entv2/user" "fbc/ent/dialect" - "fbc/ent/dialect/gremlin" - "fbc/ent/dialect/gremlin/graph/dsl" - "fbc/ent/dialect/gremlin/graph/dsl/g" "fbc/ent/dialect/sql" ) @@ -55,9 +52,6 @@ func (uu *UserUpdate) Save(ctx context.Context) (int, error) { switch uu.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uu.sqlSave(ctx) - case dialect.Neptune: - vertices, err := uu.gremlinSave(ctx) - return len(vertices), err default: return 0, errors.New("entv2: unsupported dialect") } @@ -141,45 +135,6 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (uu *UserUpdate) gremlinSave(ctx context.Context) ([]*User, error) { - res := &gremlin.Response{} - query, bindings := uu.gremlin().Query() - if err := uu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - var us Users - us.config(uu.config) - if err := us.FromResponse(res); err != nil { - return nil, err - } - return us, nil -} - -func (uu *UserUpdate) gremlin() *dsl.Traversal { - v := g.V().HasLabel(user.Label) - for _, p := range uu.predicates { - p(v) - } - var ( - trs []*dsl.Traversal - ) - if uu.age != nil { - v.Property(dsl.Single, user.FieldAge, *uu.age) - } - if uu.name != nil { - v.Property(dsl.Single, user.FieldName, *uu.name) - } - if uu.phone != nil { - v.Property(dsl.Single, user.FieldPhone, *uu.phone) - } - v.ValueMap(true) - trs = append(trs, v) - return dsl.Join(trs...) -} - // UserUpdateOne is the builder for updating a single User entity. type UserUpdateOne struct { config @@ -212,8 +167,6 @@ func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error) { switch uuo.driver.Dialect() { case dialect.MySQL, dialect.SQLite: return uuo.sqlSave(ctx) - case dialect.Neptune: - return uuo.gremlinSave(ctx) default: return nil, errors.New("entv2: unsupported dialect") } @@ -302,38 +255,3 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } return u, nil } - -func (uuo *UserUpdateOne) gremlinSave(ctx context.Context) (*User, error) { - res := &gremlin.Response{} - query, bindings := uuo.gremlin(uuo.id).Query() - if err := uuo.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err - } - if err, ok := isConstantError(res); ok { - return nil, err - } - u := &User{config: uuo.config} - if err := u.FromResponse(res); err != nil { - return nil, err - } - return u, nil -} - -func (uuo *UserUpdateOne) gremlin(id string) *dsl.Traversal { - v := g.V(id) - var ( - trs []*dsl.Traversal - ) - if uuo.age != nil { - v.Property(dsl.Single, user.FieldAge, *uuo.age) - } - if uuo.name != nil { - v.Property(dsl.Single, user.FieldName, *uuo.name) - } - if uuo.phone != nil { - v.Property(dsl.Single, user.FieldPhone, *uuo.phone) - } - v.ValueMap(true) - trs = append(trs, v) - return dsl.Join(trs...) -} diff --git a/entc/integration/plugin/ent/boring.go b/entc/integration/plugin/ent/boring.go index 41133ea28..9ac940997 100644 --- a/entc/integration/plugin/ent/boring.go +++ b/entc/integration/plugin/ent/boring.go @@ -18,6 +18,21 @@ type Boring struct { ID string `json:"id,omitempty"` } +// FromRows scans the sql response data into Boring. +func (b *Boring) FromRows(rows *sql.Rows) error { + var vb struct { + ID int + } + // the order here should be the same as in the `boring.Columns`. + if err := rows.Scan( + &vb.ID, + ); err != nil { + return err + } + b.ID = strconv.Itoa(vb.ID) + return nil +} + // FromResponse scans the gremlin response data into Boring. func (b *Boring) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -34,21 +49,6 @@ func (b *Boring) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into Boring. -func (b *Boring) FromRows(rows *sql.Rows) error { - var vb struct { - ID int - } - // the order here should be the same as in the `boring.Columns`. - if err := rows.Scan( - &vb.ID, - ); err != nil { - return err - } - b.ID = strconv.Itoa(vb.ID) - return nil -} - // Update returns a builder for updating this Boring. // Note that, you need to call Boring.Unwrap() before calling this method, if this Boring // was returned from a transaction, and the transaction was committed or rolled back. @@ -85,6 +85,18 @@ func (b *Boring) id() int { // Borings is a parsable slice of Boring. type Borings []*Boring +// FromRows scans the sql response data into Borings. +func (b *Borings) FromRows(rows *sql.Rows) error { + for rows.Next() { + vb := &Boring{} + if err := vb.FromRows(rows); err != nil { + return err + } + *b = append(*b, vb) + } + return nil +} + // FromResponse scans the gremlin response data into Borings. func (b *Borings) FromResponse(res *gremlin.Response) error { vmap, err := res.ReadValueMap() @@ -105,18 +117,6 @@ func (b *Borings) FromResponse(res *gremlin.Response) error { return nil } -// FromRows scans the sql response data into Borings. -func (b *Borings) FromRows(rows *sql.Rows) error { - for rows.Next() { - vb := &Boring{} - if err := vb.FromRows(rows); err != nil { - return err - } - *b = append(*b, vb) - } - return nil -} - func (b Borings) config(cfg config) { for i := range b { b[i].config = cfg diff --git a/entc/integration/plugin/ent/boring/boring.go b/entc/integration/plugin/ent/boring/boring.go index bde408b41..47e00fb07 100644 --- a/entc/integration/plugin/ent/boring/boring.go +++ b/entc/integration/plugin/ent/boring/boring.go @@ -7,6 +7,7 @@ const ( Label = "boring" // FieldID holds the string denoting the id field in the database. FieldID = "id" + // Table holds the table name of the boring in the database. Table = "borings" ) diff --git a/entc/integration/plugin/ent/boring_query.go b/entc/integration/plugin/ent/boring_query.go index dba2fecda..ccc7272cc 100644 --- a/entc/integration/plugin/ent/boring_query.go +++ b/entc/integration/plugin/ent/boring_query.go @@ -351,7 +351,7 @@ func (bq *BoringQuery) sqlQuery() *sql.Selector { p(selector) } for _, p := range bq.order { - p.SQL(selector) + p(selector) } if offset := bq.offset; offset != nil { // limit is mandatory for offset clause. We start @@ -424,7 +424,7 @@ func (bq *BoringQuery) gremlinQuery() *dsl.Traversal { if len(bq.order) > 0 { v.Order() for _, p := range bq.order { - p.Gremlin(v) + p(v) } } switch limit, offset := bq.limit, bq.offset; { diff --git a/entc/integration/plugin/ent/boring_update.go b/entc/integration/plugin/ent/boring_update.go index 67ef64eaf..f244620cd 100644 --- a/entc/integration/plugin/ent/boring_update.go +++ b/entc/integration/plugin/ent/boring_update.go @@ -35,8 +35,7 @@ func (bu *BoringUpdate) Save(ctx context.Context) (int, error) { case dialect.MySQL, dialect.SQLite: return bu.sqlSave(ctx) case dialect.Neptune: - vertices, err := bu.gremlinSave(ctx) - return len(vertices), err + return bu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } @@ -97,21 +96,16 @@ func (bu *BoringUpdate) sqlSave(ctx context.Context) (n int, err error) { return len(ids), nil } -func (bu *BoringUpdate) gremlinSave(ctx context.Context) ([]*Boring, error) { +func (bu *BoringUpdate) gremlinSave(ctx context.Context) (int, error) { res := &gremlin.Response{} query, bindings := bu.gremlin().Query() if err := bu.driver.Exec(ctx, query, bindings, res); err != nil { - return nil, err + return 0, err } if err, ok := isConstantError(res); ok { - return nil, err + return 0, err } - var bs Borings - bs.config(bu.config) - if err := bs.FromResponse(res); err != nil { - return nil, err - } - return bs, nil + return res.ReadInt() } func (bu *BoringUpdate) gremlin() *dsl.Traversal { @@ -122,7 +116,7 @@ func (bu *BoringUpdate) gremlin() *dsl.Traversal { var ( trs []*dsl.Traversal ) - v.ValueMap(true) + v.Count() trs = append(trs, v) return dsl.Join(trs...) } diff --git a/entc/integration/plugin/ent/ent.go b/entc/integration/plugin/ent/ent.go index 83dfa9980..73351a955 100644 --- a/entc/integration/plugin/ent/ent.go +++ b/entc/integration/plugin/ent/ent.go @@ -16,41 +16,52 @@ import ( ) // Order applies an ordering on either graph traversal or sql selector. -type Order struct { - SQL func(*sql.Selector) - Gremlin func(*dsl.Traversal) +type Order func(interface{}) + +// OrderPerDialect construct the "order by" clause for graph traversals based on dialect type. +func OrderPerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) Order { + return Order(func(v interface{}) { + switch v := v.(type) { + case *sql.Selector: + f0(v) + case *dsl.Traversal: + f1(v) + default: + panic(fmt.Sprintf("unknown type for order: %T", v)) + } + }) } // Asc applies the given fields in ASC order. func Asc(fields ...string) Order { - return Order{ - SQL: func(s *sql.Selector) { + return OrderPerDialect( + func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) } }, - Gremlin: func(tr *dsl.Traversal) { + func(tr *dsl.Traversal) { for _, f := range fields { tr.By(f, dsl.Incr) } }, - } + ) } // Desc applies the given fields in DESC order. func Desc(fields ...string) Order { - return Order{ - SQL: func(s *sql.Selector) { + return OrderPerDialect( + func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) } }, - Gremlin: func(tr *dsl.Traversal) { + func(tr *dsl.Traversal) { for _, f := range fields { tr.By(f, dsl.Decr) } }, - } + ) } // Aggregate applies an aggregation step on the group-by traversal/selector. @@ -241,6 +252,31 @@ func (e *ErrConstraintFailed) Unwrap() error { return e.wrap } +// IsConstraintFailure returns a boolean indicating whether the error is a constraint failure. +func IsConstraintFailure(err error) bool { + _, ok := err.(*ErrConstraintFailed) + return ok +} + +func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { + // Error number 1062 is ER_DUP_ENTRY in mysql, and "UNIQUE constraint failed" is SQLite prefix. + if msg := err.Error(); strings.HasPrefix(msg, "Error 1062") || strings.HasPrefix(msg, "UNIQUE constraint failed") { + return &ErrConstraintFailed{msg, err}, true + } + return nil, false +} + +// rollback calls to tx.Rollback and wraps the given error with the rollback error if occurred. +func rollback(tx dialect.Tx, err error) error { + if rerr := tx.Rollback(); rerr != nil { + err = fmt.Errorf("%s: %v", err.Error(), rerr) + } + if err, ok := isSQLConstraintError(err); ok { + return err + } + return err +} + // Code implements the dsl.Node interface. func (e ErrConstraintFailed) Code() (string, []interface{}) { return strconv.Quote(e.prefix() + e.msg), nil @@ -274,12 +310,6 @@ func NewErrUniqueEdge(label, edge, id string) *ErrConstraintFailed { return &ErrConstraintFailed{msg: fmt.Sprintf("edge %s.%s with id: %#v", label, edge, id)} } -// IsConstraintFailure returns a boolean indicating whether the error is a constraint failure. -func IsConstraintFailure(err error) bool { - _, ok := err.(*ErrConstraintFailed) - return ok -} - // isConstantError indicates if the given response holds a gremlin constant containing an error. func isConstantError(r *gremlin.Response) (*ErrConstraintFailed, bool) { e := &ErrConstraintFailed{} @@ -289,25 +319,6 @@ func isConstantError(r *gremlin.Response) (*ErrConstraintFailed, bool) { return e, true } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { - // Error number 1062 is ER_DUP_ENTRY in mysql, and "UNIQUE constraint failed" is SQLite prefix. - if msg := err.Error(); strings.HasPrefix(msg, "Error 1062") || strings.HasPrefix(msg, "UNIQUE constraint failed") { - return &ErrConstraintFailed{msg, err}, true - } - return nil, false -} - -// rollback calls to tx.Rollback and wraps the given error with the rollback error if occurred. -func rollback(tx dialect.Tx, err error) error { - if rerr := tx.Rollback(); rerr != nil { - err = fmt.Errorf("%s: %v", err.Error(), rerr) - } - if err, ok := isSQLConstraintError(err); ok { - return err - } - return err -} - // keys returns the keys/ids from the edge map. func keys(m map[string]struct{}) []string { s := make([]string, 0, len(m)) diff --git a/entc/integration/plugin/ent/example_test.go b/entc/integration/plugin/ent/example_test.go index 22e29ba08..a26b040e5 100644 --- a/entc/integration/plugin/ent/example_test.go +++ b/entc/integration/plugin/ent/example_test.go @@ -5,37 +5,27 @@ package ent import ( "context" "log" - "net/url" - "os" - "fbc/ent/dialect/gremlin" + "fbc/ent/dialect/sql" ) -// endpoint for the database. In order to run the tests locally, run the following command: +// dsn for the database. In order to run the tests locally, run the following command: // -// ENT_INTEGRATION_ENDPOINT="http://localhost:8182" go test -v +// ENT_INTEGRATION_ENDPOINT="root:pass@tcp(localhost:3306)/test?parseTime=True" go test -v // -var endpoint *gremlin.Endpoint - -func init() { - if e, ok := os.LookupEnv("ENT_INTEGRATION_ENDPOINT"); ok { - if u, err := url.Parse(e); err == nil { - endpoint = &gremlin.Endpoint{u} - } - } -} +var dsn string func ExampleBoring() { - if endpoint == nil { + if dsn == "" { return } ctx := context.Background() - conn, err := gremlin.NewClient(gremlin.Config{Endpoint: *endpoint}) + drv, err := sql.Open("mysql", dsn) if err != nil { log.Fatalf("failed creating database client: %v", err) } - client := NewClient(Driver(gremlin.NewDriver(conn))) - + defer drv.Close() + client := NewClient(Driver(drv)) // creating vertices for the boring's edges. // create boring vertex with its edges. diff --git a/entc/integration/plugin/ent/predicate/predicate.go b/entc/integration/plugin/ent/predicate/predicate.go index 813118180..3157d13a9 100644 --- a/entc/integration/plugin/ent/predicate/predicate.go +++ b/entc/integration/plugin/ent/predicate/predicate.go @@ -12,14 +12,14 @@ import ( // Boring is the predicate function for boring builders. type Boring func(interface{}) -// BoringPerDialect construct a predicate for both gremlin traversal and sql selector. -func BoringPerDialect(f1 func(*sql.Selector), f2 func(*dsl.Traversal)) Boring { +// BoringPerDialect construct a predicate for graph traversals based on dialect type. +func BoringPerDialect(f0 func(*sql.Selector), f1 func(*dsl.Traversal)) Boring { return Boring(func(v interface{}) { switch v := v.(type) { case *sql.Selector: - f1(v) + f0(v) case *dsl.Traversal: - f2(v) + f1(v) default: panic(fmt.Sprintf("unknown type for predicate: %T", v)) } diff --git a/entc/integration/plugin/plugin_test.go b/entc/integration/plugin/plugin_test.go index 6b0fd6440..f9e40ecd0 100644 --- a/entc/integration/plugin/plugin_test.go +++ b/entc/integration/plugin/plugin_test.go @@ -20,7 +20,7 @@ func TestPlugin(t *testing.T) { defer os.Remove(plg) // execute entc generate and expect the plugin to be executed. - cmd = exec.Command("go", "run", "../../cmd/entc/entc.go", "generate", "--plugin", plg, "./ent/schema") + cmd = exec.Command("go", "run", "../../cmd/entc/entc.go", "generate", "--storage", "sql,gremlin", "--plugin", plg, "./ent/schema") out, err := run(cmd) require.NoError(t, err) require.Equal(t, "Boring\n", out, "printer plugin should print node names") diff --git a/entc/plugin/plugin.go b/entc/plugin/plugin.go index cd5fb4539..8c34eb488 100644 --- a/entc/plugin/plugin.go +++ b/entc/plugin/plugin.go @@ -41,6 +41,8 @@ func (f GeneratorFunc) Gen(g *gen.Graph) error { return f(g) } // and construct a *gen.Graph. The path can be either a package // path (e.g github.com/a8m/x) or a filepath. // +// The second argument is an optional config for the graph creation. +// // This function used to create a standalone plugin programs that // want to interact with the ent schemas. An example for usage: // @@ -53,7 +55,7 @@ func (f GeneratorFunc) Gen(g *gen.Graph) error { return f(g) } // ) // // func main() { -// graph, err := plugin.LoadGraph("./ent/schema") +// graph, err := plugin.LoadGraph("./ent/schema", gen.Config{}) // if err != nil { // log.Fatal(err) // } @@ -62,25 +64,25 @@ func (f GeneratorFunc) Gen(g *gen.Graph) error { return f(g) } // } // } // -func LoadGraph(path string) (*gen.Graph, error) { +func LoadGraph(path string, cfg gen.Config) (*gen.Graph, error) { plg, err := (&build.Config{Path: path}).Build() if err != nil { return nil, err } defer os.Remove(plg.Path) - schemas, err := plg.Load() if err != nil { return nil, err } - - return gen.NewGraph(gen.Config{Schema: plg.PkgPath, Package: filepath.Dir(plg.PkgPath)}, schemas...) + cfg.Schema = plg.PkgPath + cfg.Package = filepath.Dir(plg.PkgPath) + return gen.NewGraph(cfg, schemas...) } // MustLoadGraph is like LoadGraph but panics if LoadGraph returns an error. // It simplifies safe initialization of global variables holding a *gen.Graph. -func MustLoadGraph(path string) *gen.Graph { - graph, err := LoadGraph(path) +func MustLoadGraph(path string, cfg gen.Config) *gen.Graph { + graph, err := LoadGraph(path, cfg) if err != nil { panic(err) } diff --git a/go.sum b/go.sum index 62a6238ca..21b2b0145 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,12 @@ github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o=