From 8e66691db5e0f2aca78b37f1b504a73b765110d3 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Thu, 3 Oct 2019 06:22:49 -0700 Subject: [PATCH] entc: return ErrNotFound on UpdateOne Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/52 Reviewed By: alexsn Differential Revision: D17737477 fbshipit-source-id: 13890619e0af28a28e3d7bd50d7e4287599eeaf0 --- entc/gen/internal/bindata.go | 4 ++-- entc/gen/template/dialect/sql/update.tmpl | 2 +- entc/integration/config/ent/user_update.go | 2 +- entc/integration/ent/card_update.go | 2 +- entc/integration/ent/comment_update.go | 2 +- entc/integration/ent/fieldtype_update.go | 2 +- entc/integration/ent/file_update.go | 2 +- entc/integration/ent/filetype_update.go | 2 +- entc/integration/ent/group_update.go | 2 +- entc/integration/ent/groupinfo_update.go | 2 +- entc/integration/ent/node_update.go | 2 +- entc/integration/ent/pet_update.go | 2 +- entc/integration/ent/user_update.go | 2 +- entc/integration/idtype/ent/user_update.go | 2 +- entc/integration/json/ent/user_update.go | 2 +- entc/integration/migrate/entv1/user_update.go | 2 +- entc/integration/migrate/entv2/group_update.go | 2 +- entc/integration/migrate/entv2/pet_update.go | 2 +- entc/integration/migrate/entv2/user_update.go | 2 +- entc/integration/template/ent/group_update.go | 2 +- entc/integration/template/ent/pet_update.go | 2 +- entc/integration/template/ent/user_update.go | 2 +- examples/edgeindex/ent/city_update.go | 2 +- examples/edgeindex/ent/street_update.go | 2 +- examples/m2m2types/ent/group_update.go | 2 +- examples/m2m2types/ent/user_update.go | 2 +- examples/m2mbidi/ent/user_update.go | 2 +- examples/m2mrecur/ent/user_update.go | 2 +- examples/o2m2types/ent/pet_update.go | 2 +- examples/o2m2types/ent/user_update.go | 2 +- examples/o2mrecur/ent/node_update.go | 2 +- examples/o2o2types/ent/card_update.go | 2 +- examples/o2o2types/ent/user_update.go | 2 +- examples/o2obidi/ent/user_update.go | 2 +- examples/o2orecur/ent/node_update.go | 2 +- examples/start/ent/car_update.go | 2 +- examples/start/ent/group_update.go | 2 +- examples/start/ent/user_update.go | 2 +- examples/traversal/ent/group_update.go | 2 +- examples/traversal/ent/pet_update.go | 2 +- examples/traversal/ent/user_update.go | 2 +- 41 files changed, 42 insertions(+), 42 deletions(-) diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index b0ccddf23..6cfc9e846 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -759,7 +759,7 @@ func templateDialectSqlSelectTmpl() (*asset, error) { return a, nil } -var _templateDialectSqlUpdateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\x5d\x6f\xdb\x38\xd6\xbe\x96\x7f\xc5\x19\x23\xed\x48\x79\x5d\x25\xed\xdd\x9b\xd9\x0c\x90\x4d\x52\xc0\xbb\xdb\xb8\x13\x77\x76\x2f\x3a\x45\xc1\x48\x47\x31\x37\x32\xe5\x90\xb4\x93\x6c\xa0\xff\xbe\x38\xa4\x3e\x28\x59\x76\xed\x38\x68\x3b\xe8\x0e\x30\xad\x25\x7e\x9d\x2f\x3e\xe7\x39\x14\xfb\xf8\x78\xb0\xdf\x3b\xcd\x66\x0f\x92\x5f\x4f\x34\xbc\x39\x7c\xfd\xff\xaf\x66\x12\x15\x0a\x0d\x6f\x59\x84\x57\x59\x76\x03\x43\x11\x85\x70\x92\xa6\x60\x3a\x29\xa0\x76\xb9\xc0\x38\xec\x7d\x98\x70\x05\x2a\x9b\xcb\x08\x21\xca\x62\x04\xae\x20\xe5\x11\x0a\x85\x31\xcc\x45\x8c\x12\xf4\x04\xe1\x64\xc6\xa2\x09\xc2\x9b\xf0\xb0\x6c\x85\x24\x9b\x8b\xb8\xc7\x85\x69\xff\xc7\xf0\xf4\xfc\x62\x7c\x0e\x09\x4f\x11\x8a\x77\x32\xcb\x34\xc4\x5c\x62\xa4\x33\xf9\x00\x59\x02\xda\x59\x4c\x4b\xc4\xb0\xb7\x7f\x90\xe7\xbd\xde\xe3\x23\xc4\x98\x70\x81\xd0\x8f\x39\x4b\x31\xd2\x07\xea\x36\x3d\x98\xcf\x62\xa6\xb1\x0f\x79\x4e\x3d\xf6\x66\x37\xd7\x70\x74\x0c\x7b\xe1\x38\xca\x66\x18\xbe\x67\xd1\x0d\xbb\xc6\xb2\xf5\x6a\xce\x53\x92\xf6\xe8\x18\x66\x4c\x45\x2c\xad\x3a\xfe\xb5\x68\x29\x3a\x4a\x8c\x90\x2f\x6c\xcf\xea\x77\x35\xbc\xe8\x94\x09\xa4\xf6\x09\x53\xe3\x79\x92\xf0\xfb\xba\x43\x7f\x24\x4a\x91\x5e\xc1\xde\x7f\x50\x66\xd4\xf1\x10\xf2\xfc\xf1\x11\x78\x62\x87\x9a\x07\xdb\x78\x0c\x7d\xc1\xd3\xbe\x7d\x85\x22\xae\x86\x4a\xd4\x34\xb2\x2f\xfa\x5d\x63\xa9\x95\x74\xbd\x2c\x25\x74\xc7\xf7\x92\xb9\x88\xc0\x6f\x68\x93\xe7\xb0\xef\xda\x21\xcf\x03\x50\xb7\xe9\x98\x2d\xd0\x8f\xf4\x3d\x44\x99\xd0\x78\xaf\xc3\x53\xfb\x77\x50\x0e\xd7\x34\xb2\xb1\xbc\x99\x26\xbc\x60\xd3\x42\x16\x4c\x15\xfd\xe2\x42\x57\x12\x0c\x00\xa5\xa4\xff\x33\x19\xc0\x63\xcf\x53\x98\x1a\x2f\x93\x42\xea\x36\x0d\xc7\xe6\xd9\xac\xe0\xf8\x29\x6c\x2c\x73\x9a\xa5\xf3\xa9\x50\x61\x18\xd6\x6b\x98\x01\xc3\x33\x12\x52\x69\x26\xb4\xab\x75\x10\xbe\x95\xd9\xd4\xa7\xe9\x3f\xb0\xab\x14\x97\x66\x37\x6f\x83\xa0\xe7\x91\x79\xeb\x75\x7a\x9e\xd7\xee\x39\x3c\x6b\xdb\x2e\xe4\x71\xe0\x97\x5a\x14\x53\x14\x32\xf5\x3c\x2f\xc9\x24\x7c\x1e\xc0\xcc\x84\x0c\x13\xd7\x08\xed\xe1\x33\x89\x31\x8f\x98\x46\x45\xe6\xf0\xbc\x99\x3b\x99\x97\x17\x13\x5a\xef\x79\x32\xbb\x53\x34\xd5\x4b\xd2\xe5\x32\xbb\x53\x8f\x79\xcf\xbb\x9d\xa3\x7c\x18\x00\x93\xd7\xa6\xad\x1c\x1e\xfe\x46\xef\xfd\xa0\xe7\xf1\xc4\x18\xfd\x78\x69\xed\x58\xd2\xaf\xa2\x63\xa4\xef\x07\xe0\xcc\x35\x00\x5a\x2d\xf8\xc5\x8c\xfd\xe9\x18\x04\x4f\x8d\x84\x12\xf5\x5c\x0a\xa8\xc2\xb4\xf0\x69\x8f\x64\x8d\x31\x41\x69\xc6\x85\xa7\x69\xa6\x90\x56\x5f\x30\x09\x3c\x56\xf0\xf1\x13\x17\xba\x67\x2c\x62\x3a\x5c\xe0\xbd\xf6\x4d\x0c\x14\x5d\xc0\xb4\x2f\xfb\xc0\x3a\xc1\x09\x67\x38\x86\x97\x8d\x48\x8b\x32\x91\xf0\xeb\xa3\x25\xfd\xec\x7b\x33\x47\x61\x83\x23\x6b\x04\x77\x36\x13\x1c\x64\x4b\xbf\x5b\xdf\x6e\x8d\x93\xa9\x0e\xcf\x29\x8a\x13\xbf\x5f\x42\x4c\x9e\x1f\x41\xc2\x78\x8a\x31\xa8\x88\x09\xc1\xc5\x35\xa9\x4a\x7a\x65\xe0\x0a\x7c\x04\x2f\x16\x7d\x63\x35\xf2\xb1\x67\x05\x8c\xad\x83\x48\x75\x0a\xe4\xa1\x1a\x6b\x49\x33\x14\xb1\x7d\xd9\x08\x39\x3f\x28\x43\x9f\x27\x20\x32\x5d\x8e\x19\x9a\xc8\xe7\xa2\xd8\x41\xee\xa0\xe1\x59\xd0\xda\x2e\xcd\xd6\x1a\x24\xbc\x56\x10\x3b\xc6\x33\x9e\x1b\x47\x4c\xf8\x2f\x79\xfc\x4c\xb6\x92\xc8\x62\x52\x94\xc7\x1d\x76\x71\xa3\xdf\xa3\x30\x3a\x06\x36\x9b\xa1\x88\x7d\x1e\xab\x01\xf0\x38\xe8\x95\x9b\xa4\x11\x34\xea\x8e\xeb\x68\x02\x82\x84\x4e\x51\x50\xef\xe0\x17\x23\x63\xc4\x14\x82\x80\xe3\x63\x38\x3c\xea\x6d\x29\xb1\xeb\x44\x63\x76\x93\xca\xe0\x8e\xeb\x49\x2d\x7e\x07\x40\xd4\xcb\xfe\x0a\xaf\xb7\x5e\x75\x9a\x49\x04\x3d\x61\x02\x48\xbd\x86\x0c\x66\x65\x4a\x99\x8a\x5e\x7c\x41\x84\xbc\x8d\x4e\x3c\xa9\x6c\x63\xec\x61\x7d\xd8\x25\x9a\xe0\xe9\x32\x1a\x11\x81\x20\xab\xeb\x09\x4a\xfc\x99\xf2\xf3\x14\xf5\x84\x5c\xa9\x33\xb0\x29\x78\x00\x4a\x33\xa9\x81\x81\x96\x4c\x28\x16\x69\x9e\x89\x10\x4c\xf2\xf6\x08\x70\x9c\x4d\xd9\x81\x4c\x1f\xee\x09\x96\x6a\x08\xdb\x10\x86\xca\x68\x08\xdf\x72\x4c\x63\x65\x95\x25\x90\xf1\xad\x7e\xca\xa4\x9a\x4b\x54\xf3\x94\x10\xc7\x2b\x33\x9f\x4d\x41\xbf\x1b\xc9\x57\x24\x89\xf0\x5f\xa4\xac\xc9\x25\x43\x31\x14\x5a\x75\xa5\xaa\x76\x26\xa2\x38\xa5\x74\x45\x29\xc6\x0b\x8a\xa8\xb6\xe9\x60\xef\xf3\x00\xf6\x12\xcb\x4e\x5c\x69\x4b\x1d\x32\x09\xbe\xd9\xdf\x49\x38\x9c\x4e\xe7\xda\x08\x41\x4f\x56\xca\x33\x4c\xd8\x3c\xd5\xc5\x18\x32\xd3\x82\xa5\x73\xec\x32\x29\x3d\x27\xe1\x58\xcb\x79\xa4\xcd\x4a\x90\xe7\xbf\x14\xdd\x1b\x5b\xb8\x32\x5f\x12\x0e\xd5\xdf\xc6\xa3\x8b\x72\x76\x32\x54\x52\xb9\xec\xdf\x2a\x13\xe1\x3b\x26\xd5\x84\xa5\xfe\xbe\x99\x27\x28\xba\x2d\x7b\xcb\x5b\x85\x0d\xc6\x65\xe6\xbf\x7a\x0d\xe3\x8c\x70\x8c\x9d\x34\x60\x2f\x69\x5a\xf6\x6a\x9e\x04\xb5\xd8\x0e\x68\x6d\x3f\x55\x43\x89\x06\xf0\x78\x5d\x69\xa9\x23\x33\xd1\xac\x25\x87\x4c\xaa\x4d\x5a\xe2\x7a\xe1\xc7\x0b\x9e\xa6\xe4\xc6\x82\x30\xd9\x45\xcc\xd2\x9d\x2b\xdb\x3f\x6b\x9f\x7c\x78\x98\x61\x78\x31\x9f\xa2\xe4\x51\x25\xc9\x3a\xc7\xb3\x38\xde\xdc\xf7\x95\xcd\x4e\xe2\x78\x6b\x9b\x75\x1b\xc9\x91\xdd\x51\xbd\x6c\x24\xd1\x37\x33\x63\x3b\x9c\x3c\x6f\x7f\xb3\x81\xff\x77\x5c\x88\x59\x8d\xcc\x6d\xa0\x38\x53\x6d\xea\xc9\xd6\x3c\xae\x8a\xcd\xd8\xdb\x74\xca\x25\xe1\xda\x81\xb7\xf4\xa2\x0e\x88\xfa\xed\xf2\x93\x35\xf8\x68\x46\x80\xcb\x52\x07\x20\x96\x48\x52\x8a\x4c\x76\x05\x48\x1b\x0e\x5a\x91\xbf\xc6\xa7\x9b\x1a\xd3\x66\x95\x15\xf6\x23\xbc\xb6\x11\x6a\x85\xa3\xb8\x7f\xc2\x1a\xae\x6d\xbb\xf6\xb4\xfb\xec\xe0\xc5\xc5\x3c\x4d\xbf\x1c\xff\x41\xbd\x43\x1b\x73\x35\x59\x4b\x02\x3f\x95\x33\x9f\x4f\x67\xfa\xa1\x60\xbd\x6d\xe2\x5e\xf6\xa9\x78\xbb\x4b\xbc\xf4\x7d\x78\x7e\x8f\x51\x07\x4b\x7f\x29\x71\x63\xd6\x2a\xb3\x34\xbd\x62\xd1\x8d\x5f\xa4\xde\x8a\x66\xb9\xd4\xc0\x64\xce\xf3\xf8\x1a\x95\x21\x8a\x07\xfb\x80\x42\x1b\xa6\x91\xcd\x35\x24\x26\x49\x11\xee\xda\x77\x80\xa6\xa7\xcd\xe8\xc6\x69\xed\xfc\xda\xa4\x0c\x8d\xc4\x87\x36\xf1\x95\x8b\x39\xec\x1f\xc3\x77\x6f\xde\xd5\xf4\x93\x68\x4a\x3b\x70\x25\x4e\xb3\x05\xc6\x8e\xdf\xb1\xf4\x7b\x00\xbf\x96\x6c\xc6\xcc\xb8\xc7\x9c\x52\x7b\xef\x8a\x1e\x5e\xd7\xb5\x33\x1a\xe2\xbc\x40\x59\x51\x63\x06\x55\x87\xbd\x2b\xa8\x46\x3a\xb1\x82\xc4\x45\x8f\x8e\x61\xca\x6e\xd0\x37\xa5\xcd\x60\x6b\x21\x6d\xf4\x50\x41\x84\x3c\x5e\x5d\x21\xae\x99\xc2\xdd\xa2\x1a\xa7\xb3\x94\xe9\xce\x93\x90\x83\x28\x23\xfd\x34\x8f\xfb\x64\xf4\x57\x65\xc0\x63\x83\x51\xa3\xa1\xd4\x68\xc9\x62\x89\x33\xed\xea\xf2\x36\x0d\xcf\x30\xc5\x0e\x82\x44\xcf\x68\x69\x92\xbb\x45\x42\xbb\xd4\x46\xbc\x09\xc3\xf7\x7f\x77\xc6\x7e\xb4\xbe\xc8\xf3\x4f\x35\x83\xda\x75\xba\x2b\x3b\x1d\xb6\xe6\x73\x36\xdd\x4e\xbb\x6e\xf3\x6d\xd7\x4a\xec\x18\x8e\x31\x4d\x2e\x31\x29\x37\x1d\xc5\xbf\xd9\x60\x0a\xd3\x04\x24\x55\xd6\x28\x22\x34\x3b\xcd\x74\xf8\x30\x3a\x1b\x1d\xc1\x5c\x21\x8c\x2e\xcb\x93\x33\x53\x65\xb0\xab\x6c\x81\x25\xc9\x6e\xfb\x70\x07\x17\xee\x6c\xf4\x96\xcd\x77\x8e\x89\xb6\x13\x1b\x5e\xdc\xd1\x8f\xdb\x78\xb2\x3b\x27\x37\x0a\x69\xeb\xe2\xd1\x33\x61\xda\x8f\x8c\x3e\x2b\xca\xb3\xf5\xa1\xbb\x2e\xa3\x63\x68\x0f\x14\x9f\x0e\x5a\x4b\xe3\x37\x83\x2b\xb4\x5c\x7e\x59\x09\x7a\xdb\xae\x20\xbf\x17\xc0\x6a\x1d\x0f\x19\x24\x1a\xbd\x19\x51\xa1\xfa\xee\xcd\xa8\x02\x9d\x55\x44\x73\x6d\x24\x7d\x8f\xde\xde\xca\x49\xdf\x89\x8f\x56\x27\x15\xf2\xd4\xaa\xa4\xb2\x2a\x57\x3c\xc9\x05\x4f\xf5\xc1\xf3\x6d\xb9\x66\x32\xd8\x2d\x17\x6c\x91\x0a\xd6\x66\x02\xa7\x24\xe8\x82\x6b\xab\x5a\xb3\x0a\x73\x60\xbf\xf0\x2a\x13\x31\x75\xfb\x5d\xf0\xdb\x39\x3e\xc5\xc7\x3c\x69\x9f\x8b\x9a\x73\xc9\x8d\x83\x6d\xd5\x39\x65\xc4\xc4\xcf\x1a\x52\x2e\x6e\x8c\x0c\x54\x18\xc0\x1f\x7d\xab\x54\xb1\xd1\xff\xe8\x83\xce\xe0\x45\x0c\x26\x1f\x44\xa8\xc0\xff\x15\x5e\x07\xfd\x01\x88\xc0\x0d\xe0\x2f\xa6\xa5\x2e\x53\xed\x9a\x8f\x9e\x0b\x7e\x4c\xf0\x6f\x1e\xb7\x94\xf2\xaa\x91\x75\xf8\x9f\xff\xb6\xf1\xd1\xe2\xc7\xc3\x4f\x41\x10\x7e\xcb\x78\x7f\x36\xd8\xd8\xce\x74\x85\xee\xab\xad\xb7\x6d\x8a\x0d\xc2\x13\x11\xfb\x41\x38\x54\x5b\x81\xd7\x37\x36\x3e\x4b\x12\x8c\x34\xc6\xd5\xd9\xac\x44\x65\x3e\x0f\x9e\x14\x0d\x2d\xc1\x76\x5e\x90\x27\xc0\x85\xf6\xcb\x75\x03\xf8\xcb\x16\x78\xb6\xf1\xb2\x2f\xcf\xa5\x34\x56\x96\x8c\x0b\xfd\xd6\x7c\x2d\x7a\x9c\xaa\xeb\x23\x83\x40\xe3\x99\xe4\x42\x27\x7e\x7f\x19\x62\xfc\x17\x8b\x00\x58\x2a\x91\xc5\x0f\x10\x65\x42\x18\x29\x09\x79\x18\xc4\x3c\x31\x80\xa8\x0b\x68\xaa\x87\xf5\x6d\x04\xe4\x0d\x55\xeb\xb3\x9d\x9a\xc5\x53\x65\x56\x9e\x03\x98\xe3\x25\x97\x8b\x17\x6c\xfc\x70\x50\xc1\x6b\x4d\xb4\x3f\x53\xc4\xd6\x98\x46\xf4\xb7\x30\xc6\x4e\x78\xf7\x64\xc0\x2b\xa5\xaf\x38\xb8\x7d\x1e\xd8\x6f\xb5\x8f\x3c\x36\x16\xc9\x07\xd0\xc5\x27\x6c\x1f\xa4\x4e\x3c\x76\x3e\xb6\x9b\x1c\x44\xa9\xe7\x95\xc4\x04\x22\x89\xe6\xdb\x36\x15\xa7\xf6\xa4\x88\x0b\xb8\xca\xf4\x04\xee\xd8\x83\x72\x8b\xd4\xf6\x69\xf7\xf3\x9f\xd9\x38\x17\x3d\x2c\xbf\x50\x28\x57\x81\xcd\x2a\x80\x2a\xee\x1e\x6c\x5b\xa9\x6e\x55\x28\x37\x02\x66\x51\xc7\x44\xe1\xad\xc7\xe6\x61\xe5\x3f\xcd\x5b\x7f\xf1\xf1\xf0\xd3\x00\x16\x1f\x5f\x7f\x5a\x53\x3f\x75\x1c\x31\x7e\x55\x62\xba\xb4\x91\x46\xa5\x6f\xfe\xdc\x09\xff\xc9\xf9\x7e\xb7\xaf\x89\xdf\x03\xd3\xed\xf2\x6b\x7d\xcc\xf1\x05\xd8\x9b\x95\x66\x7f\x5f\x4a\xff\x8d\x80\x70\x16\x8e\xa4\x1f\x3c\x99\x35\xac\xa4\x42\x5f\x2f\xaa\x3a\x83\x8a\xc8\xcc\x6c\x60\xd1\x6e\x4b\x46\xf3\x5d\x04\xd7\x0f\xce\x6c\x32\x81\x90\x25\x1d\x35\xd4\x8b\xc5\x93\xe8\xcd\x0d\x3e\xa8\xcd\x54\x59\xcb\x82\x9c\x3a\xb3\x4a\xdf\xeb\xf7\x79\x75\x21\xa3\xdc\x41\xce\xed\xa6\xc2\x66\x86\x48\xa8\xc2\xcb\x4a\x4b\xda\xa9\xe1\x89\xce\xb8\xbf\xb9\xd4\x54\x0b\xd4\x67\xbf\xea\x79\x0e\x75\x3b\xbe\x4d\x16\x00\xb5\x95\x60\xce\x5c\x1d\xb7\x0a\x9a\x74\xa6\x58\xe6\xcf\x5a\x8f\x3e\xb9\x88\x2a\x17\x6d\x40\xce\xb2\xf9\xbf\x91\x5d\xd6\x9a\xe5\xab\x15\x9a\xab\x6d\xe4\x84\xd5\xff\x60\xfa\x07\x87\xe9\x32\x16\x5a\x37\xf6\xaa\x9b\xc0\xfa\x3e\x3c\xcd\xa6\x53\xae\xfd\xed\x2e\xf8\xd6\x6d\xcd\x4b\xe7\xed\xdb\xe6\x76\xbf\x96\x15\xb0\x73\xfb\x5b\xf0\xb4\x67\xef\xed\x97\x37\xd2\xd7\x5e\xe1\x77\x09\x5b\xee\xde\xec\xeb\x4e\x24\xab\x93\x48\xc1\xd2\xba\xd2\x82\xb5\x48\xc3\xf1\xaa\x0c\xb8\x4a\xdf\x83\x7d\x28\x7e\x73\x65\x2e\x72\xdd\x88\xbb\x4c\x00\xd3\xf6\x9f\x26\xcc\x32\x2e\x74\x55\xcd\xb6\x6e\x53\xd8\xfb\xb9\xb5\xc4\xf6\x92\x6e\xaf\xca\x23\x14\xc9\x56\x3e\xc7\x57\xb5\x85\xfe\x1b\x00\x00\xff\xff\x3a\x5e\x2d\x9f\xa8\x31\x00\x00") +var _templateDialectSqlUpdateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\x6d\x6f\xdb\x38\xf2\x7f\x6d\x7f\x8a\x59\x23\xcd\x4a\xf9\xbb\x4a\xda\x77\xff\xf4\x52\x20\x97\xa4\x80\xef\xae\x71\x37\xee\xde\xbd\xe8\x16\x05\x23\x8d\x62\x5e\x64\xca\x21\x69\x27\x39\x43\xdf\xfd\x30\xa4\x1e\x28\x59\x76\xed\x38\x68\xbb\xe8\x2d\xb0\xad\x25\x3e\xcd\xc3\x8f\x33\xbf\xa1\xd8\xc5\xe2\xf0\xa0\x7b\x96\x4e\x1f\x25\xbf\x19\x6b\x78\x7d\xf4\xea\xff\x5f\x4e\x25\x2a\x14\x1a\xde\xb1\x10\xaf\xd3\xf4\x16\x06\x22\x0c\xe0\x34\x49\xc0\x74\x52\x40\xed\x72\x8e\x51\xd0\xfd\x38\xe6\x0a\x54\x3a\x93\x21\x42\x98\x46\x08\x5c\x41\xc2\x43\x14\x0a\x23\x98\x89\x08\x25\xe8\x31\xc2\xe9\x94\x85\x63\x84\xd7\xc1\x51\xd1\x0a\x71\x3a\x13\x51\x97\x0b\xd3\xfe\x8f\xc1\xd9\xc5\xe5\xe8\x02\x62\x9e\x20\xe4\xef\x64\x9a\x6a\x88\xb8\xc4\x50\xa7\xf2\x11\xd2\x18\xb4\xb3\x98\x96\x88\x41\xf7\xe0\x30\xcb\xba\xdd\xc5\x02\x22\x8c\xb9\x40\xe8\x45\x9c\x25\x18\xea\x43\x75\x97\x1c\xce\xa6\x11\xd3\xd8\x83\x2c\xa3\x1e\x7b\xd3\xdb\x1b\x38\x3e\x81\xbd\x60\x14\xa6\x53\x0c\x3e\xb0\xf0\x96\xdd\x60\xd1\x7a\x3d\xe3\x09\x49\x7b\x7c\x02\x53\xa6\x42\x96\x94\x1d\xff\x9a\xb7\xe4\x1d\x25\x86\xc8\xe7\xb6\x67\xf9\xbb\x1c\x9e\x77\x4a\x05\x52\xfb\x98\xa9\xd1\x2c\x8e\xf9\x43\xd5\xa1\x37\x14\x85\x48\x2f\x61\xef\x3f\x28\x53\xea\x78\x04\x59\xb6\x58\x00\x8f\xed\x50\xf3\x60\x1b\x4f\xa0\x27\x78\xd2\xb3\xaf\x50\x44\xe5\x50\x89\x9a\x46\xf6\x44\xaf\x6d\x2c\xb5\x92\xae\x57\x85\x84\xee\xf8\x6e\x3c\x13\x21\x78\x35\x6d\xb2\x0c\x0e\x5c\x3b\x64\x99\x0f\xea\x2e\x19\xb1\x39\x7a\xa1\x7e\x80\x30\x15\x1a\x1f\x74\x70\x66\xff\xf6\x8b\xe1\x9a\x46\xd6\x96\x37\xd3\x04\x97\x6c\x92\xcb\x82\x89\xa2\x5f\x5c\xe8\x52\x82\x3e\xa0\x94\xf4\x7f\x2a\x7d\x58\x74\x3b\x0a\x13\xe3\x65\x52\x48\xdd\x25\xc1\xc8\x3c\x9b\x15\x1c\x3f\x05\xb5\x65\xce\xd2\x64\x36\x11\x2a\x08\x82\x6a\x0d\x33\x60\x70\x4e\x42\x2a\xcd\x84\x76\xb5\xf6\x83\x77\x32\x9d\x78\x34\xfd\x47\x76\x9d\xe0\xd2\xec\xe6\xad\xef\x77\x3b\x64\xde\x6a\x9d\x6e\xa7\xd3\xec\x39\x38\x6f\xda\x2e\xe0\x91\xef\x15\x5a\xe4\x53\xe4\x32\x75\x3b\x9d\x38\x95\xf0\xa5\x0f\x53\x03\x19\x26\x6e\x10\x9a\xc3\xa7\x12\x23\x1e\x32\x8d\x8a\xcc\xd1\xe9\x4c\xdd\xc9\x3a\x59\x3e\xa1\xf5\x5e\x47\xa6\xf7\x8a\xa6\xda\x27\x5d\xae\xd2\x7b\xb5\xc8\xba\x9d\xbb\x19\xca\xc7\x3e\x30\x79\x63\xda\x8a\xe1\xc1\x6f\xf4\xde\xf3\xbb\x1d\x1e\x1b\xa3\x9f\x2c\xad\x1d\x49\xfa\x95\x77\x0c\xf5\x43\x1f\x9c\xb9\xfa\x40\xab\xf9\x6f\xcc\xd8\x5f\x4e\x40\xf0\xc4\x48\x28\x51\xcf\xa4\x80\x12\xa6\xb9\x4f\xbb\x24\x6b\x84\x31\x4a\x33\x2e\x38\x4b\x52\x85\xb4\xfa\x9c\x49\xe0\x91\x82\x4f\x9f\xb9\xd0\x5d\x63\x11\xd3\xe1\x12\x1f\xb4\x67\x30\x90\x77\x01\xd3\xbe\xec\x03\xeb\x04\x07\xce\x70\x02\xfb\x35\xa4\x85\xa9\x88\xf9\xcd\xf1\x92\x7e\xf6\xbd\x99\x23\xb7\xc1\xb1\x35\x82\x3b\x9b\x01\x07\xd9\xd2\x6b\xd7\xb7\x5d\xe3\x78\xa2\x83\x0b\x42\x71\xec\xf5\x8a\x10\x93\x65\xc7\x10\x33\x9e\x60\x04\x2a\x64\x42\x70\x71\x43\xaa\x92\x5e\x29\xb8\x02\x1f\xc3\x8b\x79\xcf\x58\x8d\x7c\xdc\xb1\x02\x46\xd6\x41\xa4\x3a\x01\x79\xa0\x46\x5a\xd2\x0c\x39\xb6\xaf\x6a\x90\xf3\xfc\x02\xfa\x3c\x06\x91\xea\x62\xcc\xc0\x20\x9f\x8b\x7c\x07\xb9\x83\x06\xe7\x7e\x63\xbb\xd4\x5b\xab\x20\xd1\x69\x80\xd8\x31\x9e\xf1\xdc\x28\x64\xc2\xdb\xe7\xd1\x33\xd9\x4a\x22\x8b\x48\x51\x1e\xb5\xd8\xc5\x45\x7f\x87\x60\x74\x02\x6c\x3a\x45\x11\x79\x3c\x52\x7d\xe0\x91\xdf\x2d\x36\x49\x0d\x34\xea\x9e\xeb\x70\x0c\x82\x84\x4e\x50\x50\x6f\xff\x8d\x91\x31\x64\x0a\x41\xc0\xc9\x09\x1c\x1d\x77\x57\x48\xbc\x7f\x21\xe5\x65\xaa\xdf\x51\xa2\x5a\x90\xf8\xa3\xa9\xe4\x42\xe7\xf2\x17\x6e\x84\x7b\xae\xc7\x95\xd8\x2d\x81\x21\xab\xd6\x7b\x0b\xaf\x56\x2e\xb7\xca\x40\x93\x54\x22\xe8\x31\x13\x40\x7a\x2d\x2f\x4d\xb9\x52\xd1\x8b\x75\x32\x38\x51\xa4\xf4\x28\x8f\x4b\xa3\x18\x43\x58\xe7\xb5\x89\x26\x78\xb2\x1c\x86\x88\x39\x90\xb9\xf5\x18\x25\xfe\x4a\x89\x79\x82\x7a\x4c\x3e\xd4\x29\xd8\xdc\xdb\x07\xa5\x99\xd4\xc0\x40\x4b\x26\x14\x0b\x35\x4f\x45\x00\x26\x6b\x77\x28\xd2\x38\xbb\xb1\x25\x24\x7d\x7c\xa0\x78\x54\xc5\xae\x0d\xe3\x4f\x01\x83\xe0\x1d\xc7\x24\x52\x56\x59\x8a\x2e\x9e\xd5\x4f\x99\x1c\x73\x85\x6a\x96\x50\xa8\xe9\x14\x29\xcf\xe6\x9e\xdf\x8d\xe4\x2b\xb2\x43\xf0\x2f\x52\xd6\x24\x91\x81\x18\x08\xad\xda\x72\x54\x33\x05\x11\x40\x29\x4f\x51\x6e\xe9\xf8\x39\x9c\x6d\x1e\xd8\xfb\xd2\x87\xbd\xd8\xd2\x12\x57\xda\x42\x87\x54\x82\x67\x36\x76\x1c\x0c\x26\x93\x99\x36\x42\xd0\x93\x95\xf2\x1c\x63\x36\x4b\x74\x3e\x86\xcc\x34\x67\xc9\x0c\xdb\x4c\x4a\xcf\x71\x30\xd2\x72\x16\x6a\xb3\x12\x64\xd9\x9b\xbc\x7b\x6d\xef\x96\xe6\x8b\x83\x81\xfa\xdb\x68\x78\x59\xcc\x4e\x86\x8a\x4b\x97\xfd\x5b\xa5\x22\x78\xcf\xa4\x1a\xb3\xc4\x3b\x30\xf3\xf8\x79\xb7\x65\x6f\x75\x56\x05\x05\xe3\x32\xf3\x5f\xb5\x86\x71\x46\x30\xc2\xd6\xfc\xbf\x17\xd7\x2d\x7b\x3d\x8b\xfd\x4a\x6c\x27\x5a\x6d\x3f\x55\x4d\x89\x5a\xc4\xe9\xb4\xe5\xa3\x96\x94\x44\xb3\x16\xe4\x31\x2e\x37\x69\x11\xd0\x73\x3f\x5e\xf2\x24\x21\x37\xe6\x4c\xc9\x2e\x62\x96\x6e\x5d\xd9\xfe\x59\xf9\xe4\xe3\xe3\x14\x83\xcb\xd9\x04\x25\x0f\x4b\x49\xd6\x39\x9e\x45\xd1\xe6\xbe\x2f\x6d\x76\x1a\x45\x5b\xdb\xac\xdd\x48\x8e\xec\x8e\xea\x45\x23\x89\xbe\x99\x19\x9b\x70\xea\x74\x0e\x36\x1b\xf8\x7f\x27\xb9\x98\xe5\xc8\xcc\x02\xc5\x99\x6a\x53\x4f\x36\xe6\x71\x55\xac\x63\x6f\xd3\x29\x97\x84\x6b\x02\x6f\xe9\x45\x05\x88\xea\xed\xf2\x93\x35\xf8\x70\x4a\x01\x97\x25\x4e\x80\x58\x62\x47\x09\x32\xd9\x06\x90\x66\x38\x68\x20\x7f\x8d\x4f\x37\x35\xa6\xcd\x2a\x2b\xec\x47\xf1\xda\x22\xd4\x0a\x47\xb8\x7f\xc2\x1a\xae\x6d\xdb\xf6\xb4\xfb\xec\xc4\x8b\xcb\x59\x92\x7c\x1d\xff\x7e\xb5\x43\x6b\x73\xd5\xe9\x4a\x0c\xbf\x14\x33\x5f\x4c\xa6\xfa\x31\xa7\xbb\x4d\xc6\x5e\xf4\x29\x09\xbb\xcb\xb8\xf4\x43\x70\xf1\x80\x61\x0b\x3d\xdf\x97\xb8\x31\x5d\x95\x69\x92\x5c\xb3\xf0\xd6\xcb\x53\x6f\xc9\xaf\x5c\x6a\x60\x32\xe7\x45\x74\x83\xca\x30\xc4\xc3\x03\x40\xa1\x0d\xd3\x48\x67\x1a\x62\x93\xa4\x28\xee\xda\x77\x80\xa6\xa7\xcd\xe8\xc6\x69\xcd\xfc\x5a\xa7\x0c\xb5\xc4\x87\x36\xf1\x15\x8b\x39\xb4\x1f\x83\xf7\xaf\xdf\x57\xbc\x93\x68\x4a\x13\xb8\x12\x27\xe9\x1c\x23\xc7\xef\x58\xf8\xdd\x87\xb7\x05\x9b\x31\x33\xee\x31\xa7\xc6\xde\xbb\xa6\x87\x57\x55\xd1\x8c\x86\x31\xcf\x51\x96\x9c\x98\x41\xd9\x61\xef\x1a\xca\x91\x0e\x56\x90\x48\xe8\xf1\x09\x4c\xd8\x2d\x7a\xa6\xa6\xe9\x6f\x2d\xa4\x45\x0f\x55\x42\xc8\xa3\xd5\xa5\xe1\x9a\x29\xdc\x2d\xaa\x71\x32\x4d\x98\x6e\x3d\x02\x39\x0c\x53\xd2\x4f\xf3\xa8\x47\x46\x7f\x59\x00\x1e\x6b\x54\x1a\x0d\x97\x46\x4b\x16\x8b\x38\xd3\x2c\x2b\xef\x92\xe0\x1c\x13\x6c\x21\x48\xf4\x8c\x96\x26\xb9\x5b\x24\xb0\x4b\x6d\xc4\x9b\x30\xf8\xf0\x77\x67\xec\x27\xeb\x8b\x2c\xfb\x5c\x31\xa8\x5d\xa7\xbb\xb6\xd3\x61\x63\x3e\x67\xd3\xed\xb4\xeb\x36\xdf\x76\x8d\xc4\x8e\xc1\x08\x93\xf8\x0a\xe3\x62\xd3\x11\xfe\xcd\x06\x53\x98\xc4\x20\xa9\xa4\x46\x11\xa2\xd9\x69\xa6\xc3\xc7\xe1\xf9\xf0\x18\x66\x0a\x61\x78\x55\x1c\x99\x99\x2a\x83\x5d\xa7\x73\x2c\x48\x76\xd3\x87\x3b\xb8\x70\x67\xa3\x37\x6c\xbe\x33\x26\x9a\x4e\xac\x79\x71\x47\x3f\x6e\xe3\xc9\xf6\x9c\x5c\xab\xa0\xad\x8b\x87\xcf\x14\xd3\x7e\xe6\xe8\xb3\xa2\x3c\x5b\x0f\xdd\x75\x19\x1d\x03\x7b\x92\xf8\xf4\xa0\xb5\x34\x7e\xb3\x70\x85\x96\xcb\x2f\x2b\x41\x6f\x9b\x15\xe4\x8f\x12\xb0\x1a\xe7\x42\x26\x12\x0d\x5f\x0f\xa9\x50\x7d\xff\x7a\x58\x06\x9d\x55\x44\x73\x2d\x92\x7e\x44\x6f\x6f\xe5\xa4\x1f\xc4\x47\xab\x93\x0a\x79\x6a\x55\x52\x59\x95\x2b\x9e\xe4\x82\xa7\xfa\xe0\xf9\xb6\x5c\x3d\x19\xec\x96\x0b\xb6\x48\x05\x6b\x33\x81\x53\x12\xb4\x85\x6b\xab\x5a\xbd\x0a\x73\xc2\x7e\xee\x55\x26\x22\xea\xf6\xbb\xe0\x77\x33\x7c\x8a\x8f\x79\xdc\x3c\x10\x35\xe7\x92\x1b\x83\x6d\xd5\x39\x65\xc8\xc4\xaf\x1a\x12\x2e\x6e\x8d\x0c\x54\x18\xc0\x1f\x3d\xab\x54\xbe\xd1\xff\xe8\x81\x4e\xe1\x45\x04\x26\x1f\x84\xa8\xc0\x7b\x0b\xaf\xfc\x5e\x1f\x84\xef\x02\xf8\xab\x69\xa9\xcd\x54\xbb\xe6\xa3\xe7\x0a\x3f\x06\xfc\x9b\xe3\x96\x52\x5e\x39\xb2\x82\xff\xc5\x6f\x1b\x1f\x2d\x7e\x3a\xfa\xec\xfb\xc1\xf7\xc4\xfb\xb3\x85\x8d\xed\x4c\x97\xeb\xbe\xda\x7a\xdb\xa6\x58\x3f\x38\x15\x91\xe7\x07\x03\xb5\x55\xf0\xfa\xce\xc6\x67\x71\x8c\xa1\xc6\xa8\x3c\x9b\x95\xa8\xcc\x77\xc1\xd3\xbc\xa1\x21\xd8\xce\x0b\xf2\x18\xb8\xd0\x5e\xb1\xae\x0f\x7f\xd9\x22\x9e\x6d\xbc\xec\xfe\x85\x94\xc6\xca\x92\x71\xa1\xdf\x99\xcf\x44\x8b\x89\xba\x39\x86\xda\xb7\x98\xe5\x10\xe3\xbd\x98\xfb\xc0\x12\x89\x2c\x7a\x84\x30\x15\xc2\x48\x49\x91\x87\x41\xc4\x63\x13\x10\x75\x1e\x9a\xaa\x61\x3d\x8b\x80\xac\xa6\x6a\x75\xb6\x53\xb1\x78\xaa\xcc\x8a\x73\x00\x73\xbc\xe4\x72\xf1\x9c\x8d\x1f\xf5\xcb\xf0\x5a\x11\xed\x2f\x84\xd8\x2a\xa6\x11\xfd\xcd\x8d\xb1\x53\xbc\x7b\x72\xc0\x2b\xa4\x2f\x39\xb8\x7d\xee\xdb\x8f\xb4\x0b\x1e\x19\x8b\x64\x7d\x68\xe3\x13\xb6\x0f\x52\x27\x1e\x39\x5f\xd9\x4d\x0e\xa2\xd4\xf3\x52\x62\x0c\xa1\x44\xf3\x51\x9b\x8a\x53\x7b\x52\xc4\x05\x5c\xa7\x7a\x0c\xf7\xec\x51\xb9\x45\x6a\xf3\xb4\xfb\xf9\xcf\x6c\x9c\x1b\x1e\x96\x5f\x28\x94\xab\x82\xcd\xaa\x00\x95\x5f\x3a\xd8\xb6\x52\xdd\xaa\x50\xae\x01\x66\x5e\x61\x22\xf7\xd6\xa2\x7e\x58\xf9\x4f\xf3\xd6\x9b\x7f\x3a\xfa\xdc\x87\xf9\xa7\x57\x9f\xd7\xd4\x4f\x2d\x47\x8c\xdf\x94\x98\x2e\x6d\xa4\x61\xe1\x9b\x3f\x77\xc2\x7f\x72\xbe\xdf\xed\x6b\xe2\x8f\xc0\x74\xdb\xfc\x5a\x1d\x73\x7c\x25\xec\x4d\x0b\xb3\x7f\x28\xa4\xff\x4e\x81\x70\x1a\x0c\xa5\xe7\x3f\x99\x35\xac\xa4\x42\xdf\x0e\x55\xad\xa0\x22\x32\x33\xed\xdb\x68\xb7\x25\xa3\xf9\x21\xc0\xf5\x93\x33\x9b\x54\x20\xa4\x71\x4b\x0d\xf5\x62\xfe\x24\x7a\x73\x8b\x8f\x6a\x33\x55\xd6\xb2\x20\xa7\xce\x2c\xd3\xf7\xfa\x7d\x5e\x5e\xc8\x28\x76\x90\x73\xad\x29\xb7\x99\x21\x12\x2a\xf7\xb2\xd2\x92\x76\x6a\x70\xaa\x53\xee\x6d\x2e\x35\xd5\x02\xd5\xd9\xaf\x7a\x9e\x43\xdd\x96\x6f\x93\x79\x80\xda\x4a\x30\x67\xae\x96\x5b\x05\x75\x3a\x93\x2f\xf3\x67\xad\x47\x9f\x5c\x44\x15\x8b\xd6\x42\xce\xb2\xf9\xbf\x93\x5d\xd6\x9a\xe5\x9b\x15\x9a\xab\x6d\xe4\xc0\xea\x7f\x61\xfa\x27\x0f\xd3\x05\x16\x1a\x37\xf6\xca\x2b\xc0\xfa\x21\x38\x4b\x27\x13\xae\xbd\xed\x6e\xf6\x56\x6d\xf5\xdb\xe6\xcd\x6b\xe6\x76\xbf\x16\x15\xb0\x73\xed\x5b\xf0\xa4\x6b\x2f\xec\x17\x57\xd1\xd7\xde\xdd\x77\x09\x5b\xe6\xde\xec\x6b\x4f\x24\xab\x93\x48\xce\xd2\xda\xd2\x82\xb5\x48\xcd\xf1\xaa\x00\x5c\xa9\xef\xe1\x01\xe4\xbf\xb9\x32\x17\xb9\x6e\xc5\x7d\x2a\x80\x69\xfb\x6f\x12\xa6\x29\x17\xba\xac\x66\x1b\xb7\x29\xec\xc5\xdc\x4a\x62\x7b\x3b\xb7\x5b\xe6\x11\x42\xb2\x95\xcf\xf1\x55\x65\xa1\xff\x06\x00\x00\xff\xff\x71\x5e\x3c\xcf\xa1\x31\x00\x00") func templateDialectSqlUpdateTmplBytes() ([]byte, error) { return bindataRead( @@ -774,7 +774,7 @@ func templateDialectSqlUpdateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/update.tmpl", size: 12712, mode: os.FileMode(420), modTime: time.Unix(1569251090, 0)} + info := bindataFileInfo{name: "template/dialect/sql/update.tmpl", size: 12705, mode: os.FileMode(420), modTime: time.Unix(1570107181, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/dialect/sql/update.tmpl b/entc/gen/template/dialect/sql/update.tmpl index 0398c0360..2bcf9f451 100644 --- a/entc/gen/template/dialect/sql/update.tmpl +++ b/entc/gen/template/dialect/sql/update.tmpl @@ -46,7 +46,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }} {{- if $one }} switch n := len(ids); { case n == 0: - return {{ $zero }}, fmt.Errorf("{{ $pkg }}: {{ $.Name }} not found with id: %v", {{ $receiver }}.id) + return {{ $zero }}, &ErrNotFound{fmt.Sprintf("{{ $.Name }} with id: %v", {{ $receiver }}.id)} case n > 1: return {{ $zero }}, fmt.Errorf("{{ $pkg }}: more than one {{ $.Name }} with the same id: %v", {{ $receiver }}.id) } diff --git a/entc/integration/config/ent/user_update.go b/entc/integration/config/ent/user_update.go index 5c5dda072..a0764640c 100644 --- a/entc/integration/config/ent/user_update.go +++ b/entc/integration/config/ent/user_update.go @@ -141,7 +141,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/entc/integration/ent/card_update.go b/entc/integration/ent/card_update.go index abdf2e70b..36c287b68 100644 --- a/entc/integration/ent/card_update.go +++ b/entc/integration/ent/card_update.go @@ -374,7 +374,7 @@ func (cuo *CardUpdateOne) sqlSave(ctx context.Context) (c *Card, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Card not found with id: %v", cuo.id) + return nil, &ErrNotFound{fmt.Sprintf("Card with id: %v", cuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Card with the same id: %v", cuo.id) } diff --git a/entc/integration/ent/comment_update.go b/entc/integration/ent/comment_update.go index 35348d72a..94555adf1 100644 --- a/entc/integration/ent/comment_update.go +++ b/entc/integration/ent/comment_update.go @@ -425,7 +425,7 @@ func (cuo *CommentUpdateOne) sqlSave(ctx context.Context) (c *Comment, err error } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Comment not found with id: %v", cuo.id) + return nil, &ErrNotFound{fmt.Sprintf("Comment with id: %v", cuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Comment with the same id: %v", cuo.id) } diff --git a/entc/integration/ent/fieldtype_update.go b/entc/integration/ent/fieldtype_update.go index 185f1adfe..5907eed3c 100644 --- a/entc/integration/ent/fieldtype_update.go +++ b/entc/integration/ent/fieldtype_update.go @@ -1496,7 +1496,7 @@ func (ftuo *FieldTypeUpdateOne) sqlSave(ctx context.Context) (ft *FieldType, err } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: FieldType not found with id: %v", ftuo.id) + return nil, &ErrNotFound{fmt.Sprintf("FieldType with id: %v", ftuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one FieldType with the same id: %v", ftuo.id) } diff --git a/entc/integration/ent/file_update.go b/entc/integration/ent/file_update.go index 79333a147..07edb8a6f 100644 --- a/entc/integration/ent/file_update.go +++ b/entc/integration/ent/file_update.go @@ -614,7 +614,7 @@ func (fuo *FileUpdateOne) sqlSave(ctx context.Context) (f *File, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: File not found with id: %v", fuo.id) + return nil, &ErrNotFound{fmt.Sprintf("File with id: %v", fuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one File with the same id: %v", fuo.id) } diff --git a/entc/integration/ent/filetype_update.go b/entc/integration/ent/filetype_update.go index 99a808cc3..a8a8c759a 100644 --- a/entc/integration/ent/filetype_update.go +++ b/entc/integration/ent/filetype_update.go @@ -382,7 +382,7 @@ func (ftuo *FileTypeUpdateOne) sqlSave(ctx context.Context) (ft *FileType, err e } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: FileType not found with id: %v", ftuo.id) + return nil, &ErrNotFound{fmt.Sprintf("FileType with id: %v", ftuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one FileType with the same id: %v", ftuo.id) } diff --git a/entc/integration/ent/group_update.go b/entc/integration/ent/group_update.go index a9f6dbb47..3b2da0db6 100644 --- a/entc/integration/ent/group_update.go +++ b/entc/integration/ent/group_update.go @@ -977,7 +977,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (gr *Group, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Group not found with id: %v", guo.id) + return nil, &ErrNotFound{fmt.Sprintf("Group with id: %v", guo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Group with the same id: %v", guo.id) } diff --git a/entc/integration/ent/groupinfo_update.go b/entc/integration/ent/groupinfo_update.go index eacd4a026..dbc5f64b0 100644 --- a/entc/integration/ent/groupinfo_update.go +++ b/entc/integration/ent/groupinfo_update.go @@ -444,7 +444,7 @@ func (giuo *GroupInfoUpdateOne) sqlSave(ctx context.Context) (gi *GroupInfo, err } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: GroupInfo not found with id: %v", giuo.id) + return nil, &ErrNotFound{fmt.Sprintf("GroupInfo with id: %v", giuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one GroupInfo with the same id: %v", giuo.id) } diff --git a/entc/integration/ent/node_update.go b/entc/integration/ent/node_update.go index 666efb0ec..bf2ae0089 100644 --- a/entc/integration/ent/node_update.go +++ b/entc/integration/ent/node_update.go @@ -524,7 +524,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Node not found with id: %v", nuo.id) + return nil, &ErrNotFound{fmt.Sprintf("Node with id: %v", nuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Node with the same id: %v", nuo.id) } diff --git a/entc/integration/ent/pet_update.go b/entc/integration/ent/pet_update.go index 38c780fdf..3aef24be1 100644 --- a/entc/integration/ent/pet_update.go +++ b/entc/integration/ent/pet_update.go @@ -443,7 +443,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (pe *Pet, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Pet not found with id: %v", puo.id) + return nil, &ErrNotFound{fmt.Sprintf("Pet with id: %v", puo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Pet with the same id: %v", puo.id) } diff --git a/entc/integration/ent/user_update.go b/entc/integration/ent/user_update.go index c95ea04da..995161e3f 100644 --- a/entc/integration/ent/user_update.go +++ b/entc/integration/ent/user_update.go @@ -1849,7 +1849,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/entc/integration/idtype/ent/user_update.go b/entc/integration/idtype/ent/user_update.go index 51daf9ab6..2af75c838 100644 --- a/entc/integration/idtype/ent/user_update.go +++ b/entc/integration/idtype/ent/user_update.go @@ -510,7 +510,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/entc/integration/json/ent/user_update.go b/entc/integration/json/ent/user_update.go index b3bdbcd5f..7d88dce15 100644 --- a/entc/integration/json/ent/user_update.go +++ b/entc/integration/json/ent/user_update.go @@ -394,7 +394,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/entc/integration/migrate/entv1/user_update.go b/entc/integration/migrate/entv1/user_update.go index a54b23543..00c54d0ed 100644 --- a/entc/integration/migrate/entv1/user_update.go +++ b/entc/integration/migrate/entv1/user_update.go @@ -424,7 +424,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("entv1: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("entv1: more than one User with the same id: %v", uuo.id) } diff --git a/entc/integration/migrate/entv2/group_update.go b/entc/integration/migrate/entv2/group_update.go index cd93210bc..d3b25eba1 100644 --- a/entc/integration/migrate/entv2/group_update.go +++ b/entc/integration/migrate/entv2/group_update.go @@ -141,7 +141,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (gr *Group, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("entv2: Group not found with id: %v", guo.id) + return nil, &ErrNotFound{fmt.Sprintf("Group with id: %v", guo.id)} case n > 1: return nil, fmt.Errorf("entv2: more than one Group with the same id: %v", guo.id) } diff --git a/entc/integration/migrate/entv2/pet_update.go b/entc/integration/migrate/entv2/pet_update.go index a125452b0..c31565593 100644 --- a/entc/integration/migrate/entv2/pet_update.go +++ b/entc/integration/migrate/entv2/pet_update.go @@ -141,7 +141,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (pe *Pet, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("entv2: Pet not found with id: %v", puo.id) + return nil, &ErrNotFound{fmt.Sprintf("Pet with id: %v", puo.id)} case n > 1: return nil, fmt.Errorf("entv2: more than one Pet with the same id: %v", puo.id) } diff --git a/entc/integration/migrate/entv2/user_update.go b/entc/integration/migrate/entv2/user_update.go index 70025a05f..b143818ee 100644 --- a/entc/integration/migrate/entv2/user_update.go +++ b/entc/integration/migrate/entv2/user_update.go @@ -429,7 +429,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("entv2: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("entv2: more than one User with the same id: %v", uuo.id) } diff --git a/entc/integration/template/ent/group_update.go b/entc/integration/template/ent/group_update.go index 966f39c1e..66680e922 100644 --- a/entc/integration/template/ent/group_update.go +++ b/entc/integration/template/ent/group_update.go @@ -195,7 +195,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (gr *Group, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Group not found with id: %v", guo.id) + return nil, &ErrNotFound{fmt.Sprintf("Group with id: %v", guo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Group with the same id: %v", guo.id) } diff --git a/entc/integration/template/ent/pet_update.go b/entc/integration/template/ent/pet_update.go index 0c5beb396..ccaef41fe 100644 --- a/entc/integration/template/ent/pet_update.go +++ b/entc/integration/template/ent/pet_update.go @@ -283,7 +283,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (pe *Pet, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Pet not found with id: %v", puo.id) + return nil, &ErrNotFound{fmt.Sprintf("Pet with id: %v", puo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Pet with the same id: %v", puo.id) } diff --git a/entc/integration/template/ent/user_update.go b/entc/integration/template/ent/user_update.go index 51a3806bb..d3d7b7922 100644 --- a/entc/integration/template/ent/user_update.go +++ b/entc/integration/template/ent/user_update.go @@ -410,7 +410,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/examples/edgeindex/ent/city_update.go b/examples/edgeindex/ent/city_update.go index 5f162e1f6..611b30da4 100644 --- a/examples/edgeindex/ent/city_update.go +++ b/examples/edgeindex/ent/city_update.go @@ -289,7 +289,7 @@ func (cuo *CityUpdateOne) sqlSave(ctx context.Context) (c *City, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: City not found with id: %v", cuo.id) + return nil, &ErrNotFound{fmt.Sprintf("City with id: %v", cuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one City with the same id: %v", cuo.id) } diff --git a/examples/edgeindex/ent/street_update.go b/examples/edgeindex/ent/street_update.go index c2bb0a8f7..c263f95a4 100644 --- a/examples/edgeindex/ent/street_update.go +++ b/examples/edgeindex/ent/street_update.go @@ -256,7 +256,7 @@ func (suo *StreetUpdateOne) sqlSave(ctx context.Context) (s *Street, err error) } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Street not found with id: %v", suo.id) + return nil, &ErrNotFound{fmt.Sprintf("Street with id: %v", suo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Street with the same id: %v", suo.id) } diff --git a/examples/m2m2types/ent/group_update.go b/examples/m2m2types/ent/group_update.go index 263a4cc2e..d60f89210 100644 --- a/examples/m2m2types/ent/group_update.go +++ b/examples/m2m2types/ent/group_update.go @@ -282,7 +282,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (gr *Group, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Group not found with id: %v", guo.id) + return nil, &ErrNotFound{fmt.Sprintf("Group with id: %v", guo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Group with the same id: %v", guo.id) } diff --git a/examples/m2m2types/ent/user_update.go b/examples/m2m2types/ent/user_update.go index a626fd411..30b0aaa86 100644 --- a/examples/m2m2types/ent/user_update.go +++ b/examples/m2m2types/ent/user_update.go @@ -326,7 +326,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/examples/m2mbidi/ent/user_update.go b/examples/m2mbidi/ent/user_update.go index 4564bc72c..7384d5032 100644 --- a/examples/m2mbidi/ent/user_update.go +++ b/examples/m2mbidi/ent/user_update.go @@ -333,7 +333,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/examples/m2mrecur/ent/user_update.go b/examples/m2mrecur/ent/user_update.go index 0618e46b5..1d4150691 100644 --- a/examples/m2mrecur/ent/user_update.go +++ b/examples/m2mrecur/ent/user_update.go @@ -440,7 +440,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/examples/o2m2types/ent/pet_update.go b/examples/o2m2types/ent/pet_update.go index 3265f2b9c..c81ebefff 100644 --- a/examples/o2m2types/ent/pet_update.go +++ b/examples/o2m2types/ent/pet_update.go @@ -256,7 +256,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (pe *Pet, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Pet not found with id: %v", puo.id) + return nil, &ErrNotFound{fmt.Sprintf("Pet with id: %v", puo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Pet with the same id: %v", puo.id) } diff --git a/examples/o2m2types/ent/user_update.go b/examples/o2m2types/ent/user_update.go index 431dda79e..67168bc9c 100644 --- a/examples/o2m2types/ent/user_update.go +++ b/examples/o2m2types/ent/user_update.go @@ -333,7 +333,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/examples/o2mrecur/ent/node_update.go b/examples/o2mrecur/ent/node_update.go index 6d7738fb0..c052ad392 100644 --- a/examples/o2mrecur/ent/node_update.go +++ b/examples/o2mrecur/ent/node_update.go @@ -402,7 +402,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Node not found with id: %v", nuo.id) + return nil, &ErrNotFound{fmt.Sprintf("Node with id: %v", nuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Node with the same id: %v", nuo.id) } diff --git a/examples/o2o2types/ent/card_update.go b/examples/o2o2types/ent/card_update.go index 8afe7bfe3..336a05a54 100644 --- a/examples/o2o2types/ent/card_update.go +++ b/examples/o2o2types/ent/card_update.go @@ -272,7 +272,7 @@ func (cuo *CardUpdateOne) sqlSave(ctx context.Context) (c *Card, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Card not found with id: %v", cuo.id) + return nil, &ErrNotFound{fmt.Sprintf("Card with id: %v", cuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Card with the same id: %v", cuo.id) } diff --git a/examples/o2o2types/ent/user_update.go b/examples/o2o2types/ent/user_update.go index 305382b31..67d9ea276 100644 --- a/examples/o2o2types/ent/user_update.go +++ b/examples/o2o2types/ent/user_update.go @@ -308,7 +308,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/examples/o2obidi/ent/user_update.go b/examples/o2obidi/ent/user_update.go index 9c2e5024b..51646ccae 100644 --- a/examples/o2obidi/ent/user_update.go +++ b/examples/o2obidi/ent/user_update.go @@ -321,7 +321,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/examples/o2orecur/ent/node_update.go b/examples/o2orecur/ent/node_update.go index c16745343..ef2bf8d3e 100644 --- a/examples/o2orecur/ent/node_update.go +++ b/examples/o2orecur/ent/node_update.go @@ -384,7 +384,7 @@ func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (n *Node, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Node not found with id: %v", nuo.id) + return nil, &ErrNotFound{fmt.Sprintf("Node with id: %v", nuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Node with the same id: %v", nuo.id) } diff --git a/examples/start/ent/car_update.go b/examples/start/ent/car_update.go index c32f6bce0..f9dddb1bc 100644 --- a/examples/start/ent/car_update.go +++ b/examples/start/ent/car_update.go @@ -274,7 +274,7 @@ func (cuo *CarUpdateOne) sqlSave(ctx context.Context) (c *Car, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Car not found with id: %v", cuo.id) + return nil, &ErrNotFound{fmt.Sprintf("Car with id: %v", cuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Car with the same id: %v", cuo.id) } diff --git a/examples/start/ent/group_update.go b/examples/start/ent/group_update.go index 5c70913de..a76d8e387 100644 --- a/examples/start/ent/group_update.go +++ b/examples/start/ent/group_update.go @@ -292,7 +292,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (gr *Group, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Group not found with id: %v", guo.id) + return nil, &ErrNotFound{fmt.Sprintf("Group with id: %v", guo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Group with the same id: %v", guo.id) } diff --git a/examples/start/ent/user_update.go b/examples/start/ent/user_update.go index 8a94365ed..95a2466dc 100644 --- a/examples/start/ent/user_update.go +++ b/examples/start/ent/user_update.go @@ -473,7 +473,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) } diff --git a/examples/traversal/ent/group_update.go b/examples/traversal/ent/group_update.go index 4677cbe35..1fffc4ac0 100644 --- a/examples/traversal/ent/group_update.go +++ b/examples/traversal/ent/group_update.go @@ -370,7 +370,7 @@ func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (gr *Group, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Group not found with id: %v", guo.id) + return nil, &ErrNotFound{fmt.Sprintf("Group with id: %v", guo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Group with the same id: %v", guo.id) } diff --git a/examples/traversal/ent/pet_update.go b/examples/traversal/ent/pet_update.go index f979268cd..4d84fc995 100644 --- a/examples/traversal/ent/pet_update.go +++ b/examples/traversal/ent/pet_update.go @@ -377,7 +377,7 @@ func (puo *PetUpdateOne) sqlSave(ctx context.Context) (pe *Pet, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: Pet not found with id: %v", puo.id) + return nil, &ErrNotFound{fmt.Sprintf("Pet with id: %v", puo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one Pet with the same id: %v", puo.id) } diff --git a/examples/traversal/ent/user_update.go b/examples/traversal/ent/user_update.go index c98b54a75..406d3c8e2 100644 --- a/examples/traversal/ent/user_update.go +++ b/examples/traversal/ent/user_update.go @@ -689,7 +689,7 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (u *User, err error) { } switch n := len(ids); { case n == 0: - return nil, fmt.Errorf("ent: User not found with id: %v", uuo.id) + return nil, &ErrNotFound{fmt.Sprintf("User with id: %v", uuo.id)} case n > 1: return nil, fmt.Errorf("ent: more than one User with the same id: %v", uuo.id) }