diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index 500494628..4be566200 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -241,7 +241,7 @@ func templateBuilderUpdateTmpl() (*asset, error) { return a, nil } -var _templateClientTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\xdf\x6f\xe3\xb8\x11\x7e\xb6\xfe\x8a\xa9\xe0\xbd\x4a\x81\x43\x6d\xef\xad\x2e\xf6\xe1\x90\x6c\x0f\x06\xda\xe4\xda\x4d\xd1\x7b\x3b\xd0\xd4\x48\x66\x23\x93\x5a\x8a\x4a\x1c\xb8\xfe\xdf\x8b\x21\xa9\x5f\xb6\xe3\x64\x17\xbd\x97\xc4\x22\xa9\x99\x6f\xe6\xfb\x38\x1c\x71\xbf\xcf\xae\xa2\x1b\x5d\xbf\x18\x59\x6e\x2c\xfc\xf8\xf1\x4f\x7f\xbe\xae\x0d\x36\xa8\x2c\xfc\x95\x0b\x5c\x6b\xfd\x08\x2b\x25\x18\xfc\x54\x55\xe0\x16\x35\x40\xf3\xe6\x09\x73\x16\x3d\x6c\x64\x03\x8d\x6e\x8d\x40\x10\x3a\x47\x90\x0d\x54\x52\xa0\x6a\x30\x87\x56\xe5\x68\xc0\x6e\x10\x7e\xaa\xb9\xd8\x20\xfc\xc8\x3e\x76\xb3\x50\xe8\x56\xe5\x91\x54\x6e\xfe\x6f\xab\x9b\xcf\x77\x5f\x3e\x43\x21\x2b\x84\x30\x66\xb4\xb6\x90\x4b\x83\xc2\x6a\xf3\x02\xba\x00\x3b\x72\x66\x0d\x22\x8b\xae\xb2\xc3\x21\x8a\xf6\x7b\xc8\xb1\x90\x0a\x21\x16\x95\x44\x65\x63\x08\xc3\xf3\xfa\xb1\x84\xe5\x27\x58\xf3\x06\x61\xce\x6e\xb4\x2a\x64\xc9\x7e\xe1\xe2\x91\x97\x48\x8b\xf6\x7b\xb0\xb8\xad\x2b\x6e\x11\xe2\x0d\xf2\x1c\x4d\x0c\x73\xf7\xba\xdc\xd6\xda\x58\x48\xa2\x59\x5c\xe9\x32\x8e\xa2\x59\x4c\x16\x4f\x8d\x64\x5b\x59\x1a\x6e\x31\x8e\x66\xfb\x3d\x18\xae\x4a\x84\xf9\x6f\x0b\x98\x2b\x72\x3d\x67\x77\x3a\xc7\x86\x4c\xce\xbc\x05\x75\xc6\x84\x1f\x1f\x06\x9c\xad\x6b\x40\x95\x3b\x2c\xb3\xb8\x94\x76\xd3\xae\x99\xd0\xdb\xac\x08\xb4\x48\x25\xda\x35\xb7\xda\x64\xa8\x6c\x96\x4b\x5e\xa1\xb0\x27\x20\x1a\xab\x0d\xd9\x74\x50\xbe\x84\x87\x6b\x87\x66\xba\x30\xc4\x4b\xeb\xc2\x3b\x6c\xe5\x86\x9a\xb0\xdc\xa3\x0f\xcb\x1c\x44\xb2\x40\x10\xdd\xfc\xe8\x77\x1a\x45\x59\x06\x37\x8e\x0b\x52\x04\xd1\xe9\x99\x01\xbb\xe1\x16\x36\xba\xca\x1b\xe0\x55\x05\x34\xb4\x6e\x65\x95\xa3\x69\x58\x64\x5f\x6a\xec\x5e\x6b\xac\x69\x85\x85\x7d\x34\x13\x2e\x5b\xd1\x2c\xcb\xe0\x8b\xd8\xe0\x96\x1f\x99\x2c\xb4\x01\x61\x90\x5b\xa9\xca\x05\x78\x32\xa4\x2a\x81\xab\x1c\x72\xa3\xeb\x9a\x1e\x1a\xf7\x26\x8b\x66\xc1\xc4\x55\x20\x8d\xf9\xe7\x8b\xd4\xf9\xf0\xb3\x0c\x3c\x4b\x77\x7c\x4b\x14\x9d\x41\x21\x95\x45\xc3\x85\xf3\xfe\x2c\xed\xc6\xcd\x4f\x5f\x1a\x82\x75\xd9\x1b\xcd\x5c\x4d\x1e\x7d\x16\xfa\xac\x1e\x0e\xd1\xc1\x25\xf5\x0e\x9f\x43\x82\x5c\xc8\xd8\x00\x07\x85\xcf\x1d\x0a\x9f\xab\xd6\x60\x3e\x00\x28\xe5\x13\x2a\xd0\xb5\x95\x5a\x35\x2c\x2a\x5a\x25\x06\x33\x89\xae\x6d\x03\x8c\xb1\x7b\x37\x9f\xc2\x55\x30\x4f\x89\xa7\x24\x78\x8b\xfb\x4a\x97\x4b\xa8\x74\xc9\x7e\x31\x52\xd9\x4a\x1d\xa2\x99\x60\xc1\xa6\xb3\xc1\x18\x4b\xa3\x99\x41\xdb\x1a\x05\x3f\x78\x23\xfb\x68\x16\xd8\x5b\x82\x58\x44\xb3\x90\xfc\x25\x74\xc9\xbf\xc3\x67\x3f\x94\x08\x96\x1b\xf9\x84\x26\x5d\x9c\x08\xf3\x0c\x17\xd3\xd4\x2d\x29\x9c\x33\xd9\x4b\x44\x67\xad\x17\x69\x97\xc6\xfb\xda\xa5\x04\x15\xe5\x4f\x68\xa5\x50\x50\x28\x60\xb5\x4b\x59\xce\x2d\x77\x35\xa3\xa9\x51\xc8\x42\x62\x0e\xeb\x17\x3f\xe3\x50\x82\x22\x3f\x24\x30\x4e\xd6\xfc\xe0\x75\x58\x2c\xdc\xeb\x5d\xa1\xa2\x95\x0b\xb7\xd4\xe7\xe6\x88\x30\x6e\x2d\x95\xc6\x9c\x3c\x4b\xcb\x3c\x36\x82\xc2\x2b\xa8\xb9\xe1\x5b\xb4\x68\x1a\x10\x5c\xc1\x1a\x81\xe7\x39\xe6\x5e\xf0\x81\x68\x92\xda\xa0\xc2\xc0\x2e\x45\x97\x78\x50\x77\xce\x3d\x01\xfa\xe2\xf0\xb8\x04\x35\xd6\xb8\xbd\x12\xf8\x1b\xd3\x9f\x04\xfe\x17\x80\xc6\x68\x93\x92\x0e\x9a\x67\x69\xc5\x06\x06\x83\x34\x48\xe5\xe9\xad\x32\xe3\xb8\x12\x94\xc7\xfd\x1e\xfe\xa3\xa5\x1a\x4a\xcb\xad\x2f\x57\x0d\xc4\x0b\xa0\x72\xbd\xf4\xac\x5e\xc3\xdc\x6e\xeb\x8a\xcc\xd4\x24\xb4\x02\xe2\x50\xd8\xb2\x0f\x4d\xe6\x83\xcc\x88\xb7\x78\x70\xd9\x4b\xe2\x1a\x76\x7d\x31\xf7\x66\x58\x57\x9a\xfa\x52\x3a\xcb\xb1\xe0\x6d\x65\xc9\x5f\x10\xab\x92\xd5\x02\x8a\xad\x65\x9f\x29\xe2\x22\x89\x5b\xd5\xb4\x35\x55\x39\xcc\x43\xd0\x4b\xf8\xf0\x35\x5e\x8c\x32\x90\x0e\x52\x7a\xd8\x1d\x31\x6b\x0d\x57\x0d\x17\x81\xc4\x09\x31\x89\xe8\xf6\x57\x0a\x0f\xbb\x44\xd8\x1d\x11\x69\x71\x67\xe9\x4c\xa0\xff\xc4\xc0\xc3\x6e\x9c\x7d\x59\xc0\x6f\x0b\xd0\x8f\x6e\x33\x86\x5d\xc2\x92\x2b\xbb\xbb\xf5\x1b\xe6\x2f\x34\xb7\xbf\x10\x4e\x77\x0e\xd2\x46\x11\x5c\x29\x4d\xc5\x95\x1b\x0b\x7c\x0c\xd5\xd5\x0b\xa9\xa6\x83\xb1\x8b\x73\x66\x3d\x20\x42\xa0\xf0\xd9\x03\x5f\xf4\x60\x52\x87\x91\xe6\xff\xf0\x89\xbc\xbf\x1b\x8c\x43\xe1\x2a\xf5\xd8\xe7\x12\x3e\x3c\xc5\xce\x9f\x77\x2e\x8a\x72\x54\x87\x3a\x3e\x08\x80\xab\x49\x82\x55\xba\x5c\x40\x8e\xeb\xd6\x3d\xb9\x1f\x87\xa1\x12\x3d\xec\x26\x55\xa8\x28\xff\xaf\x05\xa6\x28\x4f\x4b\xcc\x82\xa2\x0e\xe2\xb8\x25\x34\x47\xfa\x70\x08\xaf\x83\x2e\x60\x65\xff\xd8\x40\xdb\xf8\x0a\x50\xa2\x85\x27\x34\x6b\xdd\x20\x45\x57\x52\x72\xb4\x82\xbe\xb0\xe8\x1a\xe9\x70\x73\x75\x3c\xcb\xa2\x2c\x9b\x05\x33\xce\x4f\x92\xd2\xa8\x43\x93\x48\x95\xe3\xae\x0f\xea\x63\xda\x01\xf7\x2b\xfe\xd1\xa2\x79\xe9\x96\xdf\xe8\x96\x42\xb1\xbb\x94\x6c\x9e\xe8\x34\x98\x1e\x1f\x0c\xb2\xe8\x12\x3d\xe6\x5a\x5c\xa0\x2b\x6c\xe2\x80\xb3\x53\xce\xc2\xb3\x97\x9e\xa5\xd2\x9a\x16\x0f\x17\x4f\x14\xcf\xe5\x85\x33\xa5\x28\x7f\x97\x53\xe5\x1c\xe9\x81\xef\x9b\x8a\xa8\x13\xf4\xb7\x99\x9e\x24\xa3\x43\x86\x0e\x83\xda\xe0\x13\x2a\xdb\x38\x45\x7c\x6d\xd1\x48\x6c\xa0\x30\x7a\xdb\xef\x8a\x33\x25\xc3\x59\x4f\x52\x5f\x1c\x28\xf5\x5d\xe6\xbb\xb2\x10\x16\x44\xbe\xfb\xbd\x14\x2d\x05\x16\x8e\xa0\xae\xd6\xf6\x91\xc6\x37\x43\x17\x1d\xba\x9e\xb0\xd4\x77\x3d\x7c\xdc\xf3\x9c\xb6\x38\x5d\xab\xe5\xba\xb9\xe9\xcb\x27\x4d\x5d\x68\xd3\x0d\xba\x5e\x63\xae\xd8\x3f\x51\xa0\x3b\x61\x0f\x87\xfd\x1e\xa8\xae\x7c\xf5\xd3\xb1\x88\xfd\x98\x7b\x1a\x8e\x87\x0f\xec\xc7\x26\xee\xdd\xff\x17\x2a\xfd\xdc\xbd\xdd\x75\xcf\xbe\x6d\x9a\x22\x19\xb6\xe4\xc5\x58\x1c\x23\x43\x13\xe5\x51\x0f\x3d\xd4\xc4\x66\x22\xc2\x7c\xea\x7b\xb9\xc1\xd9\xc0\xd4\x0f\x93\x89\x7d\x2f\xe5\x5e\x3f\xae\xa9\x1b\xa3\xf3\x03\xa1\x6d\x74\x28\x27\x08\x47\x2a\x99\x98\x4e\x83\xa9\x24\x3d\x6e\x2c\xbd\xc1\x23\x48\x47\xd3\x03\x30\xe6\x7f\x75\xf8\xfe\x55\xe7\x13\x7c\x0a\x5a\x3f\xf2\x1d\x00\xbd\xad\x13\x80\xc1\xc5\x6b\x00\xfd\xf4\x1b\x00\xef\xd5\x5b\x18\x07\x4e\x51\x59\x69\x5f\xde\x82\x79\xaf\x30\xe9\xc4\x77\xd2\xac\x9f\x0f\x81\x40\x8c\xf7\x68\x3f\xba\xba\x1d\x99\x62\xab\xdb\xf4\x18\xfb\xea\xf6\xdd\xe8\x65\xfe\x0e\xe4\xab\xdb\x44\xe6\x81\x96\xd5\x2d\x7b\xa0\x8d\xf9\x3e\xd4\xe7\x72\x7f\xaf\x4e\xd3\xbf\x00\x99\x2f\x41\xe6\x87\xfe\xdc\xab\x70\xa2\xe3\xdc\x0f\x7c\x87\x4c\xbc\xa9\x13\x99\x04\x0f\xaf\x41\xf5\xd3\xaf\xca\xc4\x4f\x4f\x64\x72\x0e\xe2\xfb\x55\xd2\x1b\x7c\xbf\x4a\x06\x0c\x63\x95\xf4\xa3\xaf\xa9\x64\xb4\xe0\xbd\xe0\x2f\x89\x64\xec\xef\x1d\x22\x39\x07\xfa\x5c\xe6\x9d\x48\x58\xc7\x1d\xfb\xf7\x06\x8d\x4f\xcd\xf8\x96\x83\x39\x9f\x69\xfa\x6a\xf5\xa3\x83\xf1\xe5\x7b\x44\x13\x1a\x9c\x23\xf0\x6e\xf4\x55\xe0\x6e\xf6\x55\xc5\xfc\x8c\x76\x04\x6c\x7a\x4a\x78\x71\xd0\x27\xa2\xb4\xcd\xc5\x6c\xff\x8c\xf6\x5c\xd7\x4f\xdb\xe7\x4c\xea\x93\x29\xfc\xf1\x57\x41\xaf\x97\xae\x95\xbb\x9c\x61\x76\xaf\xaa\x17\xdf\xe3\xf5\xe1\xfc\xea\x2f\xeb\x1e\x91\x1e\x16\xb0\x6e\x2d\xd4\x5c\x49\xd1\xd0\xb1\xcb\x55\xe8\x32\xb4\x10\xad\x69\x2e\x46\xf4\xeb\x37\x84\x34\x8d\xc8\x7f\x48\x76\x22\xef\x3f\x32\x04\x0b\x79\x22\x23\x67\x3f\x2f\x1c\xd0\xa4\xff\x46\x08\xd9\x18\x4c\x9d\x76\x40\x18\x1a\x8c\xcf\x79\xe9\x6f\xe3\x68\x71\xa7\xac\xbe\x05\x4a\x6a\xde\x08\x5e\xc1\x1c\x1d\x64\x87\x33\x85\xd8\x25\xb9\xeb\x87\xbc\x4e\xf6\x30\x2c\xed\xa2\xe9\xfa\xb8\xae\x8f\x18\x66\x30\x2f\x11\x74\x71\xac\x9c\x37\x04\x7c\xce\xc9\x9b\xf5\xa5\x8b\xc9\x67\xd7\xef\xa0\xe5\x27\xaf\xf5\x51\x54\x17\x04\x3f\xf3\x9d\xd7\x9c\xfd\xbd\xad\xac\x9c\xde\x19\x86\xbb\x80\xbe\xe3\x0c\xdf\xf1\x89\x13\xe5\xef\x76\x29\xe0\xee\xb2\x70\x67\xa9\xa3\x9b\x2b\x88\xbb\x2e\x31\x0e\xbd\x21\x91\x1a\x13\xc7\xa1\x91\x77\xa2\xba\x70\x91\xe0\xb2\x92\x51\x73\x37\xba\x47\xe8\x5f\x7d\xf5\x1e\x61\xda\xf3\x4f\xae\x15\x66\xdd\x35\x43\xd5\xe0\x68\xfa\x5b\x81\x7f\x03\xee\xfe\x13\xaf\x4b\xec\xc7\x14\xde\xbc\x09\x39\xba\xb1\x1d\xf0\x87\x1d\xe4\x1c\x44\x6e\x73\x74\xdd\xf3\xf0\x73\x34\xf8\xbf\x00\x00\x00\xff\xff\xa5\x32\xdc\x63\x37\x18\x00\x00") +var _templateClientTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x59\xdf\x73\xdb\xb8\x11\x7e\x16\xff\x8a\x2d\x47\xb9\x92\x1e\x99\x4c\xf3\x56\x77\xf2\x90\xb1\xd3\x1b\xcf\xb4\xf6\xb5\x71\xa7\xf7\x76\x03\x03\x4b\x0a\x0d\x05\x30\x00\x68\xcb\xa3\xfa\x7f\xef\x2c\x00\xfe\x92\x64\xd9\xc9\xf4\x5e\x12\x11\x00\x17\xdf\xee\xf7\x61\xb1\x5c\xef\x76\xe5\x59\x72\xa9\xdb\x27\x23\xeb\xb5\x83\x0f\xef\xff\xf4\xe7\xf3\xd6\xa0\x45\xe5\xe0\xaf\x8c\xe3\xbd\xd6\x5f\xe1\x5a\xf1\x02\x3e\x35\x0d\xf8\x45\x16\x68\xde\x3c\xa0\x28\x92\xbb\xb5\xb4\x60\x75\x67\x38\x02\xd7\x02\x41\x5a\x68\x24\x47\x65\x51\x40\xa7\x04\x1a\x70\x6b\x84\x4f\x2d\xe3\x6b\x84\x0f\xc5\xfb\x7e\x16\x2a\xdd\x29\x91\x48\xe5\xe7\xff\x76\x7d\xf9\xf9\xe6\xcb\x67\xa8\x64\x83\x10\xc7\x8c\xd6\x0e\x84\x34\xc8\x9d\x36\x4f\xa0\x2b\x70\x93\xcd\x9c\x41\x2c\x92\xb3\xf2\xf9\x39\x49\x76\x3b\x10\x58\x49\x85\x90\xf2\x46\xa2\x72\x29\xc4\xe1\x65\xfb\xb5\x86\x8b\x8f\x70\xcf\x2c\xc2\xb2\xb8\xd4\xaa\x92\x75\xf1\x0b\xe3\x5f\x59\x8d\xb4\x68\xb7\x03\x87\x9b\xb6\x61\x0e\x21\x5d\x23\x13\x68\x52\x58\xfa\xd7\xe5\xa6\xd5\xc6\x41\x96\x2c\xd2\x46\xd7\x69\x92\x2c\x52\xb2\x78\x68\xa4\xdc\xc8\xda\x30\x87\x69\xb2\xd8\xed\xc0\x30\x55\x23\x2c\x7f\x5b\xc1\x52\xd1\xd6\xcb\xe2\x46\x0b\xb4\x64\x72\x11\x2c\xa8\x23\x26\xc2\xf8\x38\xe0\x6d\x9d\x03\x2a\xe1\xb1\x2c\xd2\x5a\xba\x75\x77\x5f\x70\xbd\x29\xab\x48\x8b\x54\xbc\xbb\x67\x4e\x9b\x12\x95\x2b\x85\x64\x0d\x72\x77\x00\xc2\x3a\x6d\xc8\xa6\x87\xf2\x25\x3e\x9c\x7b\x34\xf3\x85\xd1\x5f\x5a\x17\xdf\x29\xae\xfd\x90\x8d\xcb\x03\xfa\xb8\xcc\x43\x24\x0b\x04\xd1\xcf\x4f\x7e\xe7\x49\x52\x96\x70\xe9\xb9\x20\x45\x10\x9d\x81\x19\x70\x6b\xe6\x60\xad\x1b\x61\x81\x35\x0d\xd0\xd0\x7d\x27\x1b\x81\xc6\x16\x89\x7b\x6a\xb1\x7f\xcd\x3a\xd3\x71\x07\xbb\x64\xc1\x7d\xb4\x92\x45\x59\xc2\x17\xbe\xc6\x0d\xdb\x33\x59\x69\x03\xdc\x20\x73\x52\xd5\x2b\x08\x64\x48\x55\x03\x53\x02\x84\xd1\x6d\x4b\x0f\xd6\xbf\x59\x24\x8b\x68\xe2\x2c\x92\x56\x84\xe7\x93\xd4\x05\xf7\xcb\x12\x02\x4b\x37\x6c\x43\x14\x1d\x41\x21\x95\x43\xc3\xb8\xdf\xfd\x51\xba\xb5\x9f\x9f\xbf\x34\x3a\xeb\xa3\x37\x99\x39\x9b\x3d\x86\x28\x0c\x51\x8d\x01\x1e\xb5\x1a\x76\x2d\x2b\x89\x8d\xb0\x25\x13\x42\x3a\xa9\x15\x6b\xa2\x7a\x9f\x3d\x03\x37\xf8\x18\xa3\xe9\xe3\x83\x16\x18\x28\x7c\xec\x21\x87\xc0\x76\x06\xc5\x88\xb6\x96\x0f\xa8\x40\xb7\x64\xcd\x16\x49\xd5\x29\x3e\x9a\xc9\x74\xeb\x2c\x14\x45\x71\xeb\xe7\x73\x38\x8b\xe6\x89\x25\x8a\x58\xb0\xb8\x6b\x74\x7d\x01\x8d\xae\x8b\x5f\x8c\x54\xae\x51\xcf\xc9\x82\x17\xd1\xa6\xb7\x51\x14\x45\x9e\x2c\x0c\xba\xce\x28\xf8\x29\x18\xd9\x25\x8b\x48\xf5\x05\xf0\x55\xb2\x88\x4c\x5d\x40\xcf\xd4\x0d\x3e\x86\xa1\x8c\x17\xc2\xc8\x07\x34\xf9\xea\x40\xc5\x47\x88\x9b\xc7\xf9\x82\xdc\x39\x12\xea\x8c\xf7\xd6\x06\x45\xf7\x61\xbc\x6d\x7d\x48\x50\x51\xfc\xb8\x56\x0a\x39\xb9\x02\x4e\xfb\x90\x09\xe6\x98\x4f\x30\xb6\x45\x2e\x2b\x89\x02\xee\x9f\xc2\x8c\x47\x09\x8a\xf6\x21\x35\x32\xb2\x16\x06\xcf\xe3\x62\xee\x5f\xef\xb3\x1a\xad\x5c\xf9\xa5\x21\x36\x7b\x84\x31\xe7\x28\x8f\x0a\xda\x59\xba\x22\x60\x0b\xbc\x43\xcb\x0c\xdb\xa0\x43\x63\x81\x33\x05\xf7\x08\x4c\x08\x14\xe1\x74\x44\xa2\x49\x97\xa3\x64\x23\xbb\xe4\x5d\x16\x40\xdd\xf8\xed\x09\xd0\x17\x8f\xc7\x07\xc8\x3a\xe3\x0f\x56\xe4\x6f\x4a\x7f\x16\xf9\x5f\x01\x1a\xa3\x4d\x4e\x3a\xb0\x8f\xd2\xf1\x35\x8c\x06\x69\x90\x72\xd9\x6b\x39\xc9\x73\xc5\x29\x8e\xbb\x1d\xfc\x47\x4b\x35\xe6\xa1\xab\x90\xdb\x2c\xa4\x2b\xa0\xdc\x7e\x11\x58\x3d\x87\xa5\xdb\xb4\x0d\x99\x69\x49\x68\x15\xa4\x31\x0b\x96\xef\x6c\x19\x4f\x08\xf1\x96\x8e\x5b\x0e\x92\x38\x87\xed\x70\x9a\x82\x99\xa2\xcf\x63\x43\xde\x5d\x08\xac\x58\xd7\x38\xda\x2f\x8a\x55\xc9\x66\x05\xd5\xc6\x15\x9f\xc9\xe3\x2a\x4b\x3b\x65\xbb\x96\x52\x22\x8a\xe8\xf4\x05\xbc\xfb\x96\xae\x26\x11\xc8\x47\x29\xdd\x6d\xf7\x98\x75\x86\x29\xcb\x78\x24\x71\x46\x4c\xc6\xfb\xf3\x95\xc3\xdd\x36\xe3\x6e\x4b\x44\x3a\xdc\x3a\xba\x40\xe8\x7f\x62\xe0\x6e\x3b\x8d\xbe\xac\xe0\xb7\x15\xe8\xaf\xfe\x30\xc6\x53\x52\x64\x67\x6e\x7b\x15\x0e\xcc\x5f\x68\x6e\x77\xc2\x9d\xfe\xd2\xa4\x83\xc2\x99\x52\x9a\x32\x31\x33\x0e\xd8\x14\xaa\xcf\x17\x52\xcd\x07\x53\xef\xe7\xc2\x05\x40\x84\x40\xe1\x63\x00\xbe\x1a\xc0\xe4\x1e\x23\xcd\xff\xe1\x23\xed\xfe\x66\x30\x1e\x85\x4f\xeb\xd3\x3d\x2f\xe0\xdd\x43\xea\xf7\x0b\x9b\xf3\xaa\x9e\xe4\xa1\x9e\x0f\x02\xe0\x73\x12\x2f\x1a\x5d\xaf\x40\xe0\x7d\xe7\x9f\xfc\x8f\xe7\x31\x13\xdd\x6d\x67\x59\xa8\xaa\xff\xaf\x09\xa6\xaa\x0f\x53\xcc\x8a\xbc\x8e\xe2\xb8\x22\x34\x7b\xfa\xf0\x08\xcf\xa3\x2e\xe0\xda\xfd\xd1\x42\x67\x43\x06\xa8\xd1\xc1\x03\x9a\x7b\x6d\x91\xbc\xab\x29\x38\x5a\xc1\x90\x58\x74\x8b\x74\x13\xfa\x3c\x5e\x96\x49\x59\x2e\xa2\x19\xbf\x4f\x96\xd3\xa8\x47\x93\x49\x25\x70\x3b\x38\xf5\x3e\xef\x81\x87\x15\xff\xe8\xd0\x3c\xf5\xcb\x2f\x75\x47\xae\xb8\x6d\x4e\x36\x0f\x74\x1a\x4d\x4f\x2f\x06\x59\xf5\x81\x9e\x72\xcd\x4f\xd0\x15\x0f\x71\xc4\xd9\x2b\x67\x15\xd8\xcb\x8f\x52\xe9\x4c\x87\xcf\x27\x6f\x94\xc0\xe5\x89\x3b\xa5\xaa\x7f\x97\x5b\xe5\x18\xe9\x91\xef\xcb\x86\xa8\xe3\xf4\xaf\x9d\xdf\x24\x93\x4b\x86\x2e\x83\xd6\xe0\x03\x2a\x67\xbd\x22\xbe\x75\x68\x24\x5a\xa8\x8c\xde\x0c\xa7\xe2\x48\xca\xf0\xd6\xb3\x3c\x24\x07\x0a\x7d\x1f\xf9\x3e\x2d\xc4\x05\x49\x28\x95\x4f\x79\x4b\x8e\xc5\x2b\xa8\xcf\xb5\x83\xa7\xe9\xe5\x58\x72\xc7\x12\x29\x2e\x0d\x25\x12\x9b\x16\x48\x87\xf5\x50\x5f\x97\xf9\xd2\x6f\xfe\xf2\x41\x05\x18\x6b\x7a\x83\xbe\xd6\x58\xaa\xe2\x9f\xc8\xd1\xdf\xb0\xcf\xcf\xbb\x1d\x50\x5e\xf9\x16\xa6\x53\x9e\x86\x31\xff\x34\x5e\x0f\xef\x8a\x0f\x36\x1d\xb6\xff\x2f\x34\xfa\xb1\x7f\xbb\x2f\xb5\x43\xd9\x34\x47\x32\x1e\xc9\x93\xbe\x78\x46\xc6\x22\x2a\xa0\x1e\x6b\xa8\x99\xcd\x8c\xc7\xf9\x3c\x14\x7e\xe3\x66\x23\x53\x3f\xcd\x26\x76\x83\x94\x07\xfd\xf8\xa2\x6e\x8a\x2e\x0c\xc4\x1a\xd3\xa3\x9c\x21\x9c\xa8\x64\x66\x3a\x8f\xa6\xb2\x7c\xbf\x0a\x0d\x06\xf7\x20\xed\x4d\x8f\xc0\x8a\xf0\xab\xc7\xf7\xaf\x56\xcc\xf0\x29\xe8\xc2\xc8\x0f\x00\x0c\xb6\x0e\x00\xc6\x2d\x5e\x02\x18\xa6\x5f\x01\x78\xab\x5e\xc3\x38\x72\x8a\xca\x49\xf7\xf4\x1a\xcc\x5b\x85\x59\x2f\xbe\x83\xca\xfe\xb8\x0b\x04\x62\x7a\x46\x87\xd1\xeb\xab\x89\xa9\xe2\xfa\x2a\xdf\xc7\x7e\x7d\xf5\x66\xf4\x52\xbc\x01\xf9\xf5\x55\x26\x45\xa4\xe5\xfa\xaa\xb8\xa3\x83\xf9\x36\xd4\xc7\x62\x7f\xab\x0e\xc3\xbf\x02\x29\x2e\x40\x8a\xe7\xe1\xde\x6b\x70\xa6\x63\x11\x06\x7e\x40\x26\xc1\xd4\x81\x4c\xe2\x0e\x2f\x41\x0d\xd3\x2f\xca\x24\x4c\xcf\x64\x72\x0c\xe2\xdb\x55\x32\x18\x7c\xbb\x4a\x46\x0c\x53\x95\x0c\xa3\x2f\xa9\x64\xb2\xe0\xad\xe0\x4f\x89\x64\xba\xdf\x1b\x44\x72\x0c\xf4\xb1\xc8\x7b\x91\x14\x3d\x77\xc5\xbf\xd7\x68\x42\x68\xa6\x2d\x91\xc2\xef\x99\xe7\x2f\x66\x3f\xba\x18\x9f\x7e\x44\x34\xb1\xc0\xd9\x03\xef\x47\x5f\x04\xee\x67\x5f\x54\xcc\xcf\xe8\x26\xc0\xe6\xb7\x44\x10\x07\x7d\x22\x4a\x67\x4f\x46\xfb\x67\x74\xc7\xaa\x7e\x3a\x3e\x47\x42\x9f\xcd\xe1\x4f\xbf\x0a\x06\xbd\xf4\xa5\xdc\xe9\x08\x17\xb7\xaa\x79\x0a\x35\xde\xe0\xce\xaf\xa1\xb3\xf7\x15\xe9\x61\x05\xf7\x9d\x83\x96\x29\xc9\x2d\x5d\xbb\x4c\xc5\x2a\x43\x73\xde\x19\x7b\xd2\xa3\x5f\xbf\xc3\xa5\xb9\x47\xe1\x43\xb2\x17\xf9\xf0\x91\xc1\x8b\x18\x27\x32\x72\xf4\xf3\xc2\x03\xcd\x86\x6f\x84\x18\x8d\xd1\xd4\x61\x05\x84\xb1\xc0\xf8\x2c\xea\xd0\xba\xa3\xc5\xbd\xb2\x86\x12\x28\x6b\x99\xe5\xac\x81\x25\x7a\xc8\x1e\x67\x0e\xa9\x0f\x72\x5f\x0f\x05\x9d\xec\x60\x5c\xda\x7b\xd3\xd7\x71\x7d\x1d\x31\xce\xa0\xa8\x11\x74\xb5\xaf\x9c\x57\x04\x7c\x6c\x93\x57\xf3\x4b\xef\x53\x88\x6e\x38\x41\x17\x1f\x83\xd6\x27\x5e\x9d\x10\xfc\x22\x54\x5e\xcb\xe2\xef\x5d\xe3\xe4\xbc\xc1\x18\x7b\x01\x43\xc5\x19\xbf\xe3\x33\x2f\xca\xdf\xad\x29\xe0\x7b\x59\xb8\x75\x54\xd1\x2d\x15\xa4\x7d\x95\x98\xc6\xda\x90\x48\x4d\x89\xe3\x58\xc8\x7b\x51\x9d\x68\x24\xf8\xa8\x94\x54\xdc\x4d\xfa\x08\xc3\xab\x2f\xf6\x11\xe6\x35\xff\xac\xad\xb0\xe8\xdb\x0c\x8d\xc5\xc9\xf4\xf7\x02\xff\x0e\xdc\xc3\x27\x5e\x1f\xd8\xf7\x39\xbc\xda\x09\xd9\x6b\xef\x8e\xf8\xe3\x09\xf2\x1b\x24\xfe\x70\xf4\xd5\xf3\xf8\x73\x36\x58\x9e\xc1\xa7\xb1\x79\xe9\x7b\xc0\xb1\x49\xa5\x1f\xd0\x18\x29\x50\x80\x54\xa0\x8d\xff\x83\x81\x06\x26\x04\x8c\x3d\x4d\x08\x5d\xce\xbe\xdf\x16\xbf\x62\x7d\xef\xff\xa0\xf5\x7f\xac\x23\x4a\xf5\x3d\x2a\x41\x50\xfe\x17\x00\x00\xff\xff\xf7\x54\x6a\x40\xef\x18\x00\x00") func templateClientTmplBytes() ([]byte, error) { return bindataRead( @@ -256,7 +256,7 @@ func templateClientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/client.tmpl", size: 6199, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/client.tmpl", size: 6383, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/client.tmpl b/entc/gen/template/client.tmpl index 9bc29aad2..3c9aba93d 100644 --- a/entc/gen/template/client.tmpl +++ b/entc/gen/template/client.tmpl @@ -34,6 +34,7 @@ type Client struct { // {{ $n.Name }} is the client for interacting with the {{ $n.Name }} builders. {{ $n.Name }} *{{ $n.Name }}Client {{ end }} + {{ template "client/fields/additional" $ }} } // NewClient creates a new client configured with the given options. @@ -204,3 +205,6 @@ func (c *{{ $client }}) Query{{ pascal $e.Name }}({{ $rec }} *{{ $n.Name }}) *{{ {{ end }} {{ end }} +{{/* A template that can be overrided in order to add additional fields to the client.*/}} +{{ define "client/fields/additional" }}{{end}} + diff --git a/entc/integration/template/ent/client.go b/entc/integration/template/ent/client.go index eb2fed904..ec828b5d2 100644 --- a/entc/integration/template/ent/client.go +++ b/entc/integration/template/ent/client.go @@ -10,6 +10,7 @@ import ( "context" "fmt" "log" + "sync" "github.com/facebookincubator/ent/entc/integration/template/ent/migrate" @@ -32,6 +33,10 @@ type Client struct { Pet *PetClient // User is the client for interacting with the User builders. User *UserClient + + // additional fields. + sync.Mutex + tables []string } // NewClient creates a new client configured with the given options. diff --git a/entc/integration/template/ent/template/client.tmpl b/entc/integration/template/ent/template/client.tmpl new file mode 100644 index 000000000..56efe6405 --- /dev/null +++ b/entc/integration/template/ent/template/client.tmpl @@ -0,0 +1,11 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + +{{ define "client/fields/additional" }} + // additional fields. + sync.Mutex + tables []string +{{ end }} \ No newline at end of file diff --git a/entc/integration/template/template_test.go b/entc/integration/template/template_test.go index 703c40408..67e3a039a 100644 --- a/entc/integration/template/template_test.go +++ b/entc/integration/template/template_test.go @@ -42,4 +42,7 @@ func TestCustomTemplate(t *testing.T) { require.NoError(t, err) require.Equal(t, g.ID, node.ID) require.Equal(t, &ent.Field{Type: "int", Name: "MaxUsers", Value: "10"}, node.Fields[0]) + + // compile time check for client fields. + _ = &client.Mutex }