From 798d58f02b266cd5142b936945c97af650f39b48 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Tue, 17 Dec 2019 22:55:33 +0200 Subject: [PATCH] all: use more go-ish error for constraint failures --- entc/gen/internal/bindata.go | 20 +++++----- entc/gen/template/base.tmpl | 19 +++++----- entc/gen/template/dialect/gremlin/errors.tmpl | 18 ++++----- entc/gen/template/dialect/gremlin/update.tmpl | 2 +- entc/gen/template/dialect/sql/errors.tmpl | 6 +-- entc/gen/template/dialect/sql/update.tmpl | 6 +-- entc/integration/config/ent/ent.go | 25 ++++++------ entc/integration/customid/customid_test.go | 2 +- entc/integration/customid/ent/ent.go | 25 ++++++------ entc/integration/ent/card_update.go | 4 +- entc/integration/ent/ent.go | 25 ++++++------ entc/integration/ent/filetype_update.go | 4 +- entc/integration/ent/group_update.go | 8 ++-- entc/integration/ent/groupinfo_update.go | 4 +- entc/integration/ent/node_update.go | 8 ++-- entc/integration/ent/pet_update.go | 4 +- entc/integration/ent/user_update.go | 24 ++++++------ entc/integration/gremlin/ent/card_update.go | 2 +- .../integration/gremlin/ent/comment_update.go | 2 +- entc/integration/gremlin/ent/ent.go | 37 +++++++++--------- .../gremlin/ent/filetype_update.go | 2 +- entc/integration/gremlin/ent/group_update.go | 2 +- .../gremlin/ent/groupinfo_update.go | 2 +- entc/integration/gremlin/ent/node_update.go | 2 +- entc/integration/gremlin/ent/pet_update.go | 2 +- entc/integration/gremlin/ent/user_update.go | 2 +- entc/integration/gremlin/gremlin_test.go | 38 +++++++++---------- entc/integration/idtype/ent/ent.go | 25 ++++++------ entc/integration/idtype/ent/user_update.go | 4 +- entc/integration/index_test.go | 10 ++--- entc/integration/integration_test.go | 38 +++++++++---------- entc/integration/json/ent/ent.go | 25 ++++++------ entc/integration/migrate/entv1/ent.go | 25 ++++++------ entc/integration/migrate/entv2/ent.go | 25 ++++++------ entc/integration/migrate/migrate_test.go | 2 +- entc/integration/template/ent/ent.go | 25 ++++++------ entc/integration/template/ent/user_update.go | 4 +- examples/edgeindex/ent/city_create.go | 2 - examples/edgeindex/ent/city_update.go | 4 +- examples/edgeindex/ent/ent.go | 25 ++++++------ examples/edgeindex/ent/street_create.go | 2 - examples/entcpkg/ent/ent.go | 25 ++++++------ examples/entcpkg/ent/user_create.go | 2 - examples/m2m2types/ent/ent.go | 25 ++++++------ examples/m2m2types/ent/group_create.go | 2 - examples/m2m2types/ent/user_create.go | 2 - examples/m2mbidi/ent/ent.go | 25 ++++++------ examples/m2mbidi/ent/user_create.go | 2 - examples/m2mrecur/ent/ent.go | 25 ++++++------ examples/m2mrecur/ent/user_create.go | 2 - examples/o2m2types/ent/ent.go | 25 ++++++------ examples/o2m2types/ent/pet_create.go | 2 - examples/o2m2types/ent/user_create.go | 2 - examples/o2m2types/ent/user_update.go | 4 +- examples/o2mrecur/ent/ent.go | 25 ++++++------ examples/o2mrecur/ent/node_create.go | 2 - examples/o2mrecur/ent/node_update.go | 4 +- examples/o2o2types/ent/card_create.go | 2 - examples/o2o2types/ent/card_update.go | 4 +- examples/o2o2types/ent/ent.go | 25 ++++++------ examples/o2o2types/ent/user_create.go | 2 - examples/o2o2types/ent/user_update.go | 4 +- examples/o2obidi/ent/ent.go | 25 ++++++------ examples/o2obidi/ent/user_create.go | 2 - examples/o2obidi/ent/user_update.go | 4 +- examples/o2orecur/ent/ent.go | 25 ++++++------ examples/o2orecur/ent/node_create.go | 2 - examples/o2orecur/ent/node_update.go | 8 ++-- examples/start/ent/car_create.go | 2 - examples/start/ent/ent.go | 25 ++++++------ examples/start/ent/group_create.go | 2 - examples/start/ent/user_create.go | 2 - examples/start/ent/user_update.go | 4 +- examples/traversal/ent/ent.go | 25 ++++++------ examples/traversal/ent/group_create.go | 2 - examples/traversal/ent/pet_create.go | 2 - examples/traversal/ent/user_create.go | 2 - examples/traversal/ent/user_update.go | 8 ++-- 78 files changed, 422 insertions(+), 440 deletions(-) diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index 572878d10..1f5190055 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -121,7 +121,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _templateBaseTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x57\x5f\x6f\xdc\x36\x0c\x7f\x3e\x7f\x0a\xc2\xb8\x0e\x76\x71\x91\xd3\xbc\xad\x40\x1f\xd2\xac\x19\x02\x6c\xd9\x80\x74\xe8\x43\x51\x14\x8a\x4d\xdb\xc2\xd9\x92\x2b\xc9\x49\x0e\x86\xbf\xfb\x40\xc9\xf6\xf9\xfe\xe4\x4f\xbb\xee\xe5\x70\x16\x25\xf2\x47\xf2\x47\x52\xea\xba\xe4\x75\x70\xa1\x9a\x8d\x16\x45\x69\xe1\xec\xf4\xcd\xaf\x27\x8d\x46\x83\xd2\xc2\x25\x4f\xf1\x56\xa9\x35\x5c\xc9\x94\xc1\x79\x55\x81\xdb\x64\x80\xe4\xfa\x0e\x33\x16\x7c\x2c\x85\x01\xa3\x5a\x9d\x22\xa4\x2a\x43\x10\x06\x2a\x91\xa2\x34\x98\x41\x2b\x33\xd4\x60\x4b\x84\xf3\x86\xa7\x25\xc2\x19\x3b\x1d\xa5\x90\xab\x56\x66\x81\x90\x4e\xfe\xc7\xd5\xc5\x87\xeb\x9b\x0f\x90\x8b\x0a\x61\x58\xd3\x4a\x59\xc8\x84\xc6\xd4\x2a\xbd\x01\x95\x83\x9d\x19\xb3\x1a\x91\x05\xaf\x93\xbe\x0f\x82\xae\x83\x0c\x73\x21\x11\xc2\x5b\x6e\x30\x84\x61\x71\xd9\xac\x0b\x78\xfb\x0e\x68\x11\x96\xec\x42\xc9\x5c\x14\xec\x6f\x9e\xae\x79\x81\xb4\xa9\xeb\xc0\x62\xdd\x54\xdc\x22\x84\x25\xf2\x0c\x75\x08\xcb\xf1\xf8\x56\x24\xea\x46\x69\x3b\x8a\x92\x04\xfe\xd2\xe4\x19\x6f\x9a\x4a\xa0\x01\x2e\x41\xd1\x82\x90\x05\x28\x09\x28\x6c\x89\x1a\x0a\xcd\x9b\x12\xac\xe6\x77\xa8\x0d\xaf\x40\x69\x30\xdf\x2a\x30\x58\x39\x8f\x58\x60\x37\x0d\x0e\x9a\xf2\x56\xa6\x11\x21\x66\x37\x56\x69\x5e\x20\x7b\xdf\x8a\x8a\x24\x7d\x1f\x3b\x30\x9a\xcb\x02\x61\x99\xaf\x60\xe9\x6c\x91\x5f\xfe\x4f\xdf\x07\x0b\x3a\x9a\xc3\x3b\x68\xb8\x49\x79\x45\xff\x69\x35\x49\xc0\x0b\xfa\x7e\xc2\x4a\x91\x2d\xc4\x1d\x4a\xc8\x05\x56\x99\xa1\x68\x77\x1d\xb4\x4d\x83\x7a\xd8\xea\xd4\xb2\x60\x41\xa0\x26\x05\xd1\xb0\x9d\x31\x66\x2c\x79\x1a\x0f\xd0\xbb\x60\xb1\xe8\xba\x13\xb8\x17\xb6\x04\x7c\xb0\x28\x33\x88\x84\xcc\xf0\x01\x96\xec\x5a\x65\x68\xe0\x34\x86\xf0\xb2\x95\x69\x48\xaa\x42\x77\x2c\x1c\xdd\x38\x21\xa0\x0b\xe7\x80\xad\x9b\x8a\xdc\x6a\xb4\x90\x36\x87\x30\x13\x9c\x42\x95\xbc\x32\x89\x1a\xce\x8c\xe1\x01\x7f\x4a\xa3\x6d\xb5\xc3\xff\x30\x25\xcb\xab\x61\x7e\x47\xd7\x01\xe1\x71\x46\x5c\xba\xe9\x6b\x64\xc7\x13\xf6\x0a\xad\xda\x26\x31\xa2\x90\xdc\xb6\x1a\xf7\x2c\x27\x09\x9c\x17\x85\xc6\x82\xec\xcd\x48\xc0\x87\x45\xa1\x24\x18\x8b\x0d\x91\xc1\xc5\x9b\xb4\x9d\xdc\x6e\xb6\x64\x48\xb6\x2c\x78\x0c\xbc\xe3\xd9\xb9\xa1\x82\xe2\xd0\x18\x6c\x33\xb5\x63\x80\xb2\xe3\xff\x28\x0d\x1a\x25\xaf\x89\x7e\x5c\x2a\x47\x3e\xff\x3b\xee\x31\x3e\x3b\x69\x6b\xac\xaa\x41\xf2\x1a\x0d\x83\x4b\xa5\x01\x1f\x78\xdd\x54\xf8\x36\x48\x92\x20\x49\x16\xbf\x13\xd0\xf7\x1b\x9f\xeb\x37\x2b\x4f\x91\xb3\x98\x91\x6c\xf2\x38\x1a\x2b\xab\xef\xd9\xb9\x99\x7f\xdd\xb4\xf5\x70\x34\x5e\x41\x68\xda\xfa\xab\xff\x0a\xe3\x15\xbc\xe0\xd4\xd9\xce\xa9\xb3\x30\xf6\x86\x6f\x52\x2e\xa3\xd4\x3e\xac\xe0\x97\xbb\x98\x80\x3a\x5e\x9e\x9b\x28\x97\xdb\x34\xac\x5c\x66\x47\x66\x6e\xb3\xd3\x05\x8e\x9c\x3e\xae\x4f\xa4\x9a\x9b\x7d\x76\x3d\xc3\xad\x7e\x5e\x95\x14\xd1\x15\x2c\x29\xc8\x97\x84\x9d\x58\xc5\x27\x0c\x53\x81\x4a\xc7\xb6\xa1\x44\xe9\xcc\x24\x7a\x96\x8a\xa9\x92\xc6\xee\x43\xec\x3a\x10\x39\x94\xdc\x7c\xdc\x05\x38\x52\xff\x99\x92\xbc\xe6\x35\x31\xdb\x01\x99\xea\x53\xce\x2a\xf2\xe9\xa2\x1a\x10\x8c\x15\x35\x75\x1b\xb9\xdf\x6e\xba\x0e\xbe\xb5\xca\xe2\xe4\xf3\x71\x1e\x2b\x17\x6c\x91\xcf\xe3\xd8\xf7\x7b\xfd\x8a\xc6\xc0\x64\x14\x79\x5a\xfa\xe2\xda\xe9\x56\x04\x20\x3a\xa2\xca\x2b\xf0\x1c\x99\x74\xec\x91\xe5\x7b\x5a\x99\x84\xf0\xd3\xa8\x3e\x9c\x9b\x7a\x59\x4f\xf3\x89\xcd\xbd\xb2\x9f\xd6\xd8\x92\x04\x3e\x68\x7d\xad\xec\x25\xcd\x57\xf0\x8a\x0c\xdc\x97\x28\xc1\xea\x0d\xf5\x08\xab\x20\x47\x9b\x96\xc0\xc1\x34\x98\x8a\x5c\xa4\x80\xd2\x0a\xbb\x01\x2e\x33\x10\x16\xee\xb9\x01\xa9\xac\x9f\xd1\xe3\x3c\xce\xb8\xe5\x34\x49\x87\xc1\x35\xb7\x62\xac\x6e\x53\x4b\xf1\xab\xf8\x2d\x56\x43\x8c\x83\x09\x8e\xd2\x20\xa8\xcf\xd4\x28\xad\xe7\x04\xfa\x45\x69\x51\xe7\x3c\x45\xe6\x8b\x3a\x42\x78\x3d\xd3\x1b\xfb\xb3\x51\x3c\x28\x24\x03\x43\x64\xf2\xda\xb2\x1b\x1f\xd4\x28\xdc\x36\x93\xb7\xf0\x6a\x86\x3c\x5c\x01\x32\x87\x28\x1e\xb0\x5c\x99\x83\xc8\x70\xb8\x55\xaa\x42\x2e\x41\xc8\x4c\xa4\xdc\x92\xa1\xfb\x12\x5d\x03\x9d\x41\xa5\x9d\xdb\x98\xb8\xc5\x01\xf5\x56\x69\x84\x5a\x7b\x51\xec\xb4\x12\xe0\xaf\x2b\x50\x6b\xa2\x00\x6a\xcd\xa2\x1d\xf7\x26\x6f\xd4\x7a\xc0\xf7\x27\x37\xeb\x09\x61\xcd\xcd\x9a\xbc\xd1\x47\x6c\xce\x37\xce\xad\x7a\xb0\x5d\xb0\x10\xf9\x1e\xae\xd8\xd1\x7b\x30\x28\x45\x45\xbc\x19\x3f\x51\xeb\x60\xce\x9d\x1b\x21\x8b\xb6\xe2\xfa\x59\xfa\x8c\xfb\x66\xf4\xa9\x95\x46\x8a\x1b\x15\x34\x3a\x26\x3d\xcf\xa2\xc9\xde\xcf\x27\xd2\xa8\xfa\x3f\x70\x69\xf4\xf2\x11\x3a\x1d\x04\xeb\x7b\x19\xb5\x8d\xe2\x3e\xa9\x46\xd5\x2f\xe6\xd5\xe4\xed\x1e\xb5\x86\xf0\x5d\xd0\x14\xd1\x5c\x48\x7b\xc9\x45\x85\x8f\xb6\x87\x54\x23\xb7\x98\xb4\x4d\x46\x8d\x87\xf2\xa8\xb4\x4f\xac\x4b\xb4\xbf\xee\x64\xa4\x74\x2e\x73\x37\x74\x14\x1a\xd2\xc9\x8c\x81\xdc\x19\xda\xb9\x6d\xac\xe0\x4e\xa8\xca\x77\x7f\x95\x03\x66\x85\xd3\xe1\xdb\x73\x2b\xc5\xb7\x16\x25\x1a\xb3\x65\xc8\x01\xec\x2d\x4d\x6a\x53\x8c\x24\x59\xdc\x6b\xde\xf8\x28\xfd\x10\x61\x8e\x18\xfa\x11\xd2\x78\x07\x66\x31\x18\x42\x40\x74\x72\x0c\xaa\x4d\x31\xf2\xe7\x1f\xe9\x30\x1f\x43\x68\xd8\x27\xcd\xdd\xa5\xfc\x11\x6e\x1f\x62\xf5\xda\xa2\x59\x13\x18\xcb\x9b\x91\x60\xe2\xec\xee\xc9\x56\xe3\x0f\x31\x77\xcf\xc1\x56\xe3\xc4\xdc\x03\x03\x2f\xe3\xef\x81\x47\x7b\x24\xa6\xa7\x2a\xe0\x43\xc3\xc7\x5e\x08\x44\x10\x47\x45\x28\x2a\x75\xcb\x2b\x28\xb1\x6a\x50\x1b\x06\xee\x61\x38\x0d\xe0\xa3\xf3\xd7\x87\x79\x6f\xf6\x3e\x75\xa5\x3a\x32\x8d\x97\xc3\x99\x83\x67\xc5\xf1\x89\xef\x40\xfe\x0f\x26\x85\xbb\x71\x1e\x5c\x55\xd8\xd5\x6f\xec\x23\xd5\x90\x7f\xb3\xac\x71\x63\xa6\x54\x53\x36\x69\x21\x11\x99\x81\x5c\xab\xda\xe7\x97\x6a\xb1\xe6\xcd\x90\x4a\xda\x10\xd5\xb4\xf0\x79\x30\xd3\xf7\x5f\x7c\xf1\x75\x7d\x0c\x9f\xbf\x4c\xab\x94\x51\x43\x20\x6a\xbe\xc6\x68\x26\x58\xc1\xe9\x0a\x2a\x94\x51\x1d\xc7\xc1\x82\xde\x2a\x1e\xac\xbf\x39\xd7\x6e\x28\x19\x78\x47\x17\x46\x94\x59\x64\x56\x20\x28\xf1\xdb\xd9\x64\x82\xb9\xbb\xff\x06\x00\x00\xff\xff\xb0\x60\xbb\x5e\xaf\x10\x00\x00") +var _templateBaseTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x57\x5f\x6f\xdc\x36\x0c\x7f\x3e\x7f\x0a\xc2\xb8\x0e\x76\x71\x91\xd3\xbc\xad\x40\x1f\xd2\xac\x19\x02\x6c\xd9\x80\x74\xe8\x43\x51\x14\x8a\x4d\xdb\xc2\xd9\x92\x2b\xc9\x49\x0e\x86\xbf\xfb\x40\xc9\xf6\x39\xce\xe5\x4f\xbb\xee\xe5\x70\x16\x25\xf2\x47\xf2\x47\x52\xea\xba\xe4\x75\x70\xa6\x9a\x9d\x16\x45\x69\xe1\xe4\xf8\xcd\xaf\x47\x8d\x46\x83\xd2\xc2\x39\x4f\xf1\x5a\xa9\x2d\x5c\xc8\x94\xc1\x69\x55\x81\xdb\x64\x80\xe4\xfa\x06\x33\x16\x7c\x2c\x85\x01\xa3\x5a\x9d\x22\xa4\x2a\x43\x10\x06\x2a\x91\xa2\x34\x98\x41\x2b\x33\xd4\x60\x4b\x84\xd3\x86\xa7\x25\xc2\x09\x3b\x1e\xa5\x90\xab\x56\x66\x81\x90\x4e\xfe\xc7\xc5\xd9\x87\xcb\xab\x0f\x90\x8b\x0a\x61\x58\xd3\x4a\x59\xc8\x84\xc6\xd4\x2a\xbd\x03\x95\x83\x9d\x19\xb3\x1a\x91\x05\xaf\x93\xbe\x0f\x82\xae\x83\x0c\x73\x21\x11\xc2\x6b\x6e\x30\x84\x61\x71\xdd\x6c\x0b\x78\xfb\x0e\x68\x11\xd6\xec\x4c\xc9\x5c\x14\xec\x6f\x9e\x6e\x79\x81\xb4\xa9\xeb\xc0\x62\xdd\x54\xdc\x22\x84\x25\xf2\x0c\x75\x08\xeb\xf1\xf8\x5e\x24\xea\x46\x69\x3b\x8a\x92\x04\xfe\xd2\xe4\x19\x6f\x9a\x4a\xa0\x01\x2e\x41\xd1\x82\x90\x05\x28\x09\x28\x6c\x89\x1a\x0a\xcd\x9b\x12\xac\xe6\x37\xa8\x0d\xaf\x40\x69\x30\xdf\x2a\x30\x58\x39\x8f\x58\x60\x77\x0d\x0e\x9a\xf2\x56\xa6\x11\x21\x66\x57\x56\x69\x5e\x20\x7b\xdf\x8a\x8a\x24\x7d\x1f\x3b\x30\x9a\xcb\x02\x61\x9d\x6f\x60\xed\x6c\x91\x5f\xfe\x4f\xdf\x07\x2b\x3a\x9a\xc3\x3b\x68\xb8\x49\x79\x45\xff\x69\x35\x49\xc0\x0b\xfa\x7e\xc2\x4a\x91\x2d\xc4\x0d\x4a\xc8\x05\x56\x99\xa1\x68\x77\x1d\xb4\x4d\x83\x7a\xd8\xea\xd4\xb2\x60\x45\xa0\x26\x05\xd1\xb0\x9d\x31\x66\x2c\x79\x1a\x0f\xd0\xbb\x60\xb5\xea\xba\x23\xb8\x15\xb6\x04\xbc\xb3\x28\x33\x88\x84\xcc\xf0\x0e\xd6\xec\x52\x65\x68\xe0\x38\x86\xf0\xbc\x95\x69\x48\xaa\x42\x77\x2c\x1c\xdd\x38\x22\xa0\x2b\xe7\x80\xad\x9b\x8a\xdc\x6a\xb4\x90\x36\x87\x30\x13\x9c\x42\x95\xbc\x32\x89\x1a\xce\x8c\xe1\x01\x7f\x4a\xa3\x6d\xb5\xc3\x7f\x37\x25\xcb\xab\x61\x7e\x47\xd7\x01\xe1\x71\x46\x5c\xba\xe9\x6b\x64\xc7\x13\xf6\x0a\xad\xda\x26\x31\xa2\x90\xdc\xb6\x1a\x17\x96\x93\x04\x4e\x8b\x42\x63\x41\xf6\x66\x24\xe0\xc3\xa2\x50\x12\x8c\xc5\x86\xc8\xe0\xe2\x4d\xda\x8e\xae\x77\x7b\x32\x24\x7b\x16\x3c\x06\xde\xf1\xec\xd4\x50\x41\x71\x68\x0c\xb6\x99\xba\x67\x80\xb2\xe3\xff\x28\x0d\x1a\x25\xaf\x89\x7e\x5c\x2a\x47\x3e\xff\x3b\xee\x31\x3e\x3b\x69\x6b\xac\xaa\x41\xf2\x1a\x0d\x83\x73\xa5\x01\xef\x78\xdd\x54\xf8\x36\x48\x92\x20\x49\x56\xbf\x13\xd0\xf7\x3b\x9f\xeb\x37\x1b\x4f\x91\x93\x98\x91\x6c\xf2\x38\x1a\x2b\xab\xef\xd9\xa9\x99\x7f\x5d\xb5\xf5\x70\x34\xde\x40\x68\xda\xfa\xab\xff\x0a\xe3\x0d\xbc\xe0\xd4\xc9\xbd\x53\x27\x61\xec\x0d\x5f\xa5\x5c\x46\xa9\xbd\xdb\xc0\x2f\x37\x31\x01\x75\xbc\x3c\x35\x51\x2e\xf7\x69\xd8\xb8\xcc\x8e\xcc\xdc\x67\xa7\x0b\x1c\x39\x7d\x5c\x9f\x48\x35\x37\x4b\x76\x3d\xc3\xad\x7e\x5e\x95\x14\xd1\x0d\xac\x29\xc8\xe7\x84\x9d\x58\xc5\x27\x0c\x53\x81\x4a\xc7\xb6\xa1\x44\xe9\xcc\x24\x7a\x96\x8a\xa9\x92\xc6\x2e\x21\x76\x1d\x88\x1c\x4a\x6e\x3e\xde\x07\x38\x52\xff\x99\x92\xbc\xe4\x35\x31\xdb\x01\x99\xea\x53\xce\x2a\xf2\xe9\xa2\x1a\x10\x8c\x15\x35\x75\x1b\xb9\x6c\x37\x5d\x07\xdf\x5a\x65\x71\xf2\xf9\x30\x8f\x95\x0b\xb6\xc8\xe7\x71\xec\xfb\x45\xbf\xa2\x31\x30\x19\x45\x9e\x96\xbe\xb8\xee\x75\x2b\x02\x10\x1d\x50\xe5\x15\x78\x8e\x4c\x3a\x16\x64\xf9\x9e\x56\x26\x21\xfc\x34\xaa\x0f\xe7\xa6\x5e\xd6\xd3\x7c\x62\x73\xaf\xec\xa7\x35\xb6\x24\x81\x0f\x5a\x5f\x2a\x7b\x4e\xf3\x15\xbc\x22\x03\xb7\x25\x4a\xb0\x7a\x47\x3d\xc2\x2a\xc8\xd1\xa6\x25\x70\x30\x0d\xa6\x22\x17\x29\xa0\xb4\xc2\xee\x80\xcb\x0c\x84\x85\x5b\x6e\x40\x2a\xeb\x67\xf4\x38\x8f\x33\x6e\x39\x4d\xd2\x61\x70\xcd\xad\x18\xab\xdb\xd4\x52\xfc\x2a\x7e\x8d\xd5\x10\xe3\x60\x82\xa3\x34\x08\xea\x33\x35\x4a\xeb\x39\x81\x7e\x51\x5a\xd4\x39\x4f\x91\xf9\xa2\x8e\x10\x5e\xcf\xf4\xc6\xfe\x6c\x14\x0f\x0a\xc9\xc0\x10\x99\xbc\xb6\xec\xca\x07\x35\x0a\xf7\xcd\xe4\x2d\xbc\x9a\x21\x0f\x37\x80\xcc\x21\x8a\x07\x2c\x17\xe6\x41\x64\x38\x5c\x2b\x55\x21\x97\x20\x64\x26\x52\x6e\xc9\xd0\x6d\x89\xae\x81\xce\xa0\xd2\xce\x7d\x4c\xdc\xe2\x80\x7a\xaf\x34\x42\xad\xbd\x28\x76\x5a\x09\xf0\xd7\x0d\xa8\x2d\x51\x00\xb5\x66\xd1\x3d\xf7\x26\x6f\xd4\x76\xc0\xf7\x27\x37\xdb\x09\x61\xcd\xcd\x96\xbc\xd1\x07\x6c\xce\x37\xce\xad\x7a\xb0\x5d\xb0\x12\xf9\x02\x57\xec\xe8\x3d\x18\x94\xa2\x22\xde\x8c\x9f\xa8\x75\x30\xe7\xce\x95\x90\x45\x5b\x71\xfd\x2c\x7d\xc6\x7d\x33\xfa\xd4\x4a\x23\xc5\x8d\x0a\x1a\x1d\x93\x9e\x67\xd1\x64\xef\xe7\x13\x69\x54\xfd\x1f\xb8\x34\x7a\xf9\x08\x9d\x1e\x04\xeb\x7b\x19\xb5\x8f\xe2\x92\x54\xa3\xea\x17\xf3\x6a\xf2\x76\x41\x2d\x02\x7b\x46\x23\x44\x73\x21\xad\x0f\xe4\x23\xb9\x4d\x35\x72\x8b\x49\xdb\x64\xd4\x74\x28\x87\x4a\xfb\xa4\xba\x24\xfb\xab\x4e\x46\x0a\xe7\x32\x77\x3b\x47\xa1\x21\x9d\xac\x18\xc8\xb9\xa8\x30\xbb\x77\xd3\xd8\xc0\x8d\x50\x95\xef\xfc\x2a\x07\xcc\x0a\xd2\x41\xda\x7c\x77\x6e\xa5\xf8\xd6\xa2\x44\x63\x06\x82\x2c\x51\xef\x19\x52\x9b\x62\xe4\xc7\xea\x56\xf3\xc6\x07\xe8\x87\xb8\xb2\x30\xf2\x23\x5c\xd9\xfb\x3d\xb8\x4d\xf4\x71\x8c\xa9\x4d\x31\xf2\xe5\x1f\xe9\x80\x1e\x82\x65\xd8\x27\xcd\xdd\x25\xfc\x10\x97\x1f\x00\xf4\x9a\xa2\x59\xc1\x8f\xa5\xcc\x48\x30\xf1\xf3\xb1\xa4\x7f\x0f\x47\x17\xae\xb5\x1a\x27\x8e\x2e\xd4\xbf\x80\xa7\x4b\x4f\x16\x44\xa5\xe7\x28\xe0\x5d\xc3\xc7\x7e\x07\xc4\x02\x47\x39\x28\x2a\x75\xcd\x2b\x28\xb1\x6a\x50\x1b\x06\xee\xf1\x37\x0d\xd9\x83\x33\xd6\x87\x76\x31\x5f\x9f\xba\x36\x1d\x98\xb8\xeb\xe1\xcc\x83\xa7\xc3\xe1\xa9\xee\x40\xfe\x0f\x26\x85\xbb\x55\x3e\xb8\x8e\xb0\x8b\xdf\xd8\x47\x2a\x14\xff\x2e\xd9\xe2\xce\x4c\x49\xa6\x3c\xd2\x42\x22\x32\x03\xb9\x56\xb5\xcf\x2c\xd5\x5c\xcd\x9b\x21\x89\xb4\x21\xaa\x69\xe1\xf3\x60\xa6\xef\xbf\xf8\x2a\xeb\xfa\x18\x3e\x7f\x99\x56\x29\x9b\x86\x40\xd4\x7c\x8b\xd1\x4c\xb0\x81\xe3\x0d\x54\x28\xa3\x3a\x8e\x83\x15\xbd\x47\x3c\x58\x7f\x3b\xae\xdd\xe0\x31\xf0\x8e\x2e\x85\x28\xb3\xc8\x6c\x40\xd0\xf0\xdb\xcf\x1f\x13\xcc\xdd\xfd\x37\x00\x00\xff\xff\xf7\x54\xf4\xde\x93\x10\x00\x00") func templateBaseTmplBytes() ([]byte, error) { return bindataRead( @@ -136,7 +136,7 @@ func templateBaseTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/base.tmpl", size: 4271, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/base.tmpl", size: 4243, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -381,7 +381,7 @@ func templateDialectGremlinDeleteTmpl() (*asset, error) { return a, nil } -var _templateDialectGremlinErrorsTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x54\xc1\x6e\xdc\x36\x10\x3d\x5b\x5f\xf1\xb2\x8d\x03\x69\xab\x6a\x9d\xdc\xea\xc2\x87\x60\xbb\x6e\x03\x14\x46\xda\x24\x27\xc3\x07\xae\x38\xd2\x12\xa6\xc8\xcd\x90\x52\x6a\x2c\xf4\xef\x05\x49\x69\xeb\xda\x1b\x34\x87\xdc\x04\xce\xf0\xbd\x79\x8f\x4f\x73\x38\xac\x96\xd9\xda\xee\x1f\x58\xb5\x3b\x8f\x37\x17\xaf\x7f\xfe\x69\xcf\xe4\xc8\x78\x5c\x8b\x9a\xb6\xd6\xde\xe3\x9d\xa9\x2b\xbc\xd5\x1a\xb1\xc9\x21\xd4\x79\x20\x59\x65\x1f\x77\xca\xc1\xd9\x9e\x6b\x42\x6d\x25\x41\x39\x68\x55\x93\x71\x24\xd1\x1b\x49\x0c\xbf\x23\xbc\xdd\x8b\x7a\x47\x78\x53\x5d\xcc\x55\x34\xb6\x37\x32\x53\x26\xd6\xff\x78\xb7\xde\xdc\x7c\xd8\xa0\x51\x9a\x30\x9d\xb1\xb5\x1e\x52\x31\xd5\xde\xf2\x03\x6c\x03\xff\x88\xcc\x33\x51\x95\x2d\x57\xe3\x98\x65\x41\x03\xea\xde\x79\xdb\x81\x98\x2d\x3b\x08\x23\xe7\xcf\x9d\x30\x52\x13\x3b\x34\x6c\x3b\xb8\xcf\x1a\x52\x09\x4d\xb5\x77\x88\xd7\x0f\x07\x48\x6a\x94\x21\x2c\xa6\xc2\xaa\x65\xea\xb4\x32\xab\x84\xb0\x40\xea\x7a\xb9\xbf\x6f\x71\x79\x85\xad\x70\x84\x97\xd5\xda\x9a\x46\xb5\xd5\x7b\x51\xdf\x8b\x96\x42\x4f\xb6\x5a\x61\x1d\x4d\xe8\xf6\x9a\x3a\x32\xde\x45\x25\xd2\xe9\xea\x26\x9e\x1b\x4f\xdc\x88\x9a\xaa\xac\xe9\x4d\x8d\x9c\xb0\x61\x5e\x5b\xe3\x3c\x0b\x65\xfc\xb5\x50\x9a\x64\x11\x41\xf2\x02\xb9\xf3\xac\x4c\x5b\xe2\xf6\xee\x78\xf3\x30\x16\x38\x64\x67\x4c\xbe\x67\x03\xe7\xb9\xb6\x66\xa8\xfe\xec\xad\xa7\x9c\xaa\x3d\x53\xa3\xfe\xce\x0b\xfc\x08\xaa\x3a\xd7\x16\x25\x8c\xd2\xd9\x98\x1d\xf9\x96\x27\x09\x3f\x99\x4e\xb0\xdb\x09\xfd\x1b\x8b\xfd\xce\x59\x93\x6f\x71\x7b\xb7\x7d\xf0\x54\x24\x1b\x03\xe7\x20\x18\x03\x6e\x5f\xdf\x2d\xd3\x5c\xd9\x99\x6a\x42\x35\x78\xd2\x4e\xf7\xaa\x23\x52\xbe\x2d\xf1\x6a\x28\x7e\x89\x1d\x2f\xae\xc2\x1c\x01\x64\x9e\x9c\x98\xb3\xb3\x31\x42\x0c\xb7\x17\x77\xb8\x7a\xd6\xd1\x74\xbe\xda\x04\xee\x26\x5f\xcc\xee\x8f\xe3\x25\x3a\xe5\x9c\x32\x2d\xd2\x10\x18\x84\xee\x69\x51\xcc\x60\x2f\xd2\xb1\xab\x7e\x17\xee\x7d\x72\x63\x19\x08\x4a\xfc\xeb\x4e\xf1\x2d\x34\xca\x0c\x42\x2b\x39\xd3\x34\x96\x93\x13\x97\x38\x77\x8b\x12\x11\x34\xb1\x46\xa7\x71\x85\x99\xf9\x23\xab\xee\xab\xd4\xc7\xa7\x9b\xde\x65\xb5\x42\xaa\x21\x9d\xa7\xc4\x4c\x47\x7d\xf8\x8b\x02\xf3\x14\x48\xd4\xe1\xe5\x84\xf1\x6e\x0e\xd0\xc9\xd7\x3c\xa6\x60\x9a\xfd\x30\x61\x63\xb1\x49\x0a\x16\x48\xcc\x37\xf4\x65\xc3\xfc\xc9\xa8\xcf\x3d\x5d\x2b\xd2\x12\x35\x93\xf0\xe4\x20\x12\x55\x84\x9d\x12\x10\xe6\xe8\x63\x2b\x9a\xd0\x3b\xcf\xf0\x0c\x24\xd7\x62\x4b\xba\x4c\x5d\x98\x33\x3c\xe0\x3f\x19\x3e\x95\xc3\x47\xc1\x7e\x75\xa2\x7c\xe8\x5c\x7b\x19\xdf\xeb\xc3\x9e\x95\xf1\x4d\xbe\x48\x14\xe7\xae\x3a\x77\xf8\xa2\xfc\x2e\xa5\xe1\x12\xe7\x3f\x0c\x8b\x12\x8f\xe7\x28\x31\x14\x63\xf6\x5c\xf6\x46\xb6\xf4\x8d\xaa\x49\xb6\x74\x4a\x74\x80\x98\x35\x87\x9e\x12\xc7\xd8\x7c\x2f\x9d\x01\xf6\xb1\x4c\x25\x9f\x68\x9c\x79\x8f\x1a\x95\x5b\x4f\x59\x89\x6f\x0e\x65\xa4\xaa\xa3\x48\xd5\xc4\x88\xb5\x6a\x20\x13\x36\xf9\xde\x86\x75\xbc\xb3\x5a\x06\x03\x9e\x26\x2d\x7c\x78\xa1\x4c\xc8\x91\x30\xc9\x94\xc9\x83\x27\x14\x39\x63\x39\xdd\xae\xfe\x9a\x60\x0b\xe4\xa7\x0c\x28\xb1\xb5\x56\xc7\xdf\x90\xc2\xf6\x38\xe9\xc2\xf8\x3f\xfb\x85\x03\x4b\xaf\x7d\xf5\xab\xf0\xa2\x04\x7d\x75\xd5\x18\x15\x42\x20\xb4\xa3\xf8\xbb\xce\x0b\xa8\x84\xe7\x9e\xb2\xb8\xda\xc9\x48\x8c\xe3\x3f\x01\x00\x00\xff\xff\xe3\x20\x22\xd9\x0c\x07\x00\x00") +var _templateDialectGremlinErrorsTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x54\xc1\x8e\xdb\x36\x10\x3d\x47\x5f\xf1\xe2\x66\x03\xc9\x55\xe5\x4d\x6e\x75\xb1\x87\xc0\x75\xda\x00\xc5\x22\x6d\x92\xd3\x62\x0f\xb4\x38\x92\x89\xa5\x48\x67\x48\x29\x5d\x18\xfa\xf7\x82\xa4\xe4\x6e\xed\x06\x0d\xd0\x9b\x30\x33\x7c\x6f\xde\xcc\xd3\x1c\x8f\xab\x65\xb6\xb1\x87\x47\x56\xed\xde\xe3\xf5\xf5\xab\x1f\x7f\x38\x30\x39\x32\x1e\x6f\x45\x4d\x3b\x6b\x1f\xf0\xce\xd4\x15\xde\x68\x8d\x58\xe4\x10\xf2\x3c\x90\xac\xb2\x8f\x7b\xe5\xe0\x6c\xcf\x35\xa1\xb6\x92\xa0\x1c\xb4\xaa\xc9\x38\x92\xe8\x8d\x24\x86\xdf\x13\xde\x1c\x44\xbd\x27\xbc\xae\xae\xe7\x2c\x1a\xdb\x1b\x99\x29\x13\xf3\xbf\xbd\xdb\x6c\x6f\x3f\x6c\xd1\x28\x4d\x98\x62\x6c\xad\x87\x54\x4c\xb5\xb7\xfc\x08\xdb\xc0\x3f\x21\xf3\x4c\x54\x65\xcb\xd5\x38\x66\x59\xd0\x80\xba\x77\xde\x76\x20\x66\xcb\x0e\xc2\xc8\xf9\x73\x2f\x8c\xd4\xc4\x0e\x0d\xdb\x0e\xee\xb3\x86\x54\x42\x53\xed\x1d\xe2\xf3\xe3\x11\x92\x1a\x65\x08\x8b\x29\xb1\x6a\x99\x3a\xad\xcc\x2a\x21\x2c\x90\xaa\x5e\x1c\x1e\x5a\xac\x6f\xb0\x13\x8e\xf0\xa2\xda\x58\xd3\xa8\xb6\x7a\x2f\xea\x07\xd1\x52\xa8\xc9\x56\x2b\x6c\xe2\x10\xba\x83\xa6\x8e\x8c\x77\x51\x89\x74\xba\xba\x8d\x71\xe3\x89\x1b\x51\x53\x95\x35\xbd\xa9\x91\x13\x36\xd6\x38\xcf\x42\x19\xbf\x0d\x64\x45\x04\xc8\x0b\xe4\xce\xb3\x32\x6d\x89\xbb\xfb\xd3\xab\xe3\x58\xe0\x98\x3d\x63\xf2\x3d\x1b\x38\xcf\xb5\x35\x43\xf5\x7b\x6f\x3d\xe5\x54\x1d\x98\x1a\xf5\x67\x5e\xe0\x7b\x50\xd5\xb9\xb6\x28\x61\x94\xce\xc6\xec\xc4\xb5\xbc\x20\xfb\x64\x3a\xc1\x6e\x2f\xf4\x2f\x2c\x0e\x7b\x67\x4d\xbe\xc3\xdd\xfd\xee\xd1\x53\x91\xc6\x17\xf8\x06\xc1\x18\x70\xf7\xea\x7e\x99\x7a\xca\x9e\xa9\x26\x64\xc3\x2c\xda\xe9\x5d\x75\x42\xca\x77\x25\x5e\x0e\xc5\x4f\xb1\xe2\xf9\x4d\xe8\x21\x80\xcc\x5d\x13\x73\xf6\x6c\x8c\x10\xc3\xdd\xf5\x3d\x6e\x2e\x2a\x9a\xce\x57\xb1\xbd\x26\x5f\xcc\x53\x1f\xc7\x35\x3a\xe5\x9c\x32\x2d\x52\x13\x18\x84\xee\x69\x51\xcc\x60\xcf\x53\xd8\x55\xbf\x0a\xf7\x3e\x4d\x62\x19\x08\x4a\xfc\x3d\x99\xe2\x5b\x68\x94\x19\x84\x56\x72\xa6\x69\x2c\xa7\x49\xac\x71\xe5\x16\x25\x22\x68\x62\x8d\x53\xc6\x0d\x66\xe6\x8f\xac\xba\xaf\x52\x9f\xd6\x36\xed\x64\xb5\x42\xca\x21\xc5\x93\x53\xa6\x50\x1f\xfe\x9e\xc0\x3c\x19\x11\x75\x58\x9c\x30\xde\xcd\xc6\xb9\xd8\xe4\x69\xfb\x53\xdf\xc7\x09\x17\x8b\x6d\xea\x7e\x81\xc4\x7a\x4b\x5f\xb6\xcc\x9f\x8c\xfa\xdc\xd3\x5b\x45\x5a\xa2\x66\x12\x9e\x1c\x44\xa2\x89\xa8\xd3\xf6\x43\x0f\x7d\x2c\x45\x13\x6a\x67\xfe\x0b\x90\x5c\x8b\x1d\xe9\x32\x55\x61\xf6\xee\x80\x7f\x78\xf7\xdc\x7f\x4f\xcc\xfc\xf2\x2c\x75\xec\x5c\xbb\x8e\x3b\xfa\x70\x60\x65\x7c\x93\x2f\x12\xf4\x95\xab\xae\x1c\xbe\x28\xbf\x4f\x0e\x58\xe3\xea\xbb\x61\x51\xe2\x29\x7f\x89\xa1\x18\xb3\x4b\xb9\x5b\xd9\xd2\x37\xaa\x25\xd9\xd2\xbf\x89\x0d\x10\xb3\xd6\x50\x53\xe2\x64\x95\xff\xab\x2f\xc0\x3d\x95\xa7\xe4\x99\xb6\x99\xef\xa4\x4d\xb9\xcd\xe4\x8b\x44\xa7\x8c\x54\x75\x14\xa7\x9a\x68\xa7\x56\x0d\x64\xc2\xb5\x3e\xd8\x70\x72\xf7\x56\xcb\x20\xfc\xdc\x55\xe1\xc3\x0b\x65\x82\x6f\x84\x49\xc3\x98\xb4\x9f\x51\xe4\x8c\xe5\xf4\xba\xfa\x63\x82\x2d\x90\x9f\x0b\x2f\xb1\xb3\x56\xc7\xdf\x8d\xc2\x95\xb8\x50\x3f\xfe\xc7\x0d\xe1\x80\xde\x6b\x5f\xfd\x2c\xbc\x28\x41\x5f\x3d\x27\x46\x85\xa5\x0b\xed\x28\xfe\x92\xf3\x91\x29\xe1\xb9\xa7\x2c\x9e\x6d\x32\x12\xe3\xf8\x57\x00\x00\x00\xff\xff\x8a\x8f\xb8\xc0\xe8\x06\x00\x00") func templateDialectGremlinErrorsTmplBytes() ([]byte, error) { return bindataRead( @@ -396,7 +396,7 @@ func templateDialectGremlinErrorsTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/errors.tmpl", size: 1804, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/errors.tmpl", size: 1768, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -541,7 +541,7 @@ func templateDialectGremlinSelectTmpl() (*asset, error) { return a, nil } -var _templateDialectGremlinUpdateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x58\xdf\x73\xdb\x36\xf2\x7f\xa6\xfe\x8a\xfd\x6a\x94\x0c\xe9\xaf\x0a\x3b\x7d\x3b\x77\x7c\x33\xa9\xa3\x5c\x75\xd3\xb3\xd3\xc8\xed\x3d\x64\x32\x1a\x98\x5c\x4a\x18\x53\x00\x0b\x80\x8c\x7d\x1a\xfe\xef\x37\xf8\x41\x12\xa4\x64\xc7\x49\x7a\xed\x8b\x2d\x02\xcb\xdd\xfd\xec\x7e\x76\xb1\xc4\x7e\x7f\x7a\x32\xb9\x14\xe5\x83\x64\x9b\xad\x86\xef\xcf\x5e\xfd\xed\xbb\x52\xa2\x42\xae\xe1\x2d\x4d\xf1\x56\x88\x3b\x58\xf2\x94\xc0\xeb\xa2\x00\x2b\xa4\xc0\xec\xcb\x1a\x33\x32\xb9\xd9\x32\x05\x4a\x54\x32\x45\x48\x45\x86\xc0\x14\x14\x2c\x45\xae\x30\x83\x8a\x67\x28\x41\x6f\x11\x5e\x97\x34\xdd\x22\x7c\x4f\xce\xda\x5d\xc8\x45\xc5\xb3\x09\xe3\x76\xff\xe7\xe5\xe5\xe2\x6a\xb5\x80\x9c\x15\x08\x7e\x4d\x0a\xa1\x21\x63\x12\x53\x2d\xe4\x03\x88\x1c\x74\x60\x4c\x4b\x44\x32\x39\x39\x6d\x9a\xc9\x64\xbf\x87\x0c\x73\xc6\x11\xa6\x19\xa3\x05\xa6\xfa\x74\x23\x71\x57\x30\x7e\x5a\x95\x19\xd5\x38\x85\xa6\x31\x52\xb3\xdb\x8a\x15\xc6\xa7\xf3\x0b\x28\xa9\x4a\x69\x01\x33\xb2\x4a\x45\x89\xe4\x47\xbf\xe3\x05\x25\xa6\xc8\x6a\x27\xd9\xfd\xee\x5e\xf7\x42\x82\xa3\xd9\xdf\x52\xb5\xaa\xf2\x9c\xdd\xf7\x02\xd3\x6b\xde\x1b\xfd\x0f\x4a\x61\xe4\xce\xa0\x69\xf6\x7b\x60\xb9\x7b\xd3\x3e\xb8\xcd\x0b\x98\x72\x56\x4c\xdd\x12\xf2\xcc\xbc\x39\xc9\x2b\x9e\x42\x3c\x70\xa6\x69\xe0\x24\x84\xd1\x34\x09\x78\xa4\x2b\x5a\x63\x9c\xea\x7b\x48\x05\xd7\x78\xaf\xc9\xa5\xfb\x9f\x18\x15\xdf\x05\x46\xad\x02\x72\x45\x77\xde\x03\x2c\x94\xf9\xc5\xb8\xee\x6c\xcf\x01\xa5\x14\x32\x81\xfd\x24\x92\xa8\x8c\xef\x2f\xbd\x19\xf2\x1e\x55\x29\xb8\xc2\x7d\x33\x89\x7e\xaf\x50\x3e\xcc\xe1\x96\xf1\x8c\xf1\x8d\x95\x1b\xb9\x4b\xfc\x6b\x23\x1f\xc6\x52\x2c\xeb\x6c\x27\xe4\x17\xa3\x35\x4e\x26\x11\xcb\x8d\x1f\xc7\xb4\x66\xd2\xfc\x22\x8b\x7b\x4c\x0d\xe6\x39\x8c\x3c\x99\x1b\x86\x26\x3f\xd8\xd7\xff\xef\x02\x38\x2b\x0c\x94\x48\xa2\xae\x24\x87\x2e\xec\x1e\xe9\x24\x6a\x5a\x63\x73\x10\x77\xc6\x20\x53\x97\x82\x2b\x4d\xb9\x5e\x98\x48\xc4\x4e\x9d\xb8\xfb\xac\x9a\x21\xce\x49\x64\x17\x66\x16\xc4\x8c\xbc\xef\x21\xd8\x1d\xb3\xd1\x34\x36\xbc\x83\xa4\xa4\x82\xe7\x6c\x73\x7e\x00\xdb\xad\x9b\x77\x47\xa1\x31\x9b\x6f\xa5\xd8\xb5\xc9\x89\x8f\xc2\x6f\x1d\xe7\xac\xf0\x0e\x1b\x8f\x43\x38\xd2\x62\xe1\xac\x70\x40\x3c\x35\x7a\x19\x89\x8a\xbc\x47\x9a\x2d\xb9\x36\x09\xb2\x32\x8e\xad\x5f\xcc\xd7\x78\x50\x09\x2c\xb3\xf6\xc9\xf2\x0d\xb9\x79\x28\x31\x2c\x84\x04\x4e\x32\x55\x90\x1b\x49\x6b\x94\x8a\x5a\x28\xc6\xf0\x27\xa6\xb7\x40\xae\xaa\x9d\xcd\x94\xa4\x8c\x6b\xe7\xab\x36\x0a\xd2\x7e\x51\x69\x59\xa5\xda\x45\xa0\x94\x98\x8d\xf5\x9d\x9e\x86\xd2\x46\x82\xa5\x54\x23\x31\xf2\x1a\x95\x3e\x22\x6f\x97\x77\x54\xa7\x5b\x54\x40\x79\x06\x4c\x2b\xa7\x84\x72\x4d\x7c\x5c\x7b\xa5\xb6\x32\x76\xf4\x0e\xe3\x0f\x1f\x4f\xfa\xe5\x39\x9c\xcd\x0d\x6c\x62\x50\x0e\xa2\x69\x7f\x9f\x9e\x40\x4a\x15\x9a\xc6\xe7\xba\x18\xa8\x12\x53\x96\xb3\x14\x6a\x94\x1a\xef\xc1\x76\xbf\x43\xca\xd5\xc6\xdc\x86\xfc\x16\xb3\x2c\xe9\x54\x6d\x90\xa3\xa4\x45\xab\x2a\x17\x12\xae\xac\x1e\x96\xa2\x0a\x34\xf5\x39\xef\xd4\x24\xe4\x27\xaa\x7e\xa6\xb7\x58\xd8\xec\x92\x77\x34\xbd\xa3\x1b\x23\x45\xec\x6a\x32\x89\x22\xa3\x6f\x3d\x87\xd2\xf6\x4b\xca\x37\x78\x40\xde\x2e\xb0\xca\xa7\x22\xae\x13\x17\xa9\x10\x78\x4d\x25\xc4\xae\x38\x58\x0e\x42\x8e\x33\x1c\x17\xc8\x61\x46\x16\xd9\x06\x55\xe2\xfc\x8c\x64\x0d\x17\x50\x93\xcb\x42\x70\x34\xb4\x8c\xa2\x35\x5c\x80\xac\x9d\x9a\x56\x73\xa4\xa5\x82\x0f\x1f\x87\xc9\x9c\x44\x3e\x42\xce\xe7\xd9\x7a\x0e\xb3\xdc\x15\xeb\x5b\x86\x45\xa6\xfa\x22\x76\xee\xc4\x5c\x68\x98\xe5\x64\xb9\xdb\x55\x9a\xde\x16\x98\x98\xa7\x5f\x6d\x50\xdf\x60\x4e\xab\xc2\xb3\xd0\x94\x68\x4d\x8b\x0a\x8f\xf5\x2f\xf3\x9c\xb7\x47\x8e\x35\x04\x4d\xf3\x83\x97\x0f\x2b\xb6\x4b\x6e\x4e\x7e\xe5\xec\xf7\xca\xa7\x26\x1a\xb2\xeb\x02\x68\x59\x22\xcf\xe2\x60\x71\x0e\x2f\xfb\x27\xa7\xcb\xd1\xff\xbc\xcf\xe9\xf1\x74\xce\x61\xbc\xec\xdc\x6d\x3b\xa2\xed\x11\x27\xd6\xd7\x84\x5c\x8a\xca\xf4\x82\xb9\x37\x60\x0a\xe3\x1c\xd6\x6b\xb2\x54\x71\x49\xae\x16\xbf\xc4\x67\x49\xd2\xbd\x19\x5f\xe1\xa7\x85\x94\x0e\x89\x85\xfd\xed\x1e\xb4\xa6\x9b\xa4\x8b\x57\x97\xf1\x28\xaa\xc9\x3b\x29\x4a\x94\xfa\x21\x36\x79\x5f\x31\xbe\x29\xf0\x4b\xd4\x1b\x2d\x56\x55\x9f\x08\xd3\xa0\x0c\x2b\x51\xb2\xb4\xb5\xf3\x54\xb2\x69\x96\x3d\x3f\xdf\x8f\x27\x3c\xa2\x59\xf6\x5b\x6b\x43\x76\x74\x37\x62\x82\xc7\xeb\x35\xb1\x9b\x87\x39\x3d\xc0\x96\xcc\x4d\x82\xba\x9c\xb4\x71\x24\xab\x6a\x17\x27\xe4\x0a\xef\xb5\x2b\xa2\xaf\x25\xd9\x1f\xc8\xb2\x16\xf2\x01\xcf\xfe\x4c\xa2\xe5\x3b\x4d\x56\xa5\x64\x5c\xe7\xf1\xf4\xff\x2f\xe0\x45\x3d\xed\xd9\xd7\x79\xe4\xf9\x37\x26\xe0\x37\x30\x70\xbd\xfe\x83\x73\xeb\x3c\xec\xd8\xdc\x79\x39\x3e\x78\xc6\x87\x50\x81\x54\x82\x28\x35\x13\x9c\x16\x90\xdb\xbe\x48\x82\x23\xc3\x9e\xc4\x33\x93\xea\xeb\x56\xc8\x1d\x20\x54\x42\xe9\xc0\x33\x34\xbd\x97\x71\x8d\x32\xa7\xa9\x1d\x1e\x9f\xd1\x76\x83\x62\x18\x6a\xb6\x05\x77\x30\x1d\x19\x3f\x8f\x56\x5a\x5b\x5b\x81\x33\x1d\x9b\xfb\xb5\x67\x24\xe5\x39\x11\x34\xae\x15\xc8\x03\xc5\x09\xfc\x1d\xce\x9c\x0f\x35\x59\xb1\x0c\x17\x79\x8e\xa9\x36\x79\x7d\xd7\x09\x05\xf2\x84\x90\x84\xbc\x91\xa2\x74\x29\x3b\x92\x95\x20\x6c\xe8\xc2\x66\x0f\xc4\x60\xe2\x74\xdf\x4d\x4c\x70\xb3\x3d\x5d\xf2\x69\xb0\xc7\xcd\x98\x69\xbe\x80\x2c\xa7\x61\xfa\x42\x91\x17\x6a\x1a\x40\x9f\x61\x08\xba\x3f\xff\x66\x48\x96\x6a\xc9\xcd\xd1\x89\x41\x86\x02\x63\x17\x30\xbd\xae\xf4\x34\xdc\xb4\xd6\x0e\x8d\xa1\xeb\xa3\x4f\x9a\x1c\xc4\xf7\xf4\x04\x24\xee\x44\x8d\x80\x16\xab\xe3\x5f\xe0\x5a\xd8\x2f\x1f\xa3\x07\xda\x56\x8c\x64\x65\x67\xc2\x01\x3f\x86\xc3\x8f\x99\x67\x58\xf6\xf8\x34\xe3\x5c\xf9\x8c\xb6\xd0\x7d\xe7\xe3\x0a\x8b\xfc\x3d\xe6\x3e\x3e\x5a\x8e\x7a\xf9\x8f\x42\x6f\x17\xb6\xca\xb9\xfb\x14\x48\xdc\x1c\x64\x87\x8e\x00\x21\xf9\xf7\x16\x25\x1a\x02\x5d\x4b\xf3\x77\xc9\x7d\xaf\x5d\xbe\x31\x43\x9f\x6d\x02\xd7\x95\x1e\x2c\x26\x49\x37\x0c\x79\x72\x91\xa5\x46\x49\xb5\x9b\x99\x3a\xf8\xc7\xf3\x7c\xe0\xea\x92\x7f\xa1\xa3\x7a\x8b\x72\xe8\xd0\xf3\xfc\x79\xc4\xfe\x75\xa5\xff\x04\x07\xba\x46\x6e\x86\xc7\xae\x67\x68\xa9\xe6\xa0\xa5\x2f\xce\x96\x9d\x7e\xb2\x1e\xb0\xf3\x73\x34\x72\xfc\x39\xd6\xae\x1e\x2f\xb9\x9a\xbc\xce\xb2\x21\x76\xfb\xf1\x17\xfb\x91\x3f\x71\x74\x38\x8c\xe1\xb1\x17\x6f\x44\xff\x9a\x63\xcc\xe3\xe4\xfd\x89\xaa\xf1\xb7\xd6\xa3\xd4\xfe\xaa\xd1\xc1\x0d\x0e\xa3\x7a\x18\xfa\x3b\x9c\x03\xbe\x60\x0a\x30\x0d\xf2\xa9\x21\xc0\x5b\x98\x83\x09\x85\x53\xef\xdb\xfd\xd7\x23\xd9\x90\xc5\xf8\xe3\xa9\x03\xf2\x55\x15\xfc\x17\xc0\x1f\x71\xe8\x7f\x14\x0d\xf3\xd0\x9f\x22\x4d\x33\xc0\xfd\x57\xa1\x3e\x7a\xba\x1f\x9c\xc6\xc1\xb7\x77\xed\xe6\xb4\x7f\xd1\x32\xd6\xb2\xc2\xa4\xbf\x5d\xab\x5b\x0c\xc1\x07\xe9\x93\x97\x18\x7e\x88\x08\x02\x1b\x4c\x11\xbe\xe1\xec\xe8\x1d\x82\xaa\x24\xda\xeb\x52\xdd\x5d\x50\x64\x02\x95\x6d\x84\xa9\xe0\x9a\x32\x0e\x3b\x61\x65\x28\x07\xe3\xa7\xbf\x3c\x60\x39\x7c\x42\xd8\xd2\x7a\x70\x59\xe2\xfb\x56\x5b\xd7\xb6\x9d\x76\x17\x0b\xdf\x5a\xd5\x4f\xa4\xf1\x1f\x37\xf1\xab\x30\x8b\x2f\x17\x52\xf6\x31\x79\x4b\x59\x81\xd9\x7e\xa7\x36\xe7\x30\xf5\x7d\xb6\xc7\xeb\x61\xaa\xa3\x38\xa7\xcd\xe3\x89\x8d\x6a\xb8\x08\xc0\xab\x0f\x67\x1f\xed\x35\x05\xb9\x14\xb4\x40\x95\x62\x3c\xda\x34\x3e\xcf\xc1\xde\x5b\xb4\x37\x1e\xa9\xec\xbb\x7b\x28\xfd\xea\xfc\xa3\x1f\x3b\xad\x11\x39\x56\x2c\x07\xca\x8e\x30\xeb\xf0\xc4\x31\xa2\xfe\x22\xce\x7c\x4a\xfc\x53\x30\x6e\x36\xcc\xb8\x38\xb1\x37\xcd\xfe\xd5\xff\x06\x00\x00\xff\xff\xd8\x72\x0a\xa4\xd3\x17\x00\x00") +var _templateDialectGremlinUpdateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x58\xdf\x73\xdb\x36\xf2\x7f\xa6\xfe\x8a\xfd\x6a\x94\x0c\xe9\xaf\x0a\x3b\x7d\x3b\x77\x7c\x33\xa9\xa3\x5c\x75\xd3\xb3\xd3\xc8\xed\x3d\x64\x32\x1a\x98\x5c\x4a\x18\x53\x00\x0b\x80\x8c\x7d\x1a\xfe\xef\x37\xf8\x41\x12\xa4\x64\xc7\x49\x7a\xed\x8b\x2d\x02\xcb\xdd\xfd\xec\x7e\x76\xb1\xc4\x7e\x7f\x7a\x32\xb9\x14\xe5\x83\x64\x9b\xad\x86\xef\xcf\x5e\xfd\xed\xbb\x52\xa2\x42\xae\xe1\x2d\x4d\xf1\x56\x88\x3b\x58\xf2\x94\xc0\xeb\xa2\x00\x2b\xa4\xc0\xec\xcb\x1a\x33\x32\xb9\xd9\x32\x05\x4a\x54\x32\x45\x48\x45\x86\xc0\x14\x14\x2c\x45\xae\x30\x83\x8a\x67\x28\x41\x6f\x11\x5e\x97\x34\xdd\x22\x7c\x4f\xce\xda\x5d\xc8\x45\xc5\xb3\x09\xe3\x76\xff\xe7\xe5\xe5\xe2\x6a\xb5\x80\x9c\x15\x08\x7e\x4d\x0a\xa1\x21\x63\x12\x53\x2d\xe4\x03\x88\x1c\x74\x60\x4c\x4b\x44\x32\x39\x39\x6d\x9a\xc9\x64\xbf\x87\x0c\x73\xc6\x11\xa6\x19\xa3\x05\xa6\xfa\x74\x23\x71\x57\x30\x7e\x5a\x95\x19\xd5\x38\x85\xa6\x31\x52\xb3\xdb\x8a\x15\xc6\xa7\xf3\x0b\x28\xa9\x4a\x69\x01\x33\xb2\x4a\x45\x89\xe4\x47\xbf\xe3\x05\x25\xa6\xc8\x6a\x27\xd9\xfd\xee\x5e\xf7\x42\x82\xa3\xd9\xdf\x52\xb5\xaa\xf2\x9c\xdd\xf7\x02\xd3\x6b\xde\x1b\xfd\x0f\x4a\x61\xe4\xce\xa0\x69\xf6\x7b\x60\xb9\x7b\xd3\x3e\xb8\xcd\x0b\x98\x72\x56\x4c\xdd\x12\xf2\xcc\xbc\x39\xc9\x2b\x9e\x42\x3c\x70\xa6\x69\xe0\x24\x84\xd1\x34\x09\x78\xa4\x2b\x5a\x63\x9c\xea\x7b\x48\x05\xd7\x78\xaf\xc9\xa5\xfb\x9f\x18\x15\xdf\x05\x46\xad\x02\x72\x45\x77\xde\x03\x2c\x94\xf9\xc5\xb8\xee\x6c\xcf\x01\xa5\x14\x32\x81\xfd\x24\x92\xa8\x8c\xef\x2f\xbd\x19\xf2\x1e\x55\x29\xb8\xc2\x7d\x33\x89\x7e\xaf\x50\x3e\xcc\xe1\x96\xf1\x8c\xf1\x8d\x95\x1b\xb9\x4b\xfc\x6b\x23\x1f\xc6\x52\x2c\xeb\x6c\x27\xe4\x17\xa3\x35\x4e\x26\x11\xcb\x8d\x1f\xc7\xb4\x66\xd2\xfc\x22\x8b\x7b\x4c\x0d\xe6\x39\x8c\x3c\x99\x1b\x86\x26\x3f\xd8\xd7\xff\xef\x02\x38\x2b\x0c\x94\x48\xa2\xae\x24\x87\x2e\xec\x1e\xe9\x24\x6a\x5a\x63\x73\x10\x77\xc6\x20\x53\x97\x82\x2b\x4d\xb9\x5e\x98\x48\xc4\x4e\x9d\xb8\xfb\xac\x9a\x21\xce\x49\x64\x17\x66\x16\xc4\x8c\xbc\xef\x21\xd8\x1d\xb3\xd1\x34\x36\xbc\x83\xa4\xa4\x82\xe7\x6c\x73\x7e\x00\xdb\xad\x9b\x77\x47\xa1\x31\x9b\x6f\xa5\xd8\xb5\xc9\x89\x8f\xc2\x6f\x1d\xe7\xac\xf0\x0e\x1b\x8f\x43\x38\xd2\x62\xe1\xac\x70\x40\x3c\x35\x7a\x19\x89\x8a\xbc\x47\x9a\x2d\xb9\x36\x09\xb2\x32\x8e\xad\x5f\xcc\xd7\x78\x50\x09\x2c\xb3\xf6\xc9\xf2\x0d\xb9\x79\x28\x31\x2c\x84\x04\x4e\x32\x55\x90\x1b\x49\x6b\x94\x8a\x5a\x28\xc6\xf0\x27\xa6\xb7\x40\xae\xaa\x9d\xcd\x94\xa4\x8c\x6b\xe7\xab\x36\x0a\xd2\x7e\x51\x69\x59\xa5\xda\x45\xa0\x94\x98\x8d\xf5\x9d\x9e\x86\xd2\x46\x82\xa5\x54\x23\x31\xf2\x1a\x95\x3e\x22\x6f\x97\x77\x54\xa7\x5b\x54\x40\x79\x06\x4c\x2b\xa7\x84\x72\x4d\x7c\x5c\x7b\xa5\xb6\x32\x76\xf4\x0e\xe3\x0f\x1f\x4f\xfa\xe5\x39\x9c\xcd\x0d\x6c\x62\x50\x0e\xa2\x69\x7f\x9f\x9e\x40\x4a\x15\x9a\xc6\xe7\xba\x18\xa8\x12\x53\x96\xb3\x14\x6a\x94\x1a\xef\xc1\x76\xbf\x43\xca\xd5\xc6\xdc\x86\xfc\x16\xb3\x2c\xe9\x54\x6d\x90\xa3\xa4\x45\xab\x2a\x17\x12\xae\xac\x1e\x96\xa2\x0a\x34\xf5\x39\xef\xd4\x24\xe4\x27\xaa\x7e\xa6\xb7\x58\xd8\xec\x92\x77\x34\xbd\xa3\x1b\x23\x45\xec\x6a\x32\x89\x22\xa3\x6f\x3d\x87\xd2\xf6\x4b\xca\x37\x78\x40\xde\x2e\xb0\xca\xa7\x22\xae\x13\x17\xa9\x10\x78\x4d\x25\xc4\xae\x38\x58\x0e\x42\x8e\x33\x1c\x17\xc8\x61\x46\x16\xd9\x06\x55\xe2\xfc\x8c\x64\x0d\x17\x50\x93\xcb\x42\x70\x34\xb4\x8c\xa2\x35\x5c\x80\xac\x9d\x9a\x56\x73\xa4\xa5\x82\x0f\x1f\x87\xc9\x9c\x44\x3e\x42\xce\xe7\xd9\x7a\x0e\xb3\xdc\x15\xeb\x5b\x86\x45\xa6\xfa\x22\x76\xee\xc4\x5c\x68\x98\xe5\x64\xb9\xdb\x55\x9a\xde\x16\x98\x98\xa7\x5f\x6d\x50\xdf\x60\x4e\xab\xc2\xb3\xd0\x94\x68\x4d\x8b\x0a\x8f\xf5\x2f\xf3\x9c\xb7\x47\x8e\x35\x04\x4d\xf3\x83\x97\x0f\x2b\xb6\x4b\x6e\x4e\x7e\xe5\xec\xf7\xca\xa7\x26\x1a\xb2\xeb\x02\x68\x59\x22\xcf\xe2\x60\x71\x0e\x2f\xfb\x27\xa7\xcb\xd1\xff\xbc\xcf\xe9\xf1\x74\xce\x61\xbc\xec\xdc\x6d\x3b\xa2\xed\x11\x27\xd6\xd7\x84\x5c\x8a\xca\xf4\x82\xb9\x37\x60\x0a\xe3\x1c\xd6\x6b\xb2\x54\x71\x49\xae\x16\xbf\xc4\x67\x49\xd2\xbd\x19\x5f\xe1\xa7\x85\x94\x0e\x89\x85\xfd\xed\x1e\xb4\xa6\x9b\xa4\x8b\x57\x97\xf1\x28\xaa\xc9\x3b\x29\x4a\x94\xfa\x21\x36\x79\x5f\x31\xbe\x29\xf0\x4b\xd4\x1b\x2d\x56\x55\x9f\x08\xd3\xa0\x0c\x2b\x51\xb2\xb4\xb5\xf3\x54\xb2\x69\x96\x3d\x3f\xdf\x8f\x27\x3c\xa2\x59\xf6\x5b\x6b\x43\x76\x74\x37\x62\x82\xc7\xeb\x35\xb1\x9b\x87\x39\x3d\xc0\x96\xcc\x4d\x82\xba\x9c\xb4\x71\x24\xab\x6a\x17\x27\xe4\x0a\xef\xb5\x2b\xa2\xaf\x25\xd9\x1f\xc8\xb2\x16\xf2\x01\xcf\xfe\x4c\xa2\xe5\x3b\x4d\x56\xa5\x64\x5c\xe7\xf1\xf4\xff\x2f\xe0\x45\x3d\xed\xd9\xd7\x79\xe4\xf9\x37\x26\xe0\x37\x30\x70\xbd\xfe\x83\x73\xeb\x3c\xec\xd8\xdc\x79\x39\x3e\x78\xc6\x87\x50\x81\x54\x82\x28\x35\x13\x9c\x16\x90\xdb\xbe\x48\x82\x23\xc3\x9e\xc4\x33\x93\xea\xeb\x56\xc8\x1d\x20\x54\x42\xe9\xc0\x33\x34\xbd\x97\x71\x8d\x32\xa7\xa9\x1d\x1e\x9f\xd1\x76\x83\x62\x18\x6a\xb6\x05\x77\x30\x1d\x19\x3f\x8f\x56\x5a\x5b\x5b\x81\x33\x1d\x9b\xfb\xb5\x67\x24\xe5\x39\x11\x34\xae\x15\xc8\x03\xc5\x09\xfc\x1d\xce\x9c\x0f\x35\x59\xb1\x0c\x17\x79\x8e\xa9\x36\x79\x7d\xd7\x09\x05\xf2\x84\x90\x84\xbc\x91\xa2\x74\x29\x3b\x92\x95\x20\x6c\xe8\xc2\x66\x0f\xc4\x60\xe2\x74\xdf\x4d\x4c\x70\xb3\x3d\x5d\xf2\x69\xb0\xc7\xcd\x98\x69\xbe\x80\x2c\xa7\x61\xfa\x42\x91\x17\x6a\x1a\x40\x9f\x61\x08\xba\x3f\xff\x66\x48\x96\x6a\xc9\xcd\xd1\x89\x41\x86\x02\x63\x17\x30\xbd\xae\xf4\x34\xdc\xb4\xd6\x0e\x8d\xa1\xeb\xa3\x4f\x9a\x1c\xc4\xf7\xf4\x04\x24\xee\x44\x8d\x80\x16\xab\xe3\x5f\xe0\x5a\xd8\x2f\x1f\xa3\x07\xda\x56\x8c\x64\x65\x67\xc2\x01\x3f\x86\xc3\x8f\x99\x67\x58\xf6\xf8\x34\xe3\x5c\xf9\x8c\xb6\xd0\x7d\xe7\xe3\x0a\x8b\xfc\x3d\xe6\x3e\x3e\x5a\x8e\x7a\xf9\x8f\x42\x6f\x17\xb6\xca\xb9\xfb\x14\x48\xdc\x1c\x64\x87\x8e\x00\x21\xf9\xf7\x16\x25\x1a\x02\x5d\x4b\xf3\x77\xc9\x7d\xaf\x5d\xbe\x31\x43\x9f\x6d\x02\xd7\x95\x1e\x2c\x26\x49\x37\x0c\x79\x72\x91\xa5\x46\x49\xb5\x9b\x99\x3a\xf8\xc7\xf3\x7c\xe0\xea\x92\x7f\xa1\xa3\x7a\x8b\x72\xe8\xd0\xf3\xfc\x79\xc4\xfe\x75\xa5\xff\x04\x07\xba\x46\x6e\x86\xc7\xae\x67\x68\xa9\xe6\xa0\xa5\x2f\xce\x96\x9d\x7e\xb2\x1e\xb0\xf3\x73\x34\x72\xfc\x39\xd6\xae\x1e\x2f\xb9\x9a\xbc\xce\xb2\x21\x76\xfb\xf1\x17\xfb\x91\x3f\x71\x74\x38\x8c\xe1\xb1\x17\x6f\x44\xff\x9a\x63\xcc\xe3\xe4\xfd\x89\xaa\xf1\xb7\xd6\xa3\xd4\xfe\xaa\xd1\xc1\x0d\x0e\xa3\x7a\x18\xfa\x3b\x9c\x03\xbe\x60\x0a\x30\x0d\xf2\xa9\x21\xc0\x5b\x98\x83\x09\x85\x53\xef\xdb\xfd\xd7\x23\xd9\x90\xc5\xf8\xe3\xa9\x03\xf2\x55\x15\xfc\x17\xc0\x1f\x71\xe8\x7f\x14\x0d\xf3\xd0\x9f\x22\x4d\x33\xc0\xfd\x57\xa1\x3e\x7a\xba\x1f\x9c\xc6\xc1\xb7\x77\xed\xe6\xb4\x7f\xd1\x32\xd6\xb2\xc2\xa4\xbf\x5d\xab\x5b\x0c\xc1\x07\xe9\x93\x97\x18\x7e\x88\x08\x02\x1b\x4c\x11\xbe\xe1\xec\xe8\x1d\x82\xaa\x24\xda\xeb\x52\xdd\x5d\x50\x64\x02\x95\x6d\x84\xa9\xe0\x9a\x32\x0e\x3b\x61\x65\x28\x07\xe3\xa7\xbf\x3c\x60\x39\x7c\x42\xd8\xd2\x7a\x70\x59\xe2\xfb\x56\x5b\xd7\xb6\x9d\x76\x17\x0b\xdf\x5a\xd5\x4f\xa4\xf1\x1f\x37\xf1\xab\x30\x8b\x2f\xfb\x80\xd8\x1b\xb8\xfd\x4e\x6d\xce\x61\xea\x7b\x6c\x8f\xd5\x43\x54\x47\x31\x4e\x9b\xc7\x93\x1a\xd5\x70\x11\x00\x57\x1f\xce\x3e\xda\x2b\x0a\x72\x29\x68\x81\x2a\xc5\x78\xb4\x69\xfc\x9d\x83\xbd\xb3\x68\x6f\x3b\x52\xd9\x77\xf6\x50\xfa\xd5\xf9\x47\x3f\x72\x5a\x23\x72\xac\x58\x0e\x94\x1d\x61\xd5\xe1\x69\x63\x44\xfd\x25\x9c\xf9\x8c\xf8\xa7\x60\xdc\x6c\x98\x51\x71\x62\x6f\x99\xfd\xab\xff\x0d\x00\x00\xff\xff\x5f\x06\x4e\x4e\xcf\x17\x00\x00") func templateDialectGremlinUpdateTmplBytes() ([]byte, error) { return bindataRead( @@ -556,7 +556,7 @@ func templateDialectGremlinUpdateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/update.tmpl", size: 6099, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/update.tmpl", size: 6095, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -641,7 +641,7 @@ func templateDialectSqlDeleteTmpl() (*asset, error) { return a, nil } -var _templateDialectSqlErrorsTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x53\x4f\x6b\xe3\x3e\x10\x3d\x5b\x9f\x62\x7e\x81\xfe\xb0\x83\xd7\x6e\x7b\x58\xd8\x96\x1c\x4a\x37\x85\x42\xb6\x34\x4d\x7b\x58\x4a\x29\xaa\x3c\x76\x44\x14\x29\x19\xc9\x69\x83\xf1\x77\x5f\x24\xdb\xd9\xb0\x7f\x0e\x9b\x53\x3c\x6f\xde\x9b\xd1\xcc\x9b\xa6\xc9\xc7\xec\xda\x6c\xf6\x24\xab\xa5\x83\xf3\xd3\xb3\x2f\x9f\x36\x84\x16\xb5\x83\x1b\x2e\xf0\xcd\x98\x15\xdc\x6a\x91\xc1\x95\x52\x10\x92\x2c\x78\x9c\x76\x58\x64\xec\x71\x29\x2d\x58\x53\x93\x40\x10\xa6\x40\x90\x16\x94\x14\xa8\x2d\x16\x50\xeb\x02\x09\xdc\x12\xe1\x6a\xc3\xc5\x12\xe1\x3c\x3b\x1d\x50\x28\x4d\xad\x0b\x26\x75\xc0\x67\xb7\xd7\xd3\xbb\xc5\x14\x4a\xa9\x10\xfa\x18\x19\xe3\xa0\x90\x84\xc2\x19\xda\x83\x29\xc1\x1d\x15\x73\x84\x98\xb1\x71\xde\xb6\x8c\xf9\x37\x80\xa8\xad\x33\x6b\x40\x22\x43\x16\xb8\x2e\x86\xbf\x4b\xae\x0b\x85\x64\xa1\x34\x04\x76\xab\xa0\x90\x5c\xa1\x70\x16\x02\xbb\x69\xa0\xc0\x52\x6a\x84\x51\x0f\xe4\x76\xab\xf2\x8e\x3c\x82\xb6\x65\x65\xad\x05\x48\xbb\x98\xcf\xae\x8d\xb6\x8e\xb8\xd4\x6e\xea\xe1\x18\x89\xba\x2a\x09\xc4\xe3\x29\xd1\x4f\xfc\x86\x4b\x85\x45\x0a\x6f\xc6\xa8\x04\x1a\x16\xed\x38\x41\xcc\xa2\x68\x6d\x2b\x98\x78\x52\xd6\x49\x24\x2c\x8a\xf2\xbc\x53\xf1\x1d\xae\xb9\x83\x0d\xd2\xd0\x64\xc6\xa2\xa8\x7f\xc7\x04\x9e\xb3\x2c\x7b\xb1\x8e\xa4\xae\x1a\x16\x45\xd1\x28\x48\xc0\xd9\xe9\xe7\xf3\x51\x1a\x1d\x7e\x79\x0e\xdf\xf6\x8b\xf9\x2c\x00\xbd\x72\x3c\x7d\x78\xfd\xfa\x74\xff\x3a\xbd\x7b\x7c\xf8\x9e\x64\x81\xfd\x74\x77\x3b\x7f\x9a\x82\x38\x34\x0d\x65\xe8\xfa\xa0\x95\xe7\xb0\x98\xcf\xa4\xc3\x2e\xbf\xa8\x37\x4a\x0a\xee\x10\x56\xb8\x87\x1d\x57\x35\xc2\x4e\x1a\xc5\x1d\x5a\xa8\xb5\xdc\xd6\x78\x24\x36\x4a\x3d\xff\xde\x58\x57\x11\x2e\xe6\x33\xaf\xd1\xb2\x28\x61\x91\x2c\xe1\x35\x05\xb3\x82\x8b\x6e\x10\xf1\xd8\x6e\x55\x45\x7c\xb3\xcc\x7e\x19\x70\x72\xe9\xd3\xfc\x5b\x09\x5d\x4d\x1a\xfe\xff\xc3\x90\x9b\xb5\xad\x52\x2f\xd4\xa6\xe0\xa8\x46\xe6\xcb\xf8\x5d\x4b\x5f\x80\xb8\xae\x70\xb0\x82\x57\x92\x25\x74\x23\xb4\xbe\x9a\xe3\x52\xdb\x78\x50\x30\x64\x9f\xe5\x4b\xd8\xd7\x3f\x96\xf4\x35\x5b\x36\x70\xb4\x54\x29\x94\x5c\x59\x64\x2d\x63\x79\x0e\x64\x94\x7a\xe3\x62\x05\x82\x2b\x65\xc1\x19\x70\x1f\xd9\xc3\x10\xf4\x66\x7d\x27\xbe\xb1\xc1\xf7\x95\xdc\xa1\xee\xd7\xf6\x2e\xdd\xb2\x3f\x86\x3e\xb7\x8b\xcb\x12\x8c\x10\x35\x91\xbf\xc1\xe0\xcf\x21\x21\x76\x1f\x07\xef\x3c\x7e\x84\x26\x07\x8b\x76\xd4\x26\x2c\x80\x7c\xfc\x62\x72\xdc\x46\x9c\x5c\x76\xe1\xff\x26\xfe\x01\x61\x08\xfe\x73\x02\xe5\xda\x75\x6e\x2d\xe3\xd1\x89\xbd\x80\x93\xdd\x28\x3d\xb6\x70\x1a\x78\x49\x98\x80\x2c\x3d\x32\xac\xf7\x6f\x57\xf3\xdb\x62\x91\xe8\x78\x80\xfe\x33\x9c\x26\xea\x02\xda\xf6\x47\x00\x00\x00\xff\xff\xe7\x56\x64\x7e\xa5\x04\x00\x00") +var _templateDialectSqlErrorsTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x53\xc1\x6a\xe3\x48\x10\x3d\xab\xbf\xe2\xad\x61\x16\x29\x68\xa5\x4c\x0e\x0b\x9b\xc1\x87\x21\xeb\x85\x80\x37\x8c\xe3\xe4\xb0\x0c\x43\xe8\xb4\x4a\x72\x93\x76\xb7\x53\xdd\x72\x62\x84\xfe\x7d\x69\xc9\x32\x26\xcb\x1e\xc6\x27\xab\x5e\xbd\x57\xd5\x55\xaf\xba\xae\xbc\x10\x37\x6e\x77\x60\xdd\x6c\x02\xae\x2e\x3f\xff\xf1\xdb\x8e\xc9\x93\x0d\xf8\x4b\x2a\x7a\x76\xee\x05\xb7\x56\x15\xf8\x6a\x0c\x86\x24\x8f\x88\xf3\x9e\xaa\x42\x3c\x6c\xb4\x87\x77\x2d\x2b\x82\x72\x15\x41\x7b\x18\xad\xc8\x7a\xaa\xd0\xda\x8a\x18\x61\x43\xf8\xba\x93\x6a\x43\xb8\x2a\x2e\x27\x14\xb5\x6b\x6d\x25\xb4\x1d\xf0\xe5\xed\xcd\xe2\x6e\xbd\x40\xad\x0d\xe1\x18\x63\xe7\x02\x2a\xcd\xa4\x82\xe3\x03\x5c\x8d\x70\x56\x2c\x30\x51\x21\x2e\xca\xbe\x17\x22\xbe\x01\xaa\xf5\xc1\x6d\x41\xcc\x8e\x3d\xa4\xad\xa6\xbf\x1b\x69\x2b\x43\xec\x51\x3b\x86\x7f\x35\xa8\xb4\x34\xa4\x82\xc7\xc0\xee\x3a\x54\x54\x6b\x4b\x98\x1d\x81\xd2\xbf\x9a\x72\x24\xcf\xd0\xf7\xa2\x6e\xad\x82\xf6\xeb\xd5\xf2\xc6\x59\x1f\x58\x6a\x1b\x16\x11\x4e\x89\x79\xac\x92\x21\xbd\xf8\x00\xe6\x78\x76\xce\x64\xe8\x44\xb2\x97\x8c\x54\x24\xc9\xd6\x37\x98\x47\x42\x31\xd2\x33\x91\x24\x65\x39\x2a\xc4\xee\xb6\x32\x60\x47\x3c\x35\x58\x88\x24\x39\xbe\x61\x8e\xef\x45\x51\xfc\xf0\x81\xb5\x6d\x3a\x91\x24\xc9\x6c\x90\xc0\xe7\xcb\xdf\xaf\x66\x79\x72\xfa\x95\x25\xfe\x3e\xac\x57\xcb\x01\x38\x2a\xa7\x8b\xfb\xa7\x3f\x1f\xbf\x3d\x2d\xee\x1e\xee\xff\xc9\x8a\x81\xfd\x78\x77\xbb\x7a\x5c\x40\x9d\x7a\x46\x2d\xb5\xa1\xea\xa4\x55\x96\x58\xaf\x96\x3a\xd0\x98\x5f\xb5\x3b\xa3\x95\x0c\x84\x17\x3a\x60\x2f\x4d\x4b\xd8\x6b\x67\x64\x20\x8f\xd6\xea\xd7\x96\xce\xc4\x66\x79\xe4\x7f\x73\x3e\x34\x4c\xeb\xd5\x32\x6a\xf4\x22\xc9\x44\xa2\x6b\x3c\xe5\x70\x2f\xb8\x1e\x07\x91\x5e\xf8\x57\xd3\xb0\xdc\x6d\x8a\x0f\xf3\xcb\xbe\xc4\xb4\xf8\x56\xa6\xd0\xb2\xc5\xaf\x1f\x12\xba\xad\x6f\xf2\x28\xd2\xe7\x08\xdc\x92\x88\x25\xe2\x8e\x75\x14\x67\x69\x1b\x9a\x2c\x10\x55\x74\x8d\x71\x7c\x3e\x56\x0a\x52\x5b\x9f\x4e\x0a\x8e\xfd\x77\xfd\x63\xd8\xd5\x4f\x94\x8b\xf5\x7a\x31\xe5\x5b\x6d\x72\xd4\xd2\x78\x12\xbd\x10\x65\x09\x76\xc6\x3c\x4b\xf5\x02\x25\x8d\xf1\x08\x0e\xe1\xbd\xb8\x9f\x82\xd1\xa0\x6f\x2c\x77\x7e\xf0\x7a\xa3\xf7\x64\x8f\xeb\x7a\xd3\x61\x73\x3c\x80\x63\xee\x18\xd7\x35\x9c\x52\x2d\x73\xbc\xbb\xc1\x93\x53\x42\x1a\xde\x4f\x9e\x79\x78\x1f\x9a\x9c\x6c\x39\x52\xbb\x61\xf0\x1c\xe3\xd7\xf3\xf3\x36\xd2\xec\xcb\x18\xfe\x65\x1e\x1f\x30\x0c\x20\x7e\xce\x51\x6f\xc3\xe8\xd2\x3a\x9d\x7d\xf2\xd7\xf8\xb4\x9f\xe5\xe7\xd6\xcd\x07\x5e\x36\x4c\x40\xd7\x11\x99\xd6\xfa\x7f\x97\xf2\x9f\x85\x12\xf3\xf9\x00\xe3\xe7\x70\x8e\x64\x2b\xf4\xfd\xbf\x01\x00\x00\xff\xff\xd7\xe8\xc3\x3f\x99\x04\x00\x00") func templateDialectSqlErrorsTmplBytes() ([]byte, error) { return bindataRead( @@ -656,7 +656,7 @@ func templateDialectSqlErrorsTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/errors.tmpl", size: 1189, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/dialect/sql/errors.tmpl", size: 1177, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -801,7 +801,7 @@ func templateDialectSqlSelectTmpl() (*asset, error) { return a, nil } -var _templateDialectSqlUpdateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\x5f\x73\xdb\xb8\x11\x7f\xa6\x3e\xc5\x9e\x46\xf1\x91\xae\x42\x3b\x79\xab\x53\x65\xc6\xb5\x9d\x19\xb5\x8d\x95\x8b\x92\xf6\xc1\xe7\xb9\x81\xc9\xa5\x85\x9a\x02\x15\x00\x92\xed\x6a\xf8\xdd\x3b\x00\x08\x12\xa4\x28\x45\xb2\x3c\x97\xb4\xb9\xcc\x24\x11\xf1\x6f\x17\xfb\xf7\xb7\x20\xb8\x5c\x1e\x1d\x76\xce\xb2\xd9\x23\xa7\xb7\x13\x09\xaf\x8f\x5f\xfd\xf9\xe5\x8c\xa3\x40\x26\xe1\x1d\x89\xf0\x26\xcb\xee\x60\xc8\xa2\x10\x4e\xd3\x14\xf4\x20\x01\xaa\x9f\x2f\x30\x0e\x3b\x9f\x26\x54\x80\xc8\xe6\x3c\x42\x88\xb2\x18\x81\x0a\x48\x69\x84\x4c\x60\x0c\x73\x16\x23\x07\x39\x41\x38\x9d\x91\x68\x82\xf0\x3a\x3c\xb6\xbd\x90\x64\x73\x16\x77\x28\xd3\xfd\xff\x18\x9e\x5d\x5c\x8e\x2f\x20\xa1\x29\x42\xd1\xc6\xb3\x4c\x42\x4c\x39\x46\x32\xe3\x8f\x90\x25\x20\x1d\x62\x92\x23\x86\x9d\xc3\xa3\x3c\xef\x74\x96\x4b\x88\x31\xa1\x0c\xa1\x1b\x53\x92\x62\x24\x8f\xc4\x97\xf4\x68\x3e\x8b\x89\xc4\x2e\xe4\xb9\x1a\xd1\x9b\xdd\xdd\xc2\xc9\x00\x7a\xe1\x38\xca\x66\x18\x7e\x20\xd1\x1d\xb9\x45\xdb\x7b\x33\xa7\xa9\xe2\xf6\x64\x00\x33\x22\x22\x92\x96\x03\xff\x5a\xf4\x14\x03\x39\x46\x48\x17\x66\x64\xf9\xbb\x9c\x5e\x0c\xca\x18\xaa\xfe\x09\x11\xe3\x79\x92\xd0\x87\x6a\x40\x77\xc4\x2c\x4b\x2f\xa1\xf7\x1f\xe4\x99\x1a\x78\x0c\x79\xbe\x5c\x02\x4d\xcc\x54\xfd\x60\x3a\x07\xd0\x65\x34\xed\x9a\x26\x64\x71\x39\x95\xa3\x54\x33\xbb\xac\xdb\x36\x57\xf5\xaa\xbd\x7e\xb4\x1c\xba\xf3\x3b\xc9\x9c\x45\xe0\xd7\x76\x93\xe7\x70\xe8\xca\x21\xcf\x03\x10\x5f\xd2\x31\x59\xa0\x1f\xc9\x07\x88\x32\x26\xf1\x41\x86\x67\xe6\xff\xc0\x4e\x97\x6a\x66\x8d\xbc\x5e\x26\xbc\x24\xd3\x82\x17\x4c\x85\xfa\x45\x99\x2c\x39\xe8\x03\x72\xae\xfe\x66\x3c\x80\x65\xc7\x5b\x10\x0e\x7e\xc7\xf3\x2c\xf1\x81\x22\x1d\x9e\x1b\x5d\x36\xf9\x0c\x63\xae\x7e\x95\xdd\x41\xd0\xf1\x3c\x81\xa9\xb6\x13\x18\x40\xb1\x48\x38\xc6\x72\xb6\xa3\xec\xb0\xc6\xeb\x59\x96\xce\xa7\x4c\x84\x61\x58\x31\xaa\x27\x0c\xcf\xd5\x4e\x85\x24\x4c\xba\xa2\x0b\xc2\x77\x3c\x9b\xfa\x96\xc4\x27\x72\x93\xe2\x0a\x05\xdd\xaa\xb8\x0a\x3a\x9e\x52\x55\x45\xae\xe3\x79\xcd\xc1\xc3\xf3\x95\xfd\xd1\x38\xf0\xed\x7e\x8a\x25\x0a\xd6\x3a\x9e\x97\x64\x1c\x7e\xeb\xc3\x4c\x9b\x1f\x61\xb7\x08\xcd\xe9\x33\x8e\x31\x8d\x88\x44\xa1\x44\xeb\x79\x33\x77\x31\x2f\x2f\x16\x34\x96\xe0\xf1\xec\x5e\xa8\xa5\x0e\x94\xc0\x3f\x66\xf7\x62\x99\x77\xbc\x2f\x73\xe4\x8f\x7d\x20\xfc\x56\xf7\xd9\xe9\xe1\x2f\xaa\xdd\x0f\x3a\x1e\x4d\xb4\x02\x07\x2b\xb4\x0b\xd5\x98\x81\x91\x7c\xe8\x83\xb3\x56\x1f\x14\xb5\xe0\x8d\x9e\xfb\xd3\x00\x18\x4d\x35\x87\x1c\xe5\x9c\x33\x28\x4d\xbe\xb0\x8f\x8e\xe2\x35\xc6\x04\xb9\x9e\x17\x9e\xa5\x99\x40\x5f\x0b\x04\x7a\xf2\x51\x4b\xa0\x4b\x99\x74\xec\x5f\xa9\xed\xb3\x40\x7e\xae\xa3\x41\x5c\x28\x53\x8d\x1d\x98\xce\x4f\x8f\x33\xac\xb9\x82\x36\x3d\x1a\x0b\xb8\xba\xb6\x43\x55\xab\x92\xb2\x26\x7a\x89\x0f\xd2\xd7\x36\x5a\x8c\x04\x77\xd8\xaa\x7a\x8d\x7e\x1d\xaf\x83\x01\x1c\xd4\x1c\x22\xca\x58\x42\x6f\x4f\x56\x44\x67\xda\xf5\x1a\x85\x78\x4f\x8c\x7c\xdd\xd5\xb4\xf9\x29\x35\xf9\xed\xa2\x6c\x17\x66\x32\x95\xe1\x85\x72\xb6\xc4\xef\xda\x48\x98\xe7\x27\x90\x10\x9a\x62\x0c\x22\x22\x8c\x51\x76\xab\x76\x0c\x94\xc9\x0c\x5c\x86\x4f\xe0\xc5\xa2\xab\x15\xa2\xcc\xc7\x2b\x36\xf9\x12\xd4\xbe\x09\x8b\x8d\x5c\x87\x62\x2c\xb9\x5a\xc2\x67\x99\x5c\xd1\x43\x50\xc8\xc6\xa3\x31\xb4\xec\x89\xc6\x7e\x60\x57\xd5\x86\x4e\x13\xc8\xb8\x5d\xf8\xf3\xe7\xe1\xb9\xfd\x3d\xd4\xde\xb8\x61\xa9\xe1\x79\x6d\x21\x77\x2c\x65\x45\x2c\xa8\x8f\xaf\x28\x17\x06\xd1\x9c\x5d\x29\x43\x1b\xc4\x38\x22\xcc\x3f\xa0\xf1\x33\xc9\x9e\x23\x89\x95\xdc\x68\xdc\x22\xe7\x1a\x5b\xca\x48\x07\x40\x66\x33\x64\xb1\x4f\x63\xd1\x07\x1a\x07\x1d\xeb\xcf\x35\x23\x14\xf7\x54\x46\x13\x60\x8a\xe9\x14\x99\x1a\x1d\xbc\xd1\x3c\x46\x44\x20\x30\x18\x0c\xe0\xf8\xa4\xb3\x86\xe3\x83\x0b\xce\x2f\x33\xf9\x4e\xe5\xe7\xa5\x62\x7f\x3c\xe3\x94\xc9\x82\x7f\x6b\x16\x70\x4f\xe5\xa4\x62\xbb\x25\x86\xe5\x15\xbd\xb7\xf0\x6a\x2d\xb9\x75\x02\x9a\x66\x1c\x41\x4e\x08\x03\xb5\xaf\x55\xd2\x0a\x22\x08\xd5\xb0\x89\x07\x27\xe0\x95\x1a\xa5\x49\x29\x14\x2d\x08\xa3\xbc\x36\xd6\x18\x4d\x57\x23\xa6\x02\x4c\x4a\xdc\x72\x82\x1c\x7f\x56\x78\x64\x8a\x72\xa2\x74\x28\x33\x30\x90\xa3\x0f\x42\x12\x2e\x81\x80\xe4\x84\x09\x12\x49\x9a\xb1\x10\x34\x58\xf1\x54\x50\x74\xbc\xbb\x25\x7a\x7e\x7a\x50\xa1\xb3\x0a\xb3\x5b\x86\x4a\x6b\x06\xe1\x3b\x8a\x69\x2c\xcc\x66\x6d\x66\xf5\x38\x0a\x9d\x54\x3f\xa2\x98\xa7\x52\xb5\x18\x5e\xdd\x8c\xf9\x59\xb7\xac\xc9\x67\x1d\x4f\xe5\x33\x4b\x45\x79\x7e\xe5\xeb\xda\x33\x83\xb6\xf8\xab\x3d\x28\x4e\x48\xa4\xf1\xd0\x94\xdc\xa1\x7f\x75\x4d\x99\x44\xae\xda\x96\x79\xbf\xd4\x85\xb6\x7a\x15\x77\x69\x95\xda\x94\xcd\x2f\x0b\x17\x56\xe3\xaf\xe8\xb5\xf2\xe4\x58\x5c\xd1\xeb\x32\x18\x55\xfb\x28\x7e\x85\xff\x52\xaa\xf1\xd5\x6e\x87\xac\x2d\xff\x37\xd3\xbb\x72\x25\xb5\x7c\x18\x86\x41\xb0\x1a\x01\x36\x13\x18\x32\x29\xb6\x25\x22\x6a\x14\xdc\x80\x63\xf6\xdb\xfb\xad\x0f\xbd\xc4\xa0\x54\x57\x8b\x56\xea\x19\x2f\x84\x9e\x84\xc3\xe9\x74\x2e\xb5\x62\xd4\x93\xd1\xdc\x39\x26\x64\x9e\x56\x21\x32\x81\x05\x49\xe7\xd8\x66\x6a\xea\x39\xb1\xd0\x56\x93\x82\x3c\x7f\x53\x8c\xaf\x05\xb5\xd2\xae\x92\x70\x28\xfe\x36\x1e\x5d\xda\xe5\x15\x5c\x4b\x4a\x5b\xfe\xb7\xc8\x58\xf8\x9e\x70\x31\x21\xa9\x7f\xa8\xd7\x09\x8a\x61\xab\x66\xec\xad\x8b\x96\xda\x96\xf5\x1f\x4b\xc3\x8a\x7c\x8c\xad\x50\xae\x97\xd4\x65\x7c\x33\x4f\x82\x8a\x6d\x37\x09\xec\xbc\x54\x6d\x13\x35\x85\x79\x6d\x89\xbf\x25\xf7\x17\xab\x8e\x25\x9f\x47\xd2\x0a\xd9\xa4\x2d\x9a\x40\xa1\xc8\x4b\x9a\xa6\x4a\x8f\x05\x72\x36\x44\x34\xe9\x56\xca\xe6\xdf\x4a\x27\x0a\xd1\x84\x97\xf3\x29\x72\x1a\x95\x9c\x6c\xd2\x3c\x89\xe3\x1d\x94\x5f\x0a\xed\x34\x8e\x77\x16\x5a\xbb\x94\x1c\xe6\x9d\xbd\xdb\x4e\xc5\xfb\x76\x72\x6c\xda\x93\xe7\x1d\x6e\x37\xf1\x4f\x83\x82\xcd\x72\x66\x6e\x2c\xc5\x59\x6a\x5b\x55\x36\xd6\x71\xb7\x58\x37\xbe\x6d\x97\x5c\x61\xae\x69\x79\x2b\x0d\x95\x45\x54\xad\xab\x4f\x46\xe0\xa3\x99\x4a\x45\x24\x75\x42\xc4\x0a\x0e\x4d\x91\xf0\x56\x0b\x69\x06\x84\x86\xed\x6f\x50\xea\xb6\xd2\x34\x09\x77\x8d\x00\x55\x2a\x33\x26\x6a\x66\x17\x58\x7e\x57\x1a\xae\x70\xdb\xbc\xda\x7d\x76\x22\xc6\xe5\x3c\x4d\xbf\xee\x00\x41\xe5\xa3\xab\x98\xb2\x44\x72\x09\xfc\x64\x57\xbe\x98\xce\xe4\x63\x51\x60\x34\xeb\x2e\x3b\xa6\x2c\xbb\x5c\x30\x2a\x1f\xc2\x8b\x07\x8c\x5a\x8a\xac\x03\x8e\x5b\x57\x06\x3c\x4b\xd3\x1b\x12\xdd\xf9\x05\x2a\x29\xa1\xa7\x8b\x9a\x34\xa8\xb8\x88\x6f\x51\xe8\xd2\xe9\xe8\x10\x90\x49\x0d\xc2\xb2\xb9\x84\x44\xe7\x29\x15\x79\x4d\x1b\xa0\x1e\x69\xc0\x8e\x56\x5a\x13\x7a\xd4\xd1\x54\x2d\xf7\xa1\xc9\x7d\x96\x98\x53\x61\x61\xf8\xfe\xf5\xfb\x0a\x92\x2b\xd4\xd0\xb4\x5c\x8e\xd3\x6c\x81\x3a\xba\x61\x43\xef\x01\xbc\xb5\x40\x4f\xaf\xd8\x23\xce\xa9\x4b\xef\x46\x3d\xbc\xaa\xca\x48\xd4\x80\x66\x81\xbc\x3c\x0f\x20\x50\x0e\xe8\xdd\x40\x39\xd3\xb1\x15\x54\x58\xa5\x06\x71\xfa\x3b\x33\x69\xac\x47\x61\x20\xa4\xf1\xfa\x02\x7f\xc3\x12\xae\x8b\x4a\x9c\xce\x52\x22\x5b\x0f\xc5\x8e\xa2\x4c\xed\x4f\xd2\xb8\xab\x84\xfe\xd2\x1a\x3c\xd6\xaa\x0c\xd4\x65\x06\x1a\x1c\x6d\x03\x4d\xc3\x48\x2d\x76\x3c\xc7\x14\x5b\xb0\xa3\x61\x52\x23\x48\xd7\x4d\x42\x43\x6e\x2b\x1c\x85\xe1\x87\xbf\x3b\x73\xaf\x8c\x3e\xf2\xfc\xba\x42\x54\xfb\x2e\x77\x63\x96\xc3\xc6\x7a\x8e\xe3\xed\xe5\x79\xdb\xbb\x5e\x23\xbd\x63\x38\xc6\x34\xf9\x88\x89\x75\x3c\xe5\x03\xda\xc9\x04\xa6\x09\x70\x4c\x90\x23\x8b\x50\x7b\x9b\x1e\xf0\x69\x74\x3e\x3a\x81\xb9\x40\x18\x7d\xb4\x07\xa9\xba\x08\x23\x37\xd9\x02\x6d\x0d\xd2\xd4\xe3\x9e\x6a\xdc\x5b\xf0\x0d\xb9\xef\x6d\x17\x4d\x45\xd6\x34\xb9\xa7\x2e\x77\xd1\x66\x7b\x72\xae\x1d\x32\x18\x35\x8f\x9e\x29\xb6\xfd\xe8\x51\x68\x4d\x05\xbb\xd9\x7c\x37\x65\x77\x0c\xcd\x11\xf1\xd3\x83\xd7\xca\xfc\xed\xc2\x16\x1a\x64\xbf\xba\x09\xd5\xda\xac\x2c\xbf\x97\xc0\xd5\x38\x3e\xd3\x11\x69\xf4\x7a\xa4\xea\xd6\xf7\xaf\x47\x65\xf0\x59\x87\x3a\x37\x5a\xd3\xf7\xaa\xf1\x9d\x14\xf5\x9d\xe8\x69\x7d\x82\x51\xda\x5a\x97\x60\x36\xe5\x8d\x27\xa9\xe1\xa9\x7a\x78\x3e\xd7\xab\x27\x86\xfd\xf2\xc2\x0e\x69\x61\x63\x56\x70\xca\x84\xb6\xd0\x6d\xb6\xd6\x28\xcd\x9c\x1c\xe0\x1c\xd0\xf5\x30\xfc\xcc\xe8\x97\x39\x3e\x45\xd1\x34\x69\x1e\x20\xeb\x73\xdc\xad\x2d\x6e\xdd\xb9\x6e\x44\xd8\xcf\x12\x52\xca\xee\x34\x0f\xaa\x5a\x80\x5f\xbb\x66\x57\xc5\x01\xef\xaf\x5d\x90\x19\xbc\x88\x41\x27\x87\x08\x05\xf8\x6f\xe1\x55\xd0\xed\x03\x0b\x5c\x2b\xfe\x6a\x8e\x6a\x95\xd5\xbe\xd9\xe9\x39\x03\x91\x76\x81\xed\xad\x57\x25\xc1\x72\x66\xe5\x04\x17\xbf\x6c\x7d\x00\x79\x75\x7c\x1d\x04\xe1\xb7\xb4\xfa\x67\x0d\x20\xbb\x89\xaf\xd8\xff\x7a\x09\xee\x9a\x74\x83\xf0\x94\xc5\x7e\x10\x0e\xc5\x4e\x61\xec\x1b\x2b\x80\x24\x09\x46\x12\xe3\xf2\xec\x96\xa3\xd0\xef\x7e\x4f\x8b\x8e\x06\x63\x7b\x13\xa4\x89\x7e\xfb\x66\xe9\x06\xf0\x97\x5d\x22\xdb\xd6\x74\x0f\x2e\x38\xd7\x62\xe6\x84\x32\xf9\x4e\xbf\x60\x5b\x4e\xc5\xed\x09\xd4\xde\x62\xad\x06\x1b\xff\xc5\x22\x00\x92\x72\x24\xf1\x23\x44\x19\x63\x9a\x4d\x15\x83\x08\xc4\x34\xd1\xa1\x51\x16\x41\xaa\x9a\xd6\x35\x26\x90\xd7\xf6\x5a\x1d\xfd\x54\xe0\x5e\x15\x6d\xf6\x98\x40\x9f\x3e\xb9\x10\xbd\x00\xe9\xc7\x8d\x17\x21\xf6\x3d\xbf\x1b\xdd\xaa\xb7\x21\x7b\x46\xbe\x27\x87\x3e\xcb\x7e\x89\xcd\xcd\x73\x1f\xf4\x2e\x96\x34\xd6\x22\xc9\xfb\xd0\x86\x2f\xcc\x18\x54\x83\x68\xec\x5c\xa9\xd0\xe9\x48\x65\xa1\x97\x1c\x13\x88\x38\xea\xab\x0b\xaa\x70\x35\x27\x49\x94\xc1\x4d\x26\x27\x70\x4f\x1e\x85\x5b\xc0\x36\xcf\xc3\x9f\xff\x4c\xc7\xb9\x13\x64\xc3\xd4\x90\x09\xe4\xeb\x42\xce\xba\x30\x55\xdc\x32\xd9\xb5\x8a\xdd\xa9\x88\xae\x59\xcd\xa2\x32\x8c\x42\x63\x85\xe6\xed\x36\xfe\xa9\x5b\xfd\xc5\xd5\xf1\x75\x1f\x16\x57\xaf\xae\xb7\xa8\xad\xbe\x15\x58\x5d\xf1\xa6\x91\xd5\xcf\xff\x41\xfe\x7f\x72\xfa\xdf\xef\x15\xe4\xf7\x00\x7f\xdb\x94\x5b\x9d\x83\x7c\x25\x00\xea\xdb\x3f\x6a\xf7\x1f\x2c\xf7\xdf\x2a\x24\xce\xc2\x11\xf7\x83\x27\x23\x88\xb5\xd0\xe8\xf7\x35\xad\x56\xcb\x52\xe0\x66\xd6\xd7\x62\xde\x15\xe1\x7c\x17\x16\xf6\xa3\x23\x9d\x8c\x21\x64\x49\x4b\x75\xf5\x62\xf1\x24\xb8\x73\x87\x8f\x62\xcb\xbd\x6c\x84\x45\x4e\x09\x5a\xa6\xf3\xcd\xee\x5e\xde\x6d\xb1\x7e\x54\x5e\x38\x2b\xfd\x50\x03\x0b\x51\xe8\x59\x48\xae\xfc\x35\x3c\x95\x19\xf5\x77\x60\x5b\x95\x07\xd5\x21\xb1\x78\x9e\xd3\xdf\x96\x97\x99\x45\xa0\xda\x8d\x33\x67\xb1\x96\x9b\x08\x75\x80\x53\xd0\xf9\x5f\xae\x55\x9f\x5c\x5c\x59\xa2\xb5\xd0\xb3\xaa\x83\x6f\x28\x9b\x8d\xa2\xf9\xdd\x8a\xd0\xf5\x72\x72\xcc\xeb\x8f\x90\xfd\xc3\x87\x6c\x6b\x0d\x8d\x8b\x90\xe5\x25\x70\xf9\x10\x9e\x65\xd3\x29\x95\xfe\x6e\x77\xbb\xab\xbe\xfa\xb7\x0b\xcd\x8f\x16\x8c\xd7\xda\xf2\xd8\xf9\x88\x80\xd1\xb4\x63\x3e\xff\xb0\x1f\x36\x6c\xfc\x12\xc4\x85\x70\xf6\xee\x41\xcf\x04\xe2\x32\xb1\x94\x1d\xf6\x82\x16\x8d\x57\x6f\x34\xda\x90\x4b\xe3\x66\x1e\x5a\x9f\x84\x2c\xd6\x6b\x4d\x2b\x46\x8e\x35\x7b\x11\xa5\xa1\x96\x62\x3a\x3a\x84\xe2\x37\x15\x9a\xb9\x3b\x76\x9f\x31\x20\xd2\x7c\x18\x33\xcb\x28\x93\x55\x81\xdc\x7c\xcb\x68\x77\xa3\xef\x6a\x96\xdc\x2a\x3e\x95\xf9\x17\xec\x35\xaf\x66\x94\x1f\x9c\xd8\x5f\xff\x0d\x00\x00\xff\xff\xb9\xd2\xdc\xbf\x2f\x34\x00\x00") +var _templateDialectSqlUpdateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\x5f\x73\xdb\xb8\x11\x7f\xa6\x3e\xc5\x9e\x46\xf1\x91\xae\x42\x3b\x79\xab\x53\x65\xc6\xb5\x9d\x19\xb5\x8d\x95\x8b\x92\xf6\xc1\xe7\xb9\x81\xc9\xa5\x85\x9a\x02\x15\x00\x92\xed\x6a\xf8\xdd\x3b\x00\x08\x12\xa4\x28\x45\xb2\x3c\x97\xb4\xb9\xcc\x24\x11\xf1\x6f\x17\xfb\xf7\xb7\x20\xb8\x5c\x1e\x1d\x76\xce\xb2\xd9\x23\xa7\xb7\x13\x09\xaf\x8f\x5f\xfd\xf9\xe5\x8c\xa3\x40\x26\xe1\x1d\x89\xf0\x26\xcb\xee\x60\xc8\xa2\x10\x4e\xd3\x14\xf4\x20\x01\xaa\x9f\x2f\x30\x0e\x3b\x9f\x26\x54\x80\xc8\xe6\x3c\x42\x88\xb2\x18\x81\x0a\x48\x69\x84\x4c\x60\x0c\x73\x16\x23\x07\x39\x41\x38\x9d\x91\x68\x82\xf0\x3a\x3c\xb6\xbd\x90\x64\x73\x16\x77\x28\xd3\xfd\xff\x18\x9e\x5d\x5c\x8e\x2f\x20\xa1\x29\x42\xd1\xc6\xb3\x4c\x42\x4c\x39\x46\x32\xe3\x8f\x90\x25\x20\x1d\x62\x92\x23\x86\x9d\xc3\xa3\x3c\xef\x74\x96\x4b\x88\x31\xa1\x0c\xa1\x1b\x53\x92\x62\x24\x8f\xc4\x97\xf4\x68\x3e\x8b\x89\xc4\x2e\xe4\xb9\x1a\xd1\x9b\xdd\xdd\xc2\xc9\x00\x7a\xe1\x38\xca\x66\x18\x7e\x20\xd1\x1d\xb9\x45\xdb\x7b\x33\xa7\xa9\xe2\xf6\x64\x00\x33\x22\x22\x92\x96\x03\xff\x5a\xf4\x14\x03\x39\x46\x48\x17\x66\x64\xf9\xbb\x9c\x5e\x0c\xca\x18\xaa\xfe\x09\x11\xe3\x79\x92\xd0\x87\x6a\x40\x77\xc4\x2c\x4b\x2f\xa1\xf7\x1f\xe4\x99\x1a\x78\x0c\x79\xbe\x5c\x02\x4d\xcc\x54\xfd\x60\x3a\x07\xd0\x65\x34\xed\x9a\x26\x64\x71\x39\x95\xa3\x54\x33\xbb\xac\xdb\x36\x57\xf5\xaa\xbd\x7e\xb4\x1c\xba\xf3\x3b\xc9\x9c\x45\xe0\xd7\x76\x93\xe7\x70\xe8\xca\x21\xcf\x03\x10\x5f\xd2\x31\x59\xa0\x1f\xc9\x07\x88\x32\x26\xf1\x41\x86\x67\xe6\xff\xc0\x4e\x97\x6a\x66\x8d\xbc\x5e\x26\xbc\x24\xd3\x82\x17\x4c\x85\xfa\x45\x99\x2c\x39\xe8\x03\x72\xae\xfe\x66\x3c\x80\x65\xc7\x5b\x10\x0e\x7e\xc7\xf3\x2c\xf1\x81\x22\x1d\x9e\x1b\x5d\x36\xf9\x0c\x63\xae\x7e\x95\xdd\x41\xd0\xf1\x3c\x81\xa9\xb6\x13\x18\x40\xb1\x48\x38\xc6\x72\xb6\xa3\xec\xb0\xc6\xeb\x59\x96\xce\xa7\x4c\x84\x61\x58\x31\xaa\x27\x0c\xcf\xd5\x4e\x85\x24\x4c\xba\xa2\x0b\xc2\x77\x3c\x9b\xfa\x96\xc4\x27\x72\x93\xe2\x0a\x05\xdd\xaa\xb8\x0a\x3a\x9e\x52\x55\x45\xae\xe3\x79\xcd\xc1\xc3\xf3\x95\xfd\xd1\x38\xf0\xed\x7e\x8a\x25\x0a\xd6\x3a\x9e\x97\x64\x1c\x7e\xeb\xc3\x4c\x9b\x1f\x61\xb7\x08\xcd\xe9\x33\x8e\x31\x8d\x88\x44\xa1\x44\xeb\x79\x33\x77\x31\x2f\x2f\x16\x34\x96\xe0\xf1\xec\x5e\xa8\xa5\x0e\x94\xc0\x3f\x66\xf7\x62\x99\x77\xbc\x2f\x73\xe4\x8f\x7d\x20\xfc\x56\xf7\xd9\xe9\xe1\x2f\xaa\xdd\x0f\x3a\x1e\x4d\xb4\x02\x07\x2b\xb4\x0b\xd5\x98\x81\x91\x7c\xe8\x83\xb3\x56\x1f\x14\xb5\xe0\x8d\x9e\xfb\xd3\x00\x18\x4d\x35\x87\x1c\xe5\x9c\x33\x28\x4d\xbe\xb0\x8f\x8e\xe2\x35\xc6\x04\xb9\x9e\x17\x9e\xa5\x99\x40\x5f\x0b\x04\x7a\xf2\x51\x4b\xa0\x4b\x99\x74\xec\x5f\xa9\xed\xb3\x40\x7e\xae\xa3\x41\x5c\x28\x53\x8d\x1d\x98\xce\x4f\x8f\x33\xac\xb9\x82\x36\x3d\x1a\x0b\xb8\xba\xb6\x43\x55\xab\x92\xb2\x26\x7a\x89\x0f\xd2\xd7\x36\x5a\x8c\x04\x77\xd8\xaa\x7a\x8d\x7e\x1d\xaf\x83\x01\x1c\xd4\x1c\x22\xca\x58\x42\x6f\x4f\x56\x44\x67\xda\xf5\x1a\x85\x78\x4f\x8c\x7c\xdd\xd5\xb4\xf9\x29\x35\xf9\xed\xa2\x6c\x17\x66\x32\x95\xe1\x85\x72\xb6\xc4\xef\xda\x48\x98\xe7\x27\x90\x10\x9a\x62\x0c\x22\x22\x8c\x51\x76\xab\x76\x0c\x94\xc9\x0c\x5c\x86\x4f\xe0\xc5\xa2\xab\x15\xa2\xcc\xc7\x2b\x36\xf9\x12\xd4\xbe\x09\x8b\x8d\x5c\x87\x62\x2c\xb9\x5a\xc2\x67\x99\x5c\xd1\x43\x50\xc8\xc6\xa3\x31\xb4\xec\x89\xc6\x7e\x60\x57\xd5\x86\x4e\x13\xc8\xb8\x5d\xf8\xf3\xe7\xe1\xb9\xfd\x3d\xd4\xde\xb8\x61\xa9\xe1\x79\x6d\x21\x77\x2c\x65\x45\x2c\xa8\x8f\xaf\x28\x17\x06\xd1\x9c\x5d\x29\x43\x1b\xc4\x38\x22\xcc\x3f\xa0\xf1\x33\xc9\x9e\x23\x89\x95\xdc\x68\xdc\x22\xe7\x1a\x5b\xca\x48\x07\x40\x66\x33\x64\xb1\x4f\x63\xd1\x07\x1a\x07\x1d\xeb\xcf\x35\x23\x14\xf7\x54\x46\x13\x60\x8a\xe9\x14\x99\x1a\x1d\xbc\xd1\x3c\x46\x44\x20\x30\x18\x0c\xe0\xf8\xa4\xb3\x86\xe3\x83\x0b\xce\x2f\x33\xf9\x4e\xe5\xe7\xa5\x62\x7f\x3c\xe3\x94\xc9\x82\x7f\x6b\x16\x70\x4f\xe5\xa4\x62\xbb\x25\x86\xe5\x15\xbd\xb7\xf0\x6a\x2d\xb9\x75\x02\x9a\x66\x1c\x41\x4e\x08\x03\xb5\xaf\x55\xd2\x0a\x22\x08\xd5\xb0\x89\x07\x27\xe0\x95\x1a\xa5\x49\x29\x14\x2d\x08\xa3\xbc\x36\xd6\x18\x4d\x57\x23\xa6\x02\x4c\x4a\xdc\x72\x82\x1c\x7f\x56\x78\x64\x8a\x72\xa2\x74\x28\x33\x30\x90\xa3\x0f\x42\x12\x2e\x81\x80\xe4\x84\x09\x12\x49\x9a\xb1\x10\x34\x58\xf1\x54\x50\x74\xbc\xbb\x25\x7a\x7e\x7a\x50\xa1\xb3\x0a\xb3\x5b\x86\x4a\x6b\x06\xe1\x3b\x8a\x69\x2c\xcc\x66\x6d\x66\xf5\x38\x0a\x9d\x54\x3f\xa2\x98\xa7\x52\xb5\x18\x5e\xdd\x8c\xf9\x59\xb7\xac\xc9\x67\x1d\x4f\xe5\x33\x4b\x45\x79\x7e\xe5\xeb\xda\x33\x83\xb6\xf8\xab\x3d\x28\x4e\x48\xa4\xf1\xd0\x94\xdc\xa1\x7f\x75\x4d\x99\x44\xae\xda\x96\x79\xbf\xd4\x85\xb6\x7a\x15\x77\x69\x95\xda\x94\xcd\x2f\x0b\x17\x56\xe3\xaf\xe8\xb5\xf2\xe4\x58\x5c\xd1\xeb\x32\x18\x55\xfb\x28\x7e\x85\xff\x52\xaa\xf1\xd5\x6e\x87\xac\x2d\xff\x37\xd3\xbb\x72\x25\xb5\x7c\x18\x86\x41\xb0\x1a\x01\x36\x13\x18\x32\x29\xb6\x25\x22\x6a\x14\xdc\x80\x63\xf6\xdb\xfb\xad\x0f\xbd\xc4\xa0\x54\x57\x8b\x56\xea\x19\x2f\x84\x9e\x84\xc3\xe9\x74\x2e\xb5\x62\xd4\x93\xd1\xdc\x39\x26\x64\x9e\x56\x21\x32\x81\x05\x49\xe7\xd8\x66\x6a\xea\x39\xb1\xd0\x56\x93\x82\x3c\x7f\x53\x8c\xaf\x05\xb5\xd2\xae\x92\x70\x28\xfe\x36\x1e\x5d\xda\xe5\x15\x5c\x4b\x4a\x5b\xfe\xb7\xc8\x58\xf8\x9e\x70\x31\x21\xa9\x7f\xa8\xd7\x09\x8a\x61\xab\x66\xec\xad\x8b\x96\xda\x96\xf5\x1f\x4b\xc3\x8a\x7c\x8c\xad\x50\xae\x97\xd4\x65\x7c\x33\x4f\x82\x8a\x6d\x37\x09\xec\xbc\x54\x6d\x13\x35\x85\x79\x6d\x89\xbf\x25\xf7\x17\xab\x8e\x25\x9f\x47\xd2\x0a\xd9\xa4\x2d\x9a\x40\xa1\xc8\x4b\x9a\xa6\x4a\x8f\x05\x72\x36\x44\x34\xe9\x56\xca\xe6\xdf\x4a\x27\x0a\xd1\x84\x97\xf3\x29\x72\x1a\x95\x9c\x6c\xd2\x3c\x89\xe3\x1d\x94\x5f\x0a\xed\x34\x8e\x77\x16\x5a\xbb\x94\x1c\xe6\x9d\xbd\xdb\x4e\xc5\xfb\x76\x72\x6c\xda\x93\xe7\x1d\x6e\x37\xf1\x4f\x83\x82\xcd\x72\x66\x6e\x2c\xc5\x59\x6a\x5b\x55\x36\xd6\x71\xb7\x58\x37\xbe\x6d\x97\x5c\x61\xae\x69\x79\x2b\x0d\x95\x45\x54\xad\xab\x4f\x46\xe0\xa3\x99\x4a\x45\x24\x75\x42\xc4\x0a\x0e\x4d\x91\xf0\x56\x0b\x69\x06\x84\x86\xed\x6f\x50\xea\xb6\xd2\x34\x09\x77\x8d\x00\x55\x2a\x33\x26\x6a\x66\x17\x58\x7e\x57\x1a\xae\x70\xdb\xbc\xda\x7d\x76\x22\xc6\xe5\x3c\x4d\xbf\xee\x00\x41\xe5\xa3\xab\x98\xb2\x44\x72\x09\xfc\x64\x57\xbe\x98\xce\xe4\x63\x51\x60\x34\xeb\x2e\x3b\xa6\x2c\xbb\x5c\x30\x2a\x1f\xc2\x8b\x07\x8c\x5a\x8a\xac\x03\x8e\x5b\x57\x06\x3c\x4b\xd3\x1b\x12\xdd\xf9\x05\x2a\x29\xa1\xa7\x8b\x9a\x34\xa8\xb8\x88\x6f\x51\xe8\xd2\xe9\xe8\x10\x90\x49\x0d\xc2\xb2\xb9\x84\x44\xe7\x29\x15\x79\x4d\x1b\xa0\x1e\x69\xc0\x8e\x56\x5a\x13\x7a\xd4\xd1\x54\x2d\xf7\xa1\xc9\x7d\x96\x98\x53\x61\x61\xf8\xfe\xf5\xfb\x0a\x92\x2b\xd4\xd0\xb4\x5c\x8e\xd3\x6c\x81\x3a\xba\x61\x43\xef\x01\xbc\xb5\x40\x4f\xaf\xd8\x23\xce\xa9\x4b\xef\x46\x3d\xbc\xaa\xca\x48\xd4\x80\x66\x81\xbc\x3c\x0f\x20\x50\x0e\xe8\xdd\x40\x39\xd3\xb1\x15\x54\x58\xa5\x06\x71\xfa\x3b\x33\x69\xac\x47\x61\x20\xa4\xf1\xfa\x02\x7f\xc3\x12\xae\x8b\x4a\x9c\xce\x52\x22\x5b\x0f\xc5\x8e\xa2\x4c\xed\x4f\xd2\xb8\xab\x84\xfe\xd2\x1a\x3c\xd6\xaa\x0c\xd4\x65\x06\x1a\x1c\x6d\x03\x4d\xc3\x48\x2d\x76\x3c\xc7\x14\x5b\xb0\xa3\x61\x52\x23\x48\xd7\x4d\x42\x43\x6e\x2b\x1c\x85\xe1\x87\xbf\x3b\x73\xaf\x8c\x3e\xf2\xfc\xba\x42\x54\xfb\x2e\x77\x63\x96\xc3\xc6\x7a\x8e\xe3\xed\xe5\x79\xdb\xbb\x5e\x23\xbd\x63\x38\xc6\x34\xf9\x88\x89\x75\x3c\xe5\x03\xda\xc9\x04\xa6\x09\x70\x4c\x90\x23\x8b\x50\x7b\x9b\x1e\xf0\x69\x74\x3e\x3a\x81\xb9\x40\x18\x7d\xb4\x07\xa9\xba\x08\x23\x37\xd9\x02\x6d\x0d\xd2\xd4\xe3\x9e\x6a\xdc\x5b\xf0\x0d\xb9\xef\x6d\x17\x4d\x45\xd6\x34\xb9\xa7\x2e\x77\xd1\x66\x7b\x72\xae\x1d\x32\x18\x35\x8f\x9e\x29\xb6\xfd\xe8\x51\x68\x4d\x05\xbb\xd9\x7c\x37\x65\x77\x0c\xcd\x11\xf1\xd3\x83\xd7\xca\xfc\xed\xc2\x16\x1a\x64\xbf\xba\x09\xd5\xda\xac\x2c\xbf\x97\xc0\xd5\x38\x3e\xd3\x11\x69\xf4\x7a\xa4\xea\xd6\xf7\xaf\x47\x65\xf0\x59\x87\x3a\x37\x5a\xd3\xf7\xaa\xf1\x9d\x14\xf5\x9d\xe8\x69\x7d\x82\x51\xda\x5a\x97\x60\x36\xe5\x8d\x27\xa9\xe1\xa9\x7a\x78\x3e\xd7\xab\x27\x86\xfd\xf2\xc2\x0e\x69\x61\x63\x56\x70\xca\x84\xb6\xd0\x6d\xb6\xd6\x28\xcd\x9c\x1c\xe0\x1c\xd0\xf5\x30\xfc\xcc\xe8\x97\x39\x3e\x45\xd1\x34\x69\x1e\x20\xeb\x73\xdc\xad\x2d\x6e\xdd\xb9\x6e\x44\xd8\xcf\x12\x52\xca\xee\x34\x0f\xaa\x5a\x80\x5f\xbb\x66\x57\xc5\x01\xef\xaf\x5d\x90\x19\xbc\x88\x41\x27\x87\x08\x05\xf8\x6f\xe1\x55\xd0\xed\x03\x0b\x5c\x2b\xfe\x6a\x8e\x6a\x95\xd5\xbe\xd9\xe9\x39\x03\x91\x76\x81\xed\xad\x57\x25\xc1\x72\x66\xe5\x04\x17\xbf\x6c\x7d\x00\x79\x75\x7c\x1d\x04\xe1\xb7\xb4\xfa\x67\x0d\x20\xbb\x89\xaf\xd8\xff\x7a\x09\xee\x9a\x74\x83\xf0\x94\xc5\x7e\x10\x0e\xc5\x4e\x61\xec\x1b\x2b\x80\x24\x09\x46\x12\xe3\xf2\xec\x96\xa3\xd0\xef\x7e\x4f\x8b\x8e\x06\x63\x7b\x13\xa4\x89\x7e\xfb\x66\xe9\x06\xf0\x97\x5d\x22\xdb\xd6\x74\x0f\xb4\x8c\x39\xa1\x4c\xea\xc0\xb3\x9c\x8a\xdb\x13\xa8\xbd\xc1\x5a\x0d\x34\xfe\x8b\x45\x00\x24\xe5\x48\xe2\x47\x88\x32\xc6\x34\x8b\x2a\xfe\x10\x88\x69\xa2\xc3\xa2\x2c\x02\x54\x35\xad\x6b\xd4\x9f\xd7\xf6\x59\x1d\xfb\x54\xc0\x5e\x15\x6c\xf6\x88\x40\x9f\x3c\xb9\xf0\xbc\x00\xe8\xc7\x8d\x97\x20\xf6\x1d\xbf\x1b\xd9\xaa\x37\x21\x7b\x46\xbd\x27\x87\x3d\xcb\x7e\x89\xcb\xcd\x73\x1f\xf4\x2e\x96\x34\xd6\x22\xc9\xfb\xd0\x86\x2d\xcc\x18\x54\x83\x68\xec\x5c\xa7\xd0\xa9\x48\x65\xa0\x97\x1c\x13\x88\x38\xea\x6b\x0b\xaa\x68\x35\xa7\x48\x94\xc1\x4d\x26\x27\x70\x4f\x1e\x85\x5b\xbc\x36\xcf\xc2\x9f\xff\x3c\xc7\xb9\x0f\x64\x43\xd4\x90\x09\xe4\xeb\xc2\xcd\xba\x10\x55\xdc\x30\xd9\xb5\x82\xdd\xa9\x80\xae\x59\xcd\xa2\x32\x8c\x42\x63\x85\xe6\xed\x36\xfe\xa9\x5b\xfd\xc5\xd5\xf1\x75\x1f\x16\x57\xaf\xae\xb7\xa8\xab\xbe\x15\x50\x5d\xf1\xa6\x91\xd5\xcf\xff\x41\xee\x7f\x72\xea\xdf\xef\xf5\xe3\xf7\x00\x7d\xdb\x94\x5b\x9d\x81\x7c\x25\x00\xea\x9b\x3f\x6a\xf7\x1f\x2c\xf7\xdf\x2a\x24\xce\xc2\x11\xf7\x83\x27\xa3\x87\xb5\xb0\xe8\xf7\x35\xad\x56\xcb\x52\xc0\x66\xd6\xd7\x62\xde\x15\xdd\x7c\x17\x16\xf6\x23\xa3\x9c\x8c\x21\x64\x49\x4b\x55\xf5\x62\xf1\x24\xa8\x73\x87\x8f\x62\xcb\x7d\x6c\x84\x44\x4e\xe9\x59\xa6\xf2\xcd\xae\x5e\xde\x69\xb1\x3e\x54\x5e\x34\x2b\x7d\x50\x83\x0a\x51\xe8\x58\x48\xae\x7c\x35\x3c\x95\x19\xf5\x77\x60\x5b\x95\x05\xd5\xe1\xb0\x78\x9e\x53\xdf\x96\x97\x98\x45\x90\xda\x8d\x33\x67\xb1\x96\x1b\x08\x75\x70\x53\xd0\xf9\x5f\xae\x51\x9f\x5c\x54\x59\xa2\xb5\xb0\xb3\xaa\x83\x6f\x28\x9b\x8d\xa2\xf9\xdd\x8a\xcf\xf5\x72\x72\xcc\xeb\x8f\x70\xfd\x43\x87\x6b\x6b\x09\x8d\xcb\x8f\xe5\xc5\x6f\xf9\x10\x9e\x65\xd3\x29\x95\xfe\x6e\xf7\xb9\xab\xbe\xfa\xf7\x0a\xcd\x0f\x15\x8c\xc7\xda\xb2\xd8\xf9\x70\x80\xd1\xb4\x63\x3e\xf9\xb0\x1f\x33\x6c\xfc\xfa\xc3\x85\x6e\xf6\xbe\x41\xcf\x04\xe1\x32\xa9\x94\x1d\xf6\x52\x16\x8d\x57\x6f\x31\xda\x70\x4b\xe3\x66\x0e\x5a\x9f\x80\x2c\xc6\x6b\x4d\x29\x46\x8e\x35\x5b\x11\xa5\x91\x96\x62\x3a\x3a\x84\xe2\x37\x15\x9a\xb9\x3b\x76\x9f\x31\x20\xd2\x7c\x0c\x33\xcb\x28\x93\x55\x61\xdc\x7c\xb3\x68\x77\xa3\xef\x67\x96\xdc\x2a\x3e\x95\xe9\x17\xec\x35\xaf\x63\x94\x1f\x99\xd8\x5f\xff\x0d\x00\x00\xff\xff\x5b\xd4\x2c\x15\x23\x34\x00\x00") func templateDialectSqlUpdateTmplBytes() ([]byte, error) { return bindataRead( @@ -816,7 +816,7 @@ func templateDialectSqlUpdateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/update.tmpl", size: 13359, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/dialect/sql/update.tmpl", size: 13347, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/base.tmpl b/entc/gen/template/base.tmpl index a73d9bbdc..e8d453b09 100644 --- a/entc/gen/template/base.tmpl +++ b/entc/gen/template/base.tmpl @@ -100,26 +100,27 @@ func IsNotSingular(err error) bool { } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("{{ $pkg }}: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("{{ $pkg }}: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } diff --git a/entc/gen/template/dialect/gremlin/errors.tmpl b/entc/gen/template/dialect/gremlin/errors.tmpl index 1b3909454..70344f6d0 100644 --- a/entc/gen/template/dialect/gremlin/errors.tmpl +++ b/entc/gen/template/dialect/gremlin/errors.tmpl @@ -9,11 +9,11 @@ in the LICENSE file in the root directory of this source tree. {{ $pkg := base $.Config.Package }} // Code implements the dsl.Node interface. -func (e ErrConstraintFailed) Code() (string, []interface{}) { +func (e ConstraintError) Code() (string, []interface{}) { return strconv.Quote(e.prefix() + e.msg), nil } -func (e *ErrConstraintFailed) UnmarshalGraphson(b []byte) error { +func (e *ConstraintError) UnmarshalGraphson(b []byte) error { var v [1]*string if err := graphson.Unmarshal(b, &v); err != nil { return err @@ -29,21 +29,21 @@ func (e *ErrConstraintFailed) UnmarshalGraphson(b []byte) error { } // prefix returns the prefix used for gremlin constants. -func (ErrConstraintFailed) prefix() string { return "Error: " } +func (ConstraintError) 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)} +func NewErrUniqueField(label, field string, v interface{}) *ConstraintError { + return &ConstraintError{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)} +func NewErrUniqueEdge(label, edge, id string) *ConstraintError { + return &ConstraintError{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{} +func isConstantError(r *gremlin.Response) (*ConstraintError, bool) { + e := &ConstraintError{} if err := graphson.Unmarshal(r.Result.Data, e); err != nil { return nil, false } diff --git a/entc/gen/template/dialect/gremlin/update.tmpl b/entc/gen/template/dialect/gremlin/update.tmpl index 193cbbc5d..274535cdd 100644 --- a/entc/gen/template/dialect/gremlin/update.tmpl +++ b/entc/gen/template/dialect/gremlin/update.tmpl @@ -150,7 +150,7 @@ func ({{ $receiver }} *{{ $builder }}) gremlin({{ if $one }}id {{ $.ID.Type }}{{ {{- if not $one }} constraints = append(constraints, &constraint{ pred: rv.Count(), - test: __.Is(p.GT(1)).Constant(&ErrConstraintFailed{msg: "update traversal contains more than one vertex"}), + test: __.Is(p.GT(1)).Constant(&ConstraintError{msg: "update traversal contains more than one vertex"}), }) {{- end }} v = constraints[0].pred.Coalesce(constraints[0].test, v) diff --git a/entc/gen/template/dialect/sql/errors.tmpl b/entc/gen/template/dialect/sql/errors.tmpl index b9536bdcc..ba9c01d36 100644 --- a/entc/gen/template/dialect/sql/errors.tmpl +++ b/entc/gen/template/dialect/sql/errors.tmpl @@ -6,7 +6,7 @@ in the LICENSE file in the root directory of this source tree. {{/* custom errors and errors handlers for sql dialects */}} {{ define "dialect/sql/errors" }} -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -17,11 +17,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/entc/gen/template/dialect/sql/update.tmpl b/entc/gen/template/dialect/sql/update.tmpl index aa32a74e1..d32055851 100644 --- a/entc/gen/template/dialect/sql/update.tmpl +++ b/entc/gen/template/dialect/sql/update.tmpl @@ -226,7 +226,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }} return {{ $zero }}, rollback(tx, err) } if int(affected) < len({{ $receiver }}.{{ $e.BuilderField }}) { - return {{ $zero }}, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("\"{{ $e.Name }}\" (%v) already connected to a different \"{{ $.Name }}\"", eid)}) + return {{ $zero }}, rollback(tx, &ConstraintError{msg: fmt.Sprintf("\"{{ $e.Name }}\" (%v) already connected to a different \"{{ $.Name }}\"", eid)}) } } {{- else if $e.M2M }} @@ -277,7 +277,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }} return {{ $zero }}, rollback(tx, err) } if int(affected) < len({{ $receiver }}.{{ $e.BuilderField }}) { - return {{ $zero }}, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"{{ $e.Name }}\" %v already connected to a different \"{{ $.Name }}\"", keys({{ $receiver }}.{{ $e.BuilderField }}))}) + return {{ $zero }}, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"{{ $e.Name }}\" %v already connected to a different \"{{ $.Name }}\"", keys({{ $receiver }}.{{ $e.BuilderField }}))}) } } {{- else }}{{/* O2O */}} @@ -309,7 +309,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }} return {{ $zero }}, rollback(tx, err) } if int(affected) < len({{ $receiver }}.{{ $e.BuilderField }}) { - return {{ $zero }}, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"{{ $e.Name }}\" %v already connected to a different \"{{ $.Name }}\"", keys({{ $receiver }}.{{ $e.BuilderField }}))}) + return {{ $zero }}, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"{{ $e.Name }}\" %v already connected to a different \"{{ $.Name }}\"", keys({{ $receiver }}.{{ $e.BuilderField }}))}) } } {{- end }} diff --git a/entc/integration/config/ent/ent.go b/entc/integration/config/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/entc/integration/config/ent/ent.go +++ b/entc/integration/config/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/entc/integration/customid/customid_test.go b/entc/integration/customid/customid_test.go index 8075e434a..48a622f34 100644 --- a/entc/integration/customid/customid_test.go +++ b/entc/integration/customid/customid_test.go @@ -26,7 +26,7 @@ func TestCustomID(t *testing.T) { nat := client.User.Create().SaveX(ctx) require.Equal(t, 1, nat.ID) _, err = client.User.Create().SetID(1).Save(ctx) - require.True(t, ent.IsConstraintFailure(err), "duplicate id") + require.True(t, ent.IsConstraintError(err), "duplicate id") a8m := client.User.Create().SetID(5).SaveX(ctx) require.Equal(t, 5, a8m.ID) diff --git a/entc/integration/customid/ent/ent.go b/entc/integration/customid/ent/ent.go index ab3459cac..b7f33d3a9 100644 --- a/entc/integration/customid/ent/ent.go +++ b/entc/integration/customid/ent/ent.go @@ -128,30 +128,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -162,11 +163,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/entc/integration/ent/card_update.go b/entc/integration/ent/card_update.go index b70792989..7c0508625 100644 --- a/entc/integration/ent/card_update.go +++ b/entc/integration/ent/card_update.go @@ -204,7 +204,7 @@ func (cu *CardUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(cu.owner) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"owner\" %v already connected to a different \"Card\"", keys(cu.owner))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"owner\" %v already connected to a different \"Card\"", keys(cu.owner))}) } } } @@ -400,7 +400,7 @@ func (cuo *CardUpdateOne) sqlSave(ctx context.Context) (c *Card, err error) { return nil, rollback(tx, err) } if int(affected) < len(cuo.owner) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"owner\" %v already connected to a different \"Card\"", keys(cuo.owner))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"owner\" %v already connected to a different \"Card\"", keys(cuo.owner))}) } } } diff --git a/entc/integration/ent/ent.go b/entc/integration/ent/ent.go index 9c6cf0774..6e361e20b 100644 --- a/entc/integration/ent/ent.go +++ b/entc/integration/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/entc/integration/ent/filetype_update.go b/entc/integration/ent/filetype_update.go index 814a7b4f1..f33a122c9 100644 --- a/entc/integration/ent/filetype_update.go +++ b/entc/integration/ent/filetype_update.go @@ -192,7 +192,7 @@ func (ftu *FileTypeUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(ftu.files) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"FileType\"", keys(ftu.files))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"FileType\"", keys(ftu.files))}) } } } @@ -375,7 +375,7 @@ func (ftuo *FileTypeUpdateOne) sqlSave(ctx context.Context) (ft *FileType, err e return nil, rollback(tx, err) } if int(affected) < len(ftuo.files) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"FileType\"", keys(ftuo.files))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"FileType\"", keys(ftuo.files))}) } } } diff --git a/entc/integration/ent/group_update.go b/entc/integration/ent/group_update.go index 4f49e576a..e246f74ab 100644 --- a/entc/integration/ent/group_update.go +++ b/entc/integration/ent/group_update.go @@ -424,7 +424,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(gu.files) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"Group\"", keys(gu.files))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"Group\"", keys(gu.files))}) } } } @@ -470,7 +470,7 @@ func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(gu.blocked) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"blocked\" %v already connected to a different \"Group\"", keys(gu.blocked))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"blocked\" %v already connected to a different \"Group\"", keys(gu.blocked))}) } } } @@ -954,7 +954,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (gr *Group, err error) { return nil, rollback(tx, err) } if int(affected) < len(guo.files) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"Group\"", keys(guo.files))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"Group\"", keys(guo.files))}) } } } @@ -1000,7 +1000,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (gr *Group, err error) { return nil, rollback(tx, err) } if int(affected) < len(guo.blocked) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"blocked\" %v already connected to a different \"Group\"", keys(guo.blocked))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"blocked\" %v already connected to a different \"Group\"", keys(guo.blocked))}) } } } diff --git a/entc/integration/ent/groupinfo_update.go b/entc/integration/ent/groupinfo_update.go index f96d77b93..5ffb80a68 100644 --- a/entc/integration/ent/groupinfo_update.go +++ b/entc/integration/ent/groupinfo_update.go @@ -225,7 +225,7 @@ func (giu *GroupInfoUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(giu.groups) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"groups\" %v already connected to a different \"GroupInfo\"", keys(giu.groups))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"groups\" %v already connected to a different \"GroupInfo\"", keys(giu.groups))}) } } } @@ -443,7 +443,7 @@ func (giuo *GroupInfoUpdateOne) sqlSave(ctx context.Context) (gi *GroupInfo, err return nil, rollback(tx, err) } if int(affected) < len(giuo.groups) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"groups\" %v already connected to a different \"GroupInfo\"", keys(giuo.groups))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"groups\" %v already connected to a different \"GroupInfo\"", keys(giuo.groups))}) } } } diff --git a/entc/integration/ent/node_update.go b/entc/integration/ent/node_update.go index 3adb6086d..40b28c023 100644 --- a/entc/integration/ent/node_update.go +++ b/entc/integration/ent/node_update.go @@ -235,7 +235,7 @@ func (nu *NodeUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(nu.prev) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"prev\" %v already connected to a different \"Node\"", keys(nu.prev))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"prev\" %v already connected to a different \"Node\"", keys(nu.prev))}) } } } @@ -266,7 +266,7 @@ func (nu *NodeUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(nu.next) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"next\" %v already connected to a different \"Node\"", keys(nu.next))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"next\" %v already connected to a different \"Node\"", keys(nu.next))}) } } } @@ -495,7 +495,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) { return nil, rollback(tx, err) } if int(affected) < len(nuo.prev) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"prev\" %v already connected to a different \"Node\"", keys(nuo.prev))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"prev\" %v already connected to a different \"Node\"", keys(nuo.prev))}) } } } @@ -526,7 +526,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) { return nil, rollback(tx, err) } if int(affected) < len(nuo.next) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"next\" %v already connected to a different \"Node\"", keys(nuo.next))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"next\" %v already connected to a different \"Node\"", keys(nuo.next))}) } } } diff --git a/entc/integration/ent/pet_update.go b/entc/integration/ent/pet_update.go index 70d7112d6..364c0ca8e 100644 --- a/entc/integration/ent/pet_update.go +++ b/entc/integration/ent/pet_update.go @@ -202,7 +202,7 @@ func (pu *PetUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(pu.team) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"team\" %v already connected to a different \"Pet\"", keys(pu.team))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"team\" %v already connected to a different \"Pet\"", keys(pu.team))}) } } } @@ -419,7 +419,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (pe *Pet, err error) { return nil, rollback(tx, err) } if int(affected) < len(puo.team) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"team\" %v already connected to a different \"Pet\"", keys(puo.team))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"team\" %v already connected to a different \"Pet\"", keys(puo.team))}) } } } diff --git a/entc/integration/ent/user_update.go b/entc/integration/ent/user_update.go index db578bfb2..e255fc1ee 100644 --- a/entc/integration/ent/user_update.go +++ b/entc/integration/ent/user_update.go @@ -694,7 +694,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.card) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"card\" %v already connected to a different \"User\"", keys(uu.card))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"card\" %v already connected to a different \"User\"", keys(uu.card))}) } } } @@ -740,7 +740,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.pets) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uu.pets))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uu.pets))}) } } } @@ -786,7 +786,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.files) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"User\"", keys(uu.files))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"User\"", keys(uu.files))}) } } } @@ -984,7 +984,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.team) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"team\" %v already connected to a different \"User\"", keys(uu.team))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"team\" %v already connected to a different \"User\"", keys(uu.team))}) } } } @@ -1031,7 +1031,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.spouse) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) } } } @@ -1077,7 +1077,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.children) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"children\" %v already connected to a different \"User\"", keys(uu.children))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"children\" %v already connected to a different \"User\"", keys(uu.children))}) } } } @@ -1796,7 +1796,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.card) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"card\" %v already connected to a different \"User\"", keys(uuo.card))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"card\" %v already connected to a different \"User\"", keys(uuo.card))}) } } } @@ -1842,7 +1842,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.pets) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uuo.pets))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uuo.pets))}) } } } @@ -1888,7 +1888,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.files) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"User\"", keys(uuo.files))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"files\" %v already connected to a different \"User\"", keys(uuo.files))}) } } } @@ -2086,7 +2086,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.team) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"team\" %v already connected to a different \"User\"", keys(uuo.team))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"team\" %v already connected to a different \"User\"", keys(uuo.team))}) } } } @@ -2133,7 +2133,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.spouse) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) } } } @@ -2179,7 +2179,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.children) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"children\" %v already connected to a different \"User\"", keys(uuo.children))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"children\" %v already connected to a different \"User\"", keys(uuo.children))}) } } } diff --git a/entc/integration/gremlin/ent/card_update.go b/entc/integration/gremlin/ent/card_update.go index 68c80e74c..9cb89a4cc 100644 --- a/entc/integration/gremlin/ent/card_update.go +++ b/entc/integration/gremlin/ent/card_update.go @@ -185,7 +185,7 @@ func (cu *CardUpdate) gremlin() *dsl.Traversal { if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), - test: __.Is(p.GT(1)).Constant(&ErrConstraintFailed{msg: "update traversal contains more than one vertex"}), + test: __.Is(p.GT(1)).Constant(&ConstraintError{msg: "update traversal contains more than one vertex"}), }) v = constraints[0].pred.Coalesce(constraints[0].test, v) for _, cr := range constraints[1:] { diff --git a/entc/integration/gremlin/ent/comment_update.go b/entc/integration/gremlin/ent/comment_update.go index c5c11d5f6..7c8adb56a 100644 --- a/entc/integration/gremlin/ent/comment_update.go +++ b/entc/integration/gremlin/ent/comment_update.go @@ -206,7 +206,7 @@ func (cu *CommentUpdate) gremlin() *dsl.Traversal { if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), - test: __.Is(p.GT(1)).Constant(&ErrConstraintFailed{msg: "update traversal contains more than one vertex"}), + test: __.Is(p.GT(1)).Constant(&ConstraintError{msg: "update traversal contains more than one vertex"}), }) v = constraints[0].pred.Coalesce(constraints[0].test, v) for _, cr := range constraints[1:] { diff --git a/entc/integration/gremlin/ent/ent.go b/entc/integration/gremlin/ent/ent.go index b7dfc9213..1c06717ec 100644 --- a/entc/integration/gremlin/ent/ent.go +++ b/entc/integration/gremlin/ent/ent.go @@ -175,35 +175,36 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } // Code implements the dsl.Node interface. -func (e ErrConstraintFailed) Code() (string, []interface{}) { +func (e ConstraintError) Code() (string, []interface{}) { return strconv.Quote(e.prefix() + e.msg), nil } -func (e *ErrConstraintFailed) UnmarshalGraphson(b []byte) error { +func (e *ConstraintError) UnmarshalGraphson(b []byte) error { var v [1]*string if err := graphson.Unmarshal(b, &v); err != nil { return err @@ -219,21 +220,21 @@ func (e *ErrConstraintFailed) UnmarshalGraphson(b []byte) error { } // prefix returns the prefix used for gremlin constants. -func (ErrConstraintFailed) prefix() string { return "Error: " } +func (ConstraintError) 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)} +func NewErrUniqueField(label, field string, v interface{}) *ConstraintError { + return &ConstraintError{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)} +func NewErrUniqueEdge(label, edge, id string) *ConstraintError { + return &ConstraintError{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{} +func isConstantError(r *gremlin.Response) (*ConstraintError, bool) { + e := &ConstraintError{} if err := graphson.Unmarshal(r.Result.Data, e); err != nil { return nil, false } diff --git a/entc/integration/gremlin/ent/filetype_update.go b/entc/integration/gremlin/ent/filetype_update.go index a34774a9f..ca3cf1649 100644 --- a/entc/integration/gremlin/ent/filetype_update.go +++ b/entc/integration/gremlin/ent/filetype_update.go @@ -156,7 +156,7 @@ func (ftu *FileTypeUpdate) gremlin() *dsl.Traversal { if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), - test: __.Is(p.GT(1)).Constant(&ErrConstraintFailed{msg: "update traversal contains more than one vertex"}), + test: __.Is(p.GT(1)).Constant(&ConstraintError{msg: "update traversal contains more than one vertex"}), }) v = constraints[0].pred.Coalesce(constraints[0].test, v) for _, cr := range constraints[1:] { diff --git a/entc/integration/gremlin/ent/group_update.go b/entc/integration/gremlin/ent/group_update.go index ef214fd5f..108a6ad27 100644 --- a/entc/integration/gremlin/ent/group_update.go +++ b/entc/integration/gremlin/ent/group_update.go @@ -413,7 +413,7 @@ func (gu *GroupUpdate) gremlin() *dsl.Traversal { if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), - test: __.Is(p.GT(1)).Constant(&ErrConstraintFailed{msg: "update traversal contains more than one vertex"}), + test: __.Is(p.GT(1)).Constant(&ConstraintError{msg: "update traversal contains more than one vertex"}), }) v = constraints[0].pred.Coalesce(constraints[0].test, v) for _, cr := range constraints[1:] { diff --git a/entc/integration/gremlin/ent/groupinfo_update.go b/entc/integration/gremlin/ent/groupinfo_update.go index 63f871bf6..be4cc9889 100644 --- a/entc/integration/gremlin/ent/groupinfo_update.go +++ b/entc/integration/gremlin/ent/groupinfo_update.go @@ -186,7 +186,7 @@ func (giu *GroupInfoUpdate) gremlin() *dsl.Traversal { if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), - test: __.Is(p.GT(1)).Constant(&ErrConstraintFailed{msg: "update traversal contains more than one vertex"}), + test: __.Is(p.GT(1)).Constant(&ConstraintError{msg: "update traversal contains more than one vertex"}), }) v = constraints[0].pred.Coalesce(constraints[0].test, v) for _, cr := range constraints[1:] { diff --git a/entc/integration/gremlin/ent/node_update.go b/entc/integration/gremlin/ent/node_update.go index 4aeea9414..95a1c628c 100644 --- a/entc/integration/gremlin/ent/node_update.go +++ b/entc/integration/gremlin/ent/node_update.go @@ -226,7 +226,7 @@ func (nu *NodeUpdate) gremlin() *dsl.Traversal { if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), - test: __.Is(p.GT(1)).Constant(&ErrConstraintFailed{msg: "update traversal contains more than one vertex"}), + test: __.Is(p.GT(1)).Constant(&ConstraintError{msg: "update traversal contains more than one vertex"}), }) v = constraints[0].pred.Coalesce(constraints[0].test, v) for _, cr := range constraints[1:] { diff --git a/entc/integration/gremlin/ent/pet_update.go b/entc/integration/gremlin/ent/pet_update.go index 64006378f..a627c1aec 100644 --- a/entc/integration/gremlin/ent/pet_update.go +++ b/entc/integration/gremlin/ent/pet_update.go @@ -185,7 +185,7 @@ func (pu *PetUpdate) gremlin() *dsl.Traversal { if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), - test: __.Is(p.GT(1)).Constant(&ErrConstraintFailed{msg: "update traversal contains more than one vertex"}), + test: __.Is(p.GT(1)).Constant(&ConstraintError{msg: "update traversal contains more than one vertex"}), }) v = constraints[0].pred.Coalesce(constraints[0].test, v) for _, cr := range constraints[1:] { diff --git a/entc/integration/gremlin/ent/user_update.go b/entc/integration/gremlin/ent/user_update.go index 6f8e3da62..6faab8975 100644 --- a/entc/integration/gremlin/ent/user_update.go +++ b/entc/integration/gremlin/ent/user_update.go @@ -773,7 +773,7 @@ func (uu *UserUpdate) gremlin() *dsl.Traversal { if len(constraints) > 0 { constraints = append(constraints, &constraint{ pred: rv.Count(), - test: __.Is(p.GT(1)).Constant(&ErrConstraintFailed{msg: "update traversal contains more than one vertex"}), + test: __.Is(p.GT(1)).Constant(&ConstraintError{msg: "update traversal contains more than one vertex"}), }) v = constraints[0].pred.Coalesce(constraints[0].test, v) for _, cr := range constraints[1:] { diff --git a/entc/integration/gremlin/gremlin_test.go b/entc/integration/gremlin/gremlin_test.go index 9c0f7d5c9..3321758dc 100644 --- a/entc/integration/gremlin/gremlin_test.go +++ b/entc/integration/gremlin/gremlin_test.go @@ -350,7 +350,7 @@ func AddValues(t *testing.T, client *ent.Client) { cmt1 := client.Comment.Create().SetUniqueInt(1).SetUniqueFloat(10).SaveX(ctx) err := cmt1.Update().AddUniqueInt(10).Exec(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) cmt1 = cmt1.Update().AddUniqueInt(20).AddNillableInt(20).SaveX(ctx) require.Equal(21, cmt1.UniqueInt) require.Equal(20, *cmt1.NillableInt) @@ -656,56 +656,56 @@ func UniqueConstraint(t *testing.T, client *ent.Client) { t.Log("unique constraint violation on 1 field") foo := client.User.Create().SetAge(1).SetName("foo").SetNickname("baz").SaveX(ctx) _, err := client.User.Create().SetAge(1).SetName("bar").SetNickname("baz").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) bar := client.User.Create().SetAge(1).SetName("bar").SetNickname("bar").SetPhone("1").SaveX(ctx) t.Log("unique constraint violation on 2 fields") _, err = client.User.Create().SetAge(1).SetName("baz").SetNickname("bar").SetPhone("1").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) _, err = client.User.Create().SetAge(1).SetName("baz").SetNickname("qux").SetPhone("1").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) _, err = client.User.Create().SetAge(1).SetName("baz").SetNickname("bar").SetPhone("2").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) client.User.Create().SetAge(1).SetName("baz").SetNickname("qux").SetPhone("2").SaveX(ctx) _, err = client.User.UpdateOne(foo).SetNickname("bar").SetPhone("1").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) _, err = client.User.UpdateOne(foo).SetNickname("bar").SetPhone("2").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) t.Log("o2o unique constraint on creation") dan := client.User.Create().SetAge(1).SetName("dan").SetNickname("dan").SetSpouse(foo).SaveX(ctx) require.Equal(dan.Name, foo.QuerySpouse().OnlyX(ctx).Name) _, err = client.User.Create().SetAge(1).SetName("b").SetSpouse(foo).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) t.Log("o2m/m2o unique constraint on creation") c1 := client.User.Create().SetAge(1).SetName("c1").SetNickname("c1").SetParent(foo).SaveX(ctx) c2 := client.User.Create().SetAge(1).SetName("c2").SetNickname("c2").SetParent(foo).SaveX(ctx) _, err = client.User.Create().SetAge(10).SetName("z").SetNickname("z").AddChildren(c1).Save(ctx) - require.True(ent.IsConstraintFailure(err), "c1 already has a parent") + require.True(ent.IsConstraintError(err), "c1 already has a parent") _, err = client.User.Create().SetAge(10).SetName("z").SetNickname("z").AddChildren(c2).Save(ctx) - require.True(ent.IsConstraintFailure(err), "c2 already has a parent") + require.True(ent.IsConstraintError(err), "c2 already has a parent") _, err = client.User.Create().SetAge(10).SetName("z").SetNickname("z").AddChildren(c1, c2).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) inf := client.GroupInfo.Create().SetDesc("desc").SaveX(ctx) grp := client.Group.Create().SetName("Github").SetExpire(time.Now()).SetInfo(inf).SaveX(ctx) _, err = client.GroupInfo.Create().SetDesc("desc").AddGroups(grp).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) p1 := client.Pet.Create().SetName("p1").SetOwner(foo).SaveX(ctx) p2 := client.Pet.Create().SetName("p2").SetOwner(foo).SaveX(ctx) _, err = client.User.Create().SetAge(10).SetName("new-owner").AddPets(p1, p2).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) err = client.User.UpdateOne(c2).SetNickname(c1.Nickname).Exec(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) t.Log("o2o unique constraint on update") err = client.User.UpdateOne(bar).SetSpouse(foo).Exec(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) err = client.User.UpdateOne(foo).SetSpouse(bar).Exec(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) client.User.UpdateOne(bar).ClearSpouse().ExecX(ctx) client.User.UpdateOne(foo).ClearSpouse().SetSpouse(bar).ExecX(ctx) require.False(dan.QuerySpouse().ExistX(ctx)) @@ -714,13 +714,13 @@ func UniqueConstraint(t *testing.T, client *ent.Client) { t.Log("o2m unique constraint on update") _, err = client.User.UpdateOne(bar).SetAge(1).SetName("new-owner").AddPets(p1).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) _, err = client.User.UpdateOne(bar).SetAge(1).SetName("new-owner").AddPets(p1, p2).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) t.Log("unique constraint violation when updating more than 1 vertex") err = client.User.Update().SetNickname("yada").Exec(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) require.False(client.User.Query().Where(user.Nickname("yada")).ExistX(ctx)) client.User.Update().Where(user.Nickname("dan")).SetNickname("yada").ExecX(ctx) require.False(client.User.Query().Where(user.Nickname("dan")).ExistX(ctx)) diff --git a/entc/integration/idtype/ent/ent.go b/entc/integration/idtype/ent/ent.go index 66c12a0be..fa220b242 100644 --- a/entc/integration/idtype/ent/ent.go +++ b/entc/integration/idtype/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/entc/integration/idtype/ent/user_update.go b/entc/integration/idtype/ent/user_update.go index 94c3962ae..aa199f817 100644 --- a/entc/integration/idtype/ent/user_update.go +++ b/entc/integration/idtype/ent/user_update.go @@ -263,7 +263,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.spouse) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) } } } @@ -582,7 +582,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.spouse) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) } } } diff --git a/entc/integration/index_test.go b/entc/integration/index_test.go index 35800d245..6550435a6 100644 --- a/entc/integration/index_test.go +++ b/entc/integration/index_test.go @@ -24,7 +24,7 @@ func Indexes(t *testing.T, client *ent.Client) { f2, err := client.File.Create().SetName("foo").SetSize(10).SetUser("bar").Save(ctx) require.Nil(f2) require.Error(err) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) t.Log("deletion should allow recreation") client.File.DeleteOne(f1).ExecX(ctx) @@ -44,27 +44,27 @@ func Indexes(t *testing.T, client *ent.Client) { require.NoError(err) err = a8m.Update().AddFiles(f5).Exec(ctx) require.Error(err) - require.True(ent.IsConstraintFailure(err), "cannot have 2 files with the same (name, type, owner)") + require.True(ent.IsConstraintError(err), "cannot have 2 files with the same (name, type, owner)") png.Update().RemoveFiles(f5).ExecX(ctx) err = a8m.Update().AddFiles(f5).Exec(ctx) require.NoError(err) err = png.Update().AddFiles(f5).Exec(ctx) require.Error(err) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) a8m.Update().RemoveFiles(f4, f5).ExecX(ctx) png.Update().AddFiles(f5).ExecX(ctx) t.Log("prevent inserting duplicates files in the same insert") err = a8m.Update().AddFiles(f4, f5).Exec(ctx) require.Error(err) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) require.Zero(a8m.QueryFiles().CountX(ctx)) t.Log("edge indexes should applied on the edge sub-graph") nati := client.User.Create().SetName("nati").SetAge(18).AddFiles(f5).SaveX(ctx) err = nati.Update().AddFiles(f4).Exec(ctx) require.Error(err) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) err = a8m.Update().AddFiles(f4).Exec(ctx) require.NoError(err) diff --git a/entc/integration/integration_test.go b/entc/integration/integration_test.go index b26534391..a2691a447 100644 --- a/entc/integration/integration_test.go +++ b/entc/integration/integration_test.go @@ -393,7 +393,7 @@ func AddValues(t *testing.T, client *ent.Client) { cmt1 := client.Comment.Create().SetUniqueInt(1).SetUniqueFloat(10).SaveX(ctx) err := cmt1.Update().AddUniqueInt(10).Exec(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) cmt1 = cmt1.Update().AddUniqueInt(20).AddNillableInt(20).SaveX(ctx) require.Equal(21, cmt1.UniqueInt) require.Equal(20, *cmt1.NillableInt) @@ -699,56 +699,56 @@ func UniqueConstraint(t *testing.T, client *ent.Client) { t.Log("unique constraint violation on 1 field") foo := client.User.Create().SetAge(1).SetName("foo").SetNickname("baz").SaveX(ctx) _, err := client.User.Create().SetAge(1).SetName("bar").SetNickname("baz").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) bar := client.User.Create().SetAge(1).SetName("bar").SetNickname("bar").SetPhone("1").SaveX(ctx) t.Log("unique constraint violation on 2 fields") _, err = client.User.Create().SetAge(1).SetName("baz").SetNickname("bar").SetPhone("1").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) _, err = client.User.Create().SetAge(1).SetName("baz").SetNickname("qux").SetPhone("1").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) _, err = client.User.Create().SetAge(1).SetName("baz").SetNickname("bar").SetPhone("2").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) client.User.Create().SetAge(1).SetName("baz").SetNickname("qux").SetPhone("2").SaveX(ctx) _, err = client.User.UpdateOne(foo).SetNickname("bar").SetPhone("1").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) _, err = client.User.UpdateOne(foo).SetNickname("bar").SetPhone("2").Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) t.Log("o2o unique constraint on creation") dan := client.User.Create().SetAge(1).SetName("dan").SetNickname("dan").SetSpouse(foo).SaveX(ctx) require.Equal(dan.Name, foo.QuerySpouse().OnlyX(ctx).Name) _, err = client.User.Create().SetAge(1).SetName("b").SetSpouse(foo).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) t.Log("o2m/m2o unique constraint on creation") c1 := client.User.Create().SetAge(1).SetName("c1").SetNickname("c1").SetParent(foo).SaveX(ctx) c2 := client.User.Create().SetAge(1).SetName("c2").SetNickname("c2").SetParent(foo).SaveX(ctx) _, err = client.User.Create().SetAge(10).SetName("z").SetNickname("z").AddChildren(c1).Save(ctx) - require.True(ent.IsConstraintFailure(err), "c1 already has a parent") + require.True(ent.IsConstraintError(err), "c1 already has a parent") _, err = client.User.Create().SetAge(10).SetName("z").SetNickname("z").AddChildren(c2).Save(ctx) - require.True(ent.IsConstraintFailure(err), "c2 already has a parent") + require.True(ent.IsConstraintError(err), "c2 already has a parent") _, err = client.User.Create().SetAge(10).SetName("z").SetNickname("z").AddChildren(c1, c2).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) inf := client.GroupInfo.Create().SetDesc("desc").SaveX(ctx) grp := client.Group.Create().SetName("Github").SetExpire(time.Now()).SetInfo(inf).SaveX(ctx) _, err = client.GroupInfo.Create().SetDesc("desc").AddGroups(grp).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) p1 := client.Pet.Create().SetName("p1").SetOwner(foo).SaveX(ctx) p2 := client.Pet.Create().SetName("p2").SetOwner(foo).SaveX(ctx) _, err = client.User.Create().SetAge(10).SetName("new-owner").AddPets(p1, p2).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) err = client.User.UpdateOne(c2).SetNickname(c1.Nickname).Exec(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) t.Log("o2o unique constraint on update") err = client.User.UpdateOne(bar).SetSpouse(foo).Exec(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) err = client.User.UpdateOne(foo).SetSpouse(bar).Exec(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) client.User.UpdateOne(bar).ClearSpouse().ExecX(ctx) client.User.UpdateOne(foo).ClearSpouse().SetSpouse(bar).ExecX(ctx) require.False(dan.QuerySpouse().ExistX(ctx)) @@ -757,13 +757,13 @@ func UniqueConstraint(t *testing.T, client *ent.Client) { t.Log("o2m unique constraint on update") _, err = client.User.UpdateOne(bar).SetAge(1).SetName("new-owner").AddPets(p1).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) _, err = client.User.UpdateOne(bar).SetAge(1).SetName("new-owner").AddPets(p1, p2).Save(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) t.Log("unique constraint violation when updating more than 1 vertex") err = client.User.Update().SetNickname("yada").Exec(ctx) - require.True(ent.IsConstraintFailure(err)) + require.True(ent.IsConstraintError(err)) require.False(client.User.Query().Where(user.Nickname("yada")).ExistX(ctx)) client.User.Update().Where(user.Nickname("dan")).SetNickname("yada").ExecX(ctx) require.False(client.User.Query().Where(user.Nickname("dan")).ExistX(ctx)) diff --git a/entc/integration/json/ent/ent.go b/entc/integration/json/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/entc/integration/json/ent/ent.go +++ b/entc/integration/json/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/entc/integration/migrate/entv1/ent.go b/entc/integration/migrate/entv1/ent.go index 9a6dc82a7..c755e14d1 100644 --- a/entc/integration/migrate/entv1/ent.go +++ b/entc/integration/migrate/entv1/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("entv1: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("entv1: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/entc/integration/migrate/entv2/ent.go b/entc/integration/migrate/entv2/ent.go index 668c461a9..fd74c62cd 100644 --- a/entc/integration/migrate/entv2/ent.go +++ b/entc/integration/migrate/entv2/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("entv2: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("entv2: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/entc/integration/migrate/migrate_test.go b/entc/integration/migrate/migrate_test.go index 6472e183c..eafb69187 100644 --- a/entc/integration/migrate/migrate_test.go +++ b/entc/integration/migrate/migrate_test.go @@ -165,7 +165,7 @@ func SanityV2(t *testing.T, client *entv2.Client) { // new unique index was added to (age, phone). _, err = client.User.Create().SetAge(1).SetName("foo").SetPhone("200").SetNickname("nick_bar").Save(ctx) require.Error(t, err) - require.True(t, entv2.IsConstraintFailure(err)) + require.True(t, entv2.IsConstraintError(err)) // ensure all rows in the database have the same default for the `title` column. require.Equal( diff --git a/entc/integration/template/ent/ent.go b/entc/integration/template/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/entc/integration/template/ent/ent.go +++ b/entc/integration/template/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/entc/integration/template/ent/user_update.go b/entc/integration/template/ent/user_update.go index a996a41ef..be10c3141 100644 --- a/entc/integration/template/ent/user_update.go +++ b/entc/integration/template/ent/user_update.go @@ -223,7 +223,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.pets) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uu.pets))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uu.pets))}) } } } @@ -475,7 +475,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.pets) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uuo.pets))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uuo.pets))}) } } } diff --git a/examples/edgeindex/ent/city_create.go b/examples/edgeindex/ent/city_create.go index 6cf3daddd..684b5dda7 100644 --- a/examples/edgeindex/ent/city_create.go +++ b/examples/edgeindex/ent/city_create.go @@ -110,9 +110,7 @@ func (cc *CityCreate) sqlSave(ctx context.Context) (*City, error) { } return nil, err } - id := spec.ID.Value.(int64) c.ID = int(id) - return c, nil } diff --git a/examples/edgeindex/ent/city_update.go b/examples/edgeindex/ent/city_update.go index 964c99dfe..d527d6551 100644 --- a/examples/edgeindex/ent/city_update.go +++ b/examples/edgeindex/ent/city_update.go @@ -181,7 +181,7 @@ func (cu *CityUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(cu.streets) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"streets\" %v already connected to a different \"City\"", keys(cu.streets))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"streets\" %v already connected to a different \"City\"", keys(cu.streets))}) } } } @@ -354,7 +354,7 @@ func (cuo *CityUpdateOne) sqlSave(ctx context.Context) (c *City, err error) { return nil, rollback(tx, err) } if int(affected) < len(cuo.streets) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"streets\" %v already connected to a different \"City\"", keys(cuo.streets))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"streets\" %v already connected to a different \"City\"", keys(cuo.streets))}) } } } diff --git a/examples/edgeindex/ent/ent.go b/examples/edgeindex/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/edgeindex/ent/ent.go +++ b/examples/edgeindex/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/edgeindex/ent/street_create.go b/examples/edgeindex/ent/street_create.go index 916430a4d..a76def9df 100644 --- a/examples/edgeindex/ent/street_create.go +++ b/examples/edgeindex/ent/street_create.go @@ -115,9 +115,7 @@ func (sc *StreetCreate) sqlSave(ctx context.Context) (*Street, error) { } return nil, err } - id := spec.ID.Value.(int64) s.ID = int(id) - return s, nil } diff --git a/examples/entcpkg/ent/ent.go b/examples/entcpkg/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/entcpkg/ent/ent.go +++ b/examples/entcpkg/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/entcpkg/ent/user_create.go b/examples/entcpkg/ent/user_create.go index 9eb0108db..c80e7586b 100644 --- a/examples/entcpkg/ent/user_create.go +++ b/examples/entcpkg/ent/user_create.go @@ -50,9 +50,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return nil, err } - id := spec.ID.Value.(int64) u.ID = int(id) - return u, nil } diff --git a/examples/m2m2types/ent/ent.go b/examples/m2m2types/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/m2m2types/ent/ent.go +++ b/examples/m2m2types/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/m2m2types/ent/group_create.go b/examples/m2m2types/ent/group_create.go index e7893963b..8933ff2bf 100644 --- a/examples/m2m2types/ent/group_create.go +++ b/examples/m2m2types/ent/group_create.go @@ -110,9 +110,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { } return nil, err } - id := spec.ID.Value.(int64) gr.ID = int(id) - return gr, nil } diff --git a/examples/m2m2types/ent/user_create.go b/examples/m2m2types/ent/user_create.go index 7e79e6271..0ffe41aa2 100644 --- a/examples/m2m2types/ent/user_create.go +++ b/examples/m2m2types/ent/user_create.go @@ -128,9 +128,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return nil, err } - id := spec.ID.Value.(int64) u.ID = int(id) - return u, nil } diff --git a/examples/m2mbidi/ent/ent.go b/examples/m2mbidi/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/m2mbidi/ent/ent.go +++ b/examples/m2mbidi/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/m2mbidi/ent/user_create.go b/examples/m2mbidi/ent/user_create.go index 512992bac..13a818520 100644 --- a/examples/m2mbidi/ent/user_create.go +++ b/examples/m2mbidi/ent/user_create.go @@ -127,9 +127,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return nil, err } - id := spec.ID.Value.(int64) u.ID = int(id) - return u, nil } diff --git a/examples/m2mrecur/ent/ent.go b/examples/m2mrecur/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/m2mrecur/ent/ent.go +++ b/examples/m2mrecur/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/m2mrecur/ent/user_create.go b/examples/m2mrecur/ent/user_create.go index df7405e08..be4e462a6 100644 --- a/examples/m2mrecur/ent/user_create.go +++ b/examples/m2mrecur/ent/user_create.go @@ -167,9 +167,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return nil, err } - id := spec.ID.Value.(int64) u.ID = int(id) - return u, nil } diff --git a/examples/o2m2types/ent/ent.go b/examples/o2m2types/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/o2m2types/ent/ent.go +++ b/examples/o2m2types/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/o2m2types/ent/pet_create.go b/examples/o2m2types/ent/pet_create.go index 8f20720f2..cc92a573c 100644 --- a/examples/o2m2types/ent/pet_create.go +++ b/examples/o2m2types/ent/pet_create.go @@ -115,9 +115,7 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { } return nil, err } - id := spec.ID.Value.(int64) pe.ID = int(id) - return pe, nil } diff --git a/examples/o2m2types/ent/user_create.go b/examples/o2m2types/ent/user_create.go index 34cd169d3..54eca3dd1 100644 --- a/examples/o2m2types/ent/user_create.go +++ b/examples/o2m2types/ent/user_create.go @@ -128,9 +128,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return nil, err } - id := spec.ID.Value.(int64) u.ID = int(id) - return u, nil } diff --git a/examples/o2m2types/ent/user_update.go b/examples/o2m2types/ent/user_update.go index e88f8d2b2..f48aa5d22 100644 --- a/examples/o2m2types/ent/user_update.go +++ b/examples/o2m2types/ent/user_update.go @@ -206,7 +206,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.pets) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uu.pets))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uu.pets))}) } } } @@ -406,7 +406,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.pets) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uuo.pets))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uuo.pets))}) } } } diff --git a/examples/o2mrecur/ent/ent.go b/examples/o2mrecur/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/o2mrecur/ent/ent.go +++ b/examples/o2mrecur/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/o2mrecur/ent/node_create.go b/examples/o2mrecur/ent/node_create.go index 9734a5f2d..83ad400ec 100644 --- a/examples/o2mrecur/ent/node_create.go +++ b/examples/o2mrecur/ent/node_create.go @@ -154,9 +154,7 @@ func (nc *NodeCreate) sqlSave(ctx context.Context) (*Node, error) { } return nil, err } - id := spec.ID.Value.(int64) n.ID = int(id) - return n, nil } diff --git a/examples/o2mrecur/ent/node_update.go b/examples/o2mrecur/ent/node_update.go index 7811717e2..0df0e0f15 100644 --- a/examples/o2mrecur/ent/node_update.go +++ b/examples/o2mrecur/ent/node_update.go @@ -249,7 +249,7 @@ func (nu *NodeUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(nu.children) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"children\" %v already connected to a different \"Node\"", keys(nu.children))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"children\" %v already connected to a different \"Node\"", keys(nu.children))}) } } } @@ -491,7 +491,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) { return nil, rollback(tx, err) } if int(affected) < len(nuo.children) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"children\" %v already connected to a different \"Node\"", keys(nuo.children))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"children\" %v already connected to a different \"Node\"", keys(nuo.children))}) } } } diff --git a/examples/o2o2types/ent/card_create.go b/examples/o2o2types/ent/card_create.go index 15e1ae202..49aa140ce 100644 --- a/examples/o2o2types/ent/card_create.go +++ b/examples/o2o2types/ent/card_create.go @@ -129,9 +129,7 @@ func (cc *CardCreate) sqlSave(ctx context.Context) (*Card, error) { } return nil, err } - id := spec.ID.Value.(int64) c.ID = int(id) - return c, nil } diff --git a/examples/o2o2types/ent/card_update.go b/examples/o2o2types/ent/card_update.go index ca2d3f25d..143bf7914 100644 --- a/examples/o2o2types/ent/card_update.go +++ b/examples/o2o2types/ent/card_update.go @@ -171,7 +171,7 @@ func (cu *CardUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(cu.owner) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"owner\" %v already connected to a different \"Card\"", keys(cu.owner))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"owner\" %v already connected to a different \"Card\"", keys(cu.owner))}) } } } @@ -333,7 +333,7 @@ func (cuo *CardUpdateOne) sqlSave(ctx context.Context) (c *Card, err error) { return nil, rollback(tx, err) } if int(affected) < len(cuo.owner) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"owner\" %v already connected to a different \"Card\"", keys(cuo.owner))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"owner\" %v already connected to a different \"Card\"", keys(cuo.owner))}) } } } diff --git a/examples/o2o2types/ent/ent.go b/examples/o2o2types/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/o2o2types/ent/ent.go +++ b/examples/o2o2types/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/o2o2types/ent/user_create.go b/examples/o2o2types/ent/user_create.go index 689787aae..3c08e1c1b 100644 --- a/examples/o2o2types/ent/user_create.go +++ b/examples/o2o2types/ent/user_create.go @@ -133,9 +133,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return nil, err } - id := spec.ID.Value.(int64) u.ID = int(id) - return u, nil } diff --git a/examples/o2o2types/ent/user_update.go b/examples/o2o2types/ent/user_update.go index 3708dbb09..f19cec8d4 100644 --- a/examples/o2o2types/ent/user_update.go +++ b/examples/o2o2types/ent/user_update.go @@ -190,7 +190,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.card) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"card\" %v already connected to a different \"User\"", keys(uu.card))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"card\" %v already connected to a different \"User\"", keys(uu.card))}) } } } @@ -373,7 +373,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.card) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"card\" %v already connected to a different \"User\"", keys(uuo.card))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"card\" %v already connected to a different \"User\"", keys(uuo.card))}) } } } diff --git a/examples/o2obidi/ent/ent.go b/examples/o2obidi/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/o2obidi/ent/ent.go +++ b/examples/o2obidi/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/o2obidi/ent/user_create.go b/examples/o2obidi/ent/user_create.go index b073f888a..e530ad06a 100644 --- a/examples/o2obidi/ent/user_create.go +++ b/examples/o2obidi/ent/user_create.go @@ -132,9 +132,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return nil, err } - id := spec.ID.Value.(int64) u.ID = int(id) - return u, nil } diff --git a/examples/o2obidi/ent/user_update.go b/examples/o2obidi/ent/user_update.go index a049f0d82..f7ecaa4ba 100644 --- a/examples/o2obidi/ent/user_update.go +++ b/examples/o2obidi/ent/user_update.go @@ -203,7 +203,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.spouse) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) } } } @@ -400,7 +400,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.spouse) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("\"spouse\" (%v) already connected to a different \"User\"", eid)}) } } } diff --git a/examples/o2orecur/ent/ent.go b/examples/o2orecur/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/o2orecur/ent/ent.go +++ b/examples/o2orecur/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/o2orecur/ent/node_create.go b/examples/o2orecur/ent/node_create.go index 76e771736..06333479e 100644 --- a/examples/o2orecur/ent/node_create.go +++ b/examples/o2orecur/ent/node_create.go @@ -159,9 +159,7 @@ func (nc *NodeCreate) sqlSave(ctx context.Context) (*Node, error) { } return nil, err } - id := spec.ID.Value.(int64) n.ID = int(id) - return n, nil } diff --git a/examples/o2orecur/ent/node_update.go b/examples/o2orecur/ent/node_update.go index cb9b3af15..dec53d2c1 100644 --- a/examples/o2orecur/ent/node_update.go +++ b/examples/o2orecur/ent/node_update.go @@ -212,7 +212,7 @@ func (nu *NodeUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(nu.prev) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"prev\" %v already connected to a different \"Node\"", keys(nu.prev))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"prev\" %v already connected to a different \"Node\"", keys(nu.prev))}) } } } @@ -240,7 +240,7 @@ func (nu *NodeUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(nu.next) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"next\" %v already connected to a different \"Node\"", keys(nu.next))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"next\" %v already connected to a different \"Node\"", keys(nu.next))}) } } } @@ -445,7 +445,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) { return nil, rollback(tx, err) } if int(affected) < len(nuo.prev) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"prev\" %v already connected to a different \"Node\"", keys(nuo.prev))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"prev\" %v already connected to a different \"Node\"", keys(nuo.prev))}) } } } @@ -473,7 +473,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) { return nil, rollback(tx, err) } if int(affected) < len(nuo.next) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"next\" %v already connected to a different \"Node\"", keys(nuo.next))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"next\" %v already connected to a different \"Node\"", keys(nuo.next))}) } } } diff --git a/examples/start/ent/car_create.go b/examples/start/ent/car_create.go index 3c841f4ea..f8b4046c6 100644 --- a/examples/start/ent/car_create.go +++ b/examples/start/ent/car_create.go @@ -134,9 +134,7 @@ func (cc *CarCreate) sqlSave(ctx context.Context) (*Car, error) { } return nil, err } - id := spec.ID.Value.(int64) c.ID = int(id) - return c, nil } diff --git a/examples/start/ent/ent.go b/examples/start/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/start/ent/ent.go +++ b/examples/start/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/start/ent/group_create.go b/examples/start/ent/group_create.go index e0645f597..5ee1004c8 100644 --- a/examples/start/ent/group_create.go +++ b/examples/start/ent/group_create.go @@ -114,9 +114,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { } return nil, err } - id := spec.ID.Value.(int64) gr.ID = int(id) - return gr, nil } diff --git a/examples/start/ent/user_create.go b/examples/start/ent/user_create.go index 47cc2aac1..bf8267d75 100644 --- a/examples/start/ent/user_create.go +++ b/examples/start/ent/user_create.go @@ -182,9 +182,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return nil, err } - id := spec.ID.Value.(int64) u.ID = int(id) - return u, nil } diff --git a/examples/start/ent/user_update.go b/examples/start/ent/user_update.go index bb920b442..cee0a56bb 100644 --- a/examples/start/ent/user_update.go +++ b/examples/start/ent/user_update.go @@ -261,7 +261,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.cars) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"cars\" %v already connected to a different \"User\"", keys(uu.cars))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"cars\" %v already connected to a different \"User\"", keys(uu.cars))}) } } } @@ -546,7 +546,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.cars) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"cars\" %v already connected to a different \"User\"", keys(uuo.cars))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"cars\" %v already connected to a different \"User\"", keys(uuo.cars))}) } } } diff --git a/examples/traversal/ent/ent.go b/examples/traversal/ent/ent.go index ce3c66550..18e9fcdcd 100644 --- a/examples/traversal/ent/ent.go +++ b/examples/traversal/ent/ent.go @@ -127,30 +127,31 @@ func IsNotSingular(err error) bool { return ok } -// ErrConstraintFailed returns when trying to create/update one or more entities and -// one or more of their constraints failed. For example, violation of edge or field uniqueness. -type ErrConstraintFailed struct { +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { msg string wrap error } // Error implements the error interface. -func (e ErrConstraintFailed) Error() string { - return fmt.Sprintf("ent: unique constraint failed: %s", e.msg) +func (e ConstraintError) Error() string { + return fmt.Sprintf("ent: constraint failed: %s", e.msg) } // Unwrap implements the errors.Wrapper interface. -func (e *ErrConstraintFailed) Unwrap() error { +func (e *ConstraintError) 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) +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + _, ok := err.(*ConstraintError) return ok } -func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { +func isSQLConstraintError(err error) (*ConstraintError, bool) { var ( msg = err.Error() // error format per dialect. @@ -161,11 +162,11 @@ func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { } ) if _, ok := err.(*sqlgraph.ConstraintError); ok { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } for i := range errors { if strings.Contains(msg, errors[i]) { - return &ErrConstraintFailed{msg, err}, true + return &ConstraintError{msg, err}, true } } return nil, false diff --git a/examples/traversal/ent/group_create.go b/examples/traversal/ent/group_create.go index 95acc9da1..7c703fc56 100644 --- a/examples/traversal/ent/group_create.go +++ b/examples/traversal/ent/group_create.go @@ -155,9 +155,7 @@ func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { } return nil, err } - id := spec.ID.Value.(int64) gr.ID = int(id) - return gr, nil } diff --git a/examples/traversal/ent/pet_create.go b/examples/traversal/ent/pet_create.go index 03e6bc7f4..6a141095c 100644 --- a/examples/traversal/ent/pet_create.go +++ b/examples/traversal/ent/pet_create.go @@ -155,9 +155,7 @@ func (pc *PetCreate) sqlSave(ctx context.Context) (*Pet, error) { } return nil, err } - id := spec.ID.Value.(int64) pe.ID = int(id) - return pe, nil } diff --git a/examples/traversal/ent/user_create.go b/examples/traversal/ent/user_create.go index 70583e65d..96bce37d4 100644 --- a/examples/traversal/ent/user_create.go +++ b/examples/traversal/ent/user_create.go @@ -249,9 +249,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { } return nil, err } - id := spec.ID.Value.(int64) u.ID = int(id) - return u, nil } diff --git a/examples/traversal/ent/user_update.go b/examples/traversal/ent/user_update.go index e31c74960..2e22d9a82 100644 --- a/examples/traversal/ent/user_update.go +++ b/examples/traversal/ent/user_update.go @@ -333,7 +333,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.pets) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uu.pets))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uu.pets))}) } } } @@ -436,7 +436,7 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { return 0, rollback(tx, err) } if int(affected) < len(uu.manage) { - return 0, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"manage\" %v already connected to a different \"User\"", keys(uu.manage))}) + return 0, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"manage\" %v already connected to a different \"User\"", keys(uu.manage))}) } } } @@ -762,7 +762,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.pets) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uuo.pets))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"pets\" %v already connected to a different \"User\"", keys(uuo.pets))}) } } } @@ -865,7 +865,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { return nil, rollback(tx, err) } if int(affected) < len(uuo.manage) { - return nil, rollback(tx, &ErrConstraintFailed{msg: fmt.Sprintf("one of \"manage\" %v already connected to a different \"User\"", keys(uuo.manage))}) + return nil, rollback(tx, &ConstraintError{msg: fmt.Sprintf("one of \"manage\" %v already connected to a different \"User\"", keys(uuo.manage))}) } } }