diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index d0cb18ef6..48aebc2a1 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -1044,7 +1044,7 @@ func templateRuntimeTmpl() (*asset, error) { return a, nil } -var _templateTxTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x57\x5f\x8b\xdb\x48\x12\x7f\x96\x3e\x45\x9d\x19\x82\x35\x38\x52\x2e\x6f\x37\x30\x0f\x61\x92\x40\x20\x37\xc7\x5d\x1c\x2e\x70\x1c\x49\x5b\x5d\xb2\x9b\xc8\xdd\xda\x56\xc9\x23\x63\xfc\xdd\x97\xaa\x6e\x59\xf2\xd8\xc9\x66\x61\xf3\x90\x51\x77\x55\xff\xba\xfe\xfe\xaa\x7d\x38\x14\xb7\xe9\x83\x6b\xf6\xde\xac\x37\x04\xaf\x5f\xfd\xfd\x1f\x2f\x1b\x8f\x2d\x5a\x82\xf7\xaa\xc4\x95\x73\xdf\xe1\x83\x2d\x73\x78\x53\xd7\x20\x4a\x2d\xb0\xdc\xef\x50\xe7\xe9\x72\x63\x5a\x68\x5d\xe7\x4b\x84\xd2\x69\x04\xd3\x42\x6d\x4a\xb4\x2d\x6a\xe8\xac\x46\x0f\xb4\x41\x78\xd3\xa8\x72\x83\xf0\x3a\x7f\x35\x48\xa1\x72\x9d\xd5\xa9\xb1\x22\xff\xf8\xe1\xe1\xdd\xe3\xa7\x77\x50\x99\x1a\x21\xee\x79\xe7\x08\xb4\xf1\x58\x92\xf3\x7b\x70\x15\xd0\xe4\x32\xf2\x88\x79\x7a\x5b\x1c\x8f\x69\x7a\x38\x80\xc6\xca\x58\x84\x19\xf5\x33\x88\x5b\x84\xdb\xa6\x56\x84\x30\xdb\xa0\xd2\xe8\x67\x70\x23\x22\xb3\x6d\x9c\x27\x98\xa7\xc9\xac\x74\x96\xb0\xa7\x59\x9a\xcc\xda\xbd\x2d\x67\x69\x9a\xcc\xd6\x86\x36\xdd\x2a\x2f\xdd\xb6\xa8\xa2\xff\xc6\x96\xdd\x4a\x91\xf3\x05\x5a\x2a\xb4\x51\x35\x96\x34\x4b\xb3\x34\x2d\x0a\x58\xf6\xec\xb3\x02\xf2\xca\xb6\xaa\x24\xe3\xac\xaa\xa1\xac\x0d\x47\x90\x36\x8a\x58\x5c\x7a\x54\x84\x1a\x56\x7b\x28\x55\x5d\x1b\xbb\x86\x07\xd1\xc8\x97\xfd\x3c\xcb\x53\xda\x37\xc8\x48\x2d\xf9\xae\x24\x38\xa4\x49\xe9\x6c\x65\xd6\x69\x72\x38\x80\x57\x76\x8d\x70\xf3\x75\x01\x37\x16\xee\xee\xe1\x26\x7f\x74\x1a\x5b\x78\x79\x3c\xa6\x49\x52\x14\x70\x38\xc0\x8d\xcd\x1f\xd5\x16\xe1\x78\xe4\xeb\x38\x7c\xd1\x82\xca\x79\x30\x96\xd0\xb3\x69\x76\x0d\x4f\x86\x36\x22\x3f\x3f\xb4\xea\x4c\xad\xd1\xb7\x79\x9a\x24\xe7\x92\xdb\xb3\x65\xb0\x5a\xcc\x42\xab\x25\x9e\x6c\x41\xe9\xb6\x4d\x8d\xec\xbb\xf8\xb7\x52\xe5\x77\x86\xda\x76\x30\xfc\xe3\xf8\xe6\xff\xec\x08\xfb\x34\x71\xf6\xc1\x6d\xb7\x86\x00\xe0\x7f\xff\xaf\x3a\x5b\xce\xd1\x7b\xe7\x33\x96\xfc\xc7\x85\xe3\xcf\x24\x92\xd2\x97\x43\x28\x58\xc2\x91\xa8\x4d\x4b\x30\x0b\x60\x33\x98\x0d\x67\xa5\x04\x12\xd6\xbf\x71\xf6\x7d\x67\xcb\x96\x95\x1b\x6f\x2c\xc1\xcc\xd9\x59\x04\x60\xa5\x18\xbd\xb8\xe6\xef\xda\x3d\xa1\x3f\xed\x84\x58\x4e\x72\x9b\xa7\x89\x88\xe6\xd4\xc3\xed\xb2\xcf\xa6\xc7\xe7\x19\x88\xb9\x9c\xbf\x04\xbd\xe7\x5b\xa9\xcf\x43\x2a\x73\xed\xcd\x0e\x7d\x3e\xbf\xa5\xfe\xad\x7c\x66\x39\xf5\xf9\xd9\xf1\x34\x49\xa8\xcf\xb7\x5d\xfe\xd1\x95\xdf\x65\xa9\xb1\xe2\x16\x92\xcd\xcf\xb6\x1e\xb6\x39\xab\x5f\x17\x50\xf1\x0d\x21\x26\x11\x6a\xf0\x97\x7d\x49\x93\x24\xa9\x38\x80\x7c\x82\x4b\xc5\x23\x75\xde\xb2\x8d\x69\x12\x13\xf7\x2f\x3b\x75\x5f\x69\xcd\xa5\xcc\x4b\xc9\x25\x39\x49\x27\x38\x7b\x19\x99\x8b\x40\x9c\x41\xcd\x2b\x98\xa4\x2f\x13\x63\x7e\xcd\xb5\x4b\x47\xee\x41\x35\x0d\x5a\x3d\xbf\x10\x2d\xa0\xca\xd8\x15\x4e\xf5\x50\x8e\x45\x11\x5b\x0b\x82\xbb\xec\xd0\xc3\xa4\x1b\x57\xc6\xea\x56\x3c\xeb\xbc\x97\xdd\x69\x72\xcf\x5d\x0a\xe7\xe6\x19\xdc\x46\x04\x6e\xcc\xf0\x75\x77\x0f\x2f\xc2\xe6\x21\xe4\xf7\x6e\x4c\xf5\x71\xd0\xca\x8d\x35\xc4\x5e\xc5\xc8\x87\x5d\x2e\xe6\xf3\x7b\x82\x1a\xa3\xff\x41\xbb\x73\x27\x0d\x11\x1a\x5b\xf4\x1e\x1e\xf1\xe9\x4a\x9b\xce\x4f\x16\x65\xa7\x8e\x65\x14\x69\xa6\xe2\x16\x2a\xe3\x5b\x02\xcb\xb4\xcd\x05\xa5\x5d\x09\xd8\x2b\xee\x64\x10\x62\x95\x0e\x0a\x4a\x77\xf7\x60\xac\xc6\xfe\x64\xcd\xab\x21\xd8\x43\x35\xc3\x93\x57\x4d\x68\x97\xb5\xd9\xa1\x85\xc8\x93\xf9\xb2\x0f\xa4\xa3\xc0\xba\xe6\xb4\x1b\x0f\x19\xbe\x6d\x8b\x96\x54\x88\x3f\x13\xea\x06\xc1\x68\x54\x42\x64\x0e\xda\xae\x11\xbe\x9e\xa4\xa9\x15\x40\xd7\x11\x17\x2c\x93\x9a\xb2\x7b\xc0\x9e\xbc\x0a\x33\x88\x9c\x98\x31\x72\x5a\x51\xc0\x7f\x37\x68\x41\x0d\x7b\x52\xd6\x02\x1f\xbb\x92\x69\x78\x01\x86\x60\x8d\x14\x9c\x68\x39\x92\x13\x1f\x8c\x6d\x49\xd9\x12\x05\x2d\xf2\x97\xb2\x1a\x4e\x84\xa5\x3c\x8a\x87\x1c\x4a\x06\x10\xd6\xe5\x59\x30\xd8\x21\xea\x2c\xe9\x5a\xf4\xb0\xed\x5a\x1a\xba\x0b\x19\x53\x06\x1c\x6e\x79\xfc\x39\x2f\x83\xd3\x31\xaf\xf2\x3d\xce\x83\x1f\xae\xb9\xe0\xa3\xa2\xe0\xd3\x1f\x2a\x50\x50\xd6\x8e\xe7\xee\x44\xcc\x41\xc4\xed\x0a\xb5\x46\x2d\xc8\x16\xe3\x45\xb0\x46\x8b\x5e\xa6\x12\x5a\x32\x64\xb0\x5d\x9c\x2c\x94\x9d\x3d\xe3\xaa\xa6\xa9\x0d\x72\x13\xfd\xd6\xa1\xdf\x2f\xc4\xbd\x58\x25\x77\x81\xfc\xb8\x40\x86\xc2\xcb\xff\xcd\x5a\x5f\xbe\x7c\xe1\x70\x32\x92\x9c\x82\x27\x53\xd7\xb0\x42\xc0\x1e\xcb\x8e\x50\x4b\xe1\x6c\xbc\xeb\xd6\x61\x18\xe9\x58\x42\x1b\x53\x6e\x4e\xc3\x52\xc6\xfd\x15\x57\x1f\x1d\x61\xe8\xe5\x53\xed\x99\x16\xac\x23\x58\x3b\xef\x3a\xe2\x87\x40\xab\x2a\x8c\x63\xf5\xa4\x34\x0e\x57\xb9\x7d\xbc\x15\xa1\x25\xe5\xc3\x95\x67\xc1\x85\xca\xbb\x6d\x9e\x26\xda\xef\x9e\x15\x6e\xc0\xe8\x87\x61\x2b\x2f\x9d\x7a\xcf\xb5\x78\x3e\x2b\xa8\x9f\xd4\x50\x1a\x3a\xc6\xe2\xd3\xb2\x8f\x5e\x72\x60\x2d\x3e\x3d\x7b\x3d\xc4\xa2\x0c\x2c\x21\xea\xf3\x92\x7a\x88\xcf\x95\xfc\x21\xfc\x5d\xc0\xa5\x5d\x19\x8c\xf3\x65\x11\xa6\x91\xf0\x0a\xf5\xb2\xe2\x3e\xd6\x7e\x97\x07\xc0\x2c\x4d\x4c\x25\xdb\x7f\xbb\x07\x6b\x6a\x61\xe9\x48\x55\xd6\xd4\x8b\x61\x52\x0c\x7b\x2f\x06\xe4\x03\xf5\x4c\x77\x62\xc0\x1d\xff\x77\x5c\xf0\x81\xe8\xdf\xb2\x3f\x51\xef\xf3\x78\x32\x47\x34\xe8\x99\xf9\x06\x7b\xc9\x81\xda\x39\xa3\x87\x9e\x72\x7e\x6c\x29\xe9\x52\x86\xe4\x3c\x5c\x6f\xaa\x1c\x3e\x6d\x5c\x57\x6b\xae\x2e\x56\x47\x0d\xce\xd6\x7b\x7e\x69\x5d\xd7\x9f\x50\xef\x68\x04\xc7\xe3\x3c\xb8\x19\xcc\xc7\xc4\x8d\x91\x8c\x9e\x89\xf3\x1c\xb1\xe0\xf1\xdb\xa0\x79\xe6\x76\x3c\x3d\x74\xdb\xaf\xd6\xda\x35\xeb\x22\xfc\x3c\xe3\x12\xe6\x1a\x9b\x98\x91\x73\x3a\x47\x85\x61\x00\xba\x16\xc3\xb3\x94\x19\x49\x68\x61\x80\x9e\xe0\x8a\xda\xf8\x68\x81\x31\xf5\x03\x4e\x48\xc9\x08\x14\xd6\x3f\x64\x38\xe1\xc6\xcf\xe7\xec\xf6\x6d\xd9\xe7\x01\xe7\xdb\x35\x6a\xbb\xa0\xb3\x4b\x2b\x45\xf1\x67\x66\x9e\xea\xe5\x64\xe8\x89\x2d\xff\xb4\xa9\x03\xd6\xb9\xb1\x3f\x66\xdf\x0b\x73\x07\x80\x9f\x19\xfc\xae\xc7\x72\x18\x41\x7d\xce\xab\xeb\x89\x67\xc9\xf5\xce\x0f\xb4\x1a\xca\x61\x01\xca\xaf\xdb\x05\xec\x82\x97\xfc\xab\xe5\x70\x9c\x3c\x45\xc7\x5a\x89\x97\x31\xe4\x62\xe0\xf3\x78\x36\x8b\xcd\x2b\xfc\x3d\xda\x26\xcb\xeb\xc6\x89\xe8\x2f\xb6\xee\x84\x79\xd5\xbc\x9d\xf2\xf0\xf5\xf9\x0b\xe2\x7e\x1a\xfd\xb9\x35\x75\x26\xbf\xfe\xe2\x73\xf0\xf7\x00\x00\x00\xff\xff\x2f\xa8\x3f\x7e\xdf\x0e\x00\x00") +var _templateTxTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x57\xdf\x6f\xdb\xbe\x11\x7f\x96\xfe\x8a\x9b\x11\x14\x52\xe0\x4a\x5d\xdf\x16\x20\x0f\x45\xda\x02\x05\xba\x14\x5b\x5d\xac\xc0\x30\xb4\xb4\x78\xb2\x89\xca\xa4\x46\x51\x8e\x3c\xc3\xff\xfb\x70\x47\x52\x92\x63\xb7\xeb\x80\x6f\x1e\xda\x88\xf7\x83\xf7\xe3\x73\x9f\x63\x8e\xc7\xf2\x36\x7d\x30\xed\xc1\xaa\xcd\xd6\xc1\xeb\x57\x7f\xfe\xcb\xcb\xd6\x62\x87\xda\xc1\x7b\x51\xe1\xda\x98\x1f\xf0\x41\x57\x05\xbc\x69\x1a\x60\xa5\x0e\x48\x6e\xf7\x28\x8b\x74\xb5\x55\x1d\x74\xa6\xb7\x15\x42\x65\x24\x82\xea\xa0\x51\x15\xea\x0e\x25\xf4\x5a\xa2\x05\xb7\x45\x78\xd3\x8a\x6a\x8b\xf0\xba\x78\x15\xa5\x50\x9b\x5e\xcb\x54\x69\x96\x7f\xfc\xf0\xf0\xee\xf1\xf3\x3b\xa8\x55\x83\x10\xce\xac\x31\x0e\xa4\xb2\x58\x39\x63\x0f\x60\x6a\x70\xb3\xcb\x9c\x45\x2c\xd2\xdb\xf2\x74\x4a\xd3\xe3\x11\x24\xd6\x4a\x23\x2c\xdc\xb0\x80\x70\xe4\x70\xd7\x36\xc2\x21\x2c\xb6\x28\x24\xda\x05\xdc\xb0\x48\xed\x5a\x63\x1d\x64\x69\xb2\xa8\x8c\x76\x38\xb8\x45\x9a\x2c\xba\x83\xae\x16\x69\x9a\x2c\x36\xca\x6d\xfb\x75\x51\x99\x5d\x59\x87\xfc\x95\xae\xfa\xb5\x70\xc6\x96\xa8\x5d\x29\x95\x68\xb0\x72\x8b\x34\x4f\xd3\xb2\x84\xd5\x40\x39\x0b\x70\x56\xe8\x4e\x54\x4e\x19\x2d\x1a\xa8\x1a\x45\x15\x74\x5b\xe1\x48\x5c\x59\x14\x0e\x25\xac\x0f\x50\x89\xa6\x51\x7a\x03\x0f\xac\x51\xac\x86\x2c\x2f\x52\x77\x68\x91\x3c\x75\xce\xf6\x95\x83\x63\x9a\x54\x46\xd7\x6a\x93\x26\xc7\x23\x58\xa1\x37\x08\x37\xdf\x96\x70\xa3\xe1\xee\x1e\x6e\x8a\x47\x23\xb1\x83\x97\xa7\x53\x9a\x24\x65\x09\xc7\x23\xdc\xe8\xe2\x51\xec\x10\x4e\x27\xba\x8e\xca\x17\x22\xa8\x8d\x05\xa5\x1d\x5a\x0a\x4d\x6f\xe0\x49\xb9\x2d\xcb\xcf\x8d\xd6\xbd\x6a\x24\xda\xae\x48\x93\xe4\x5c\x72\x7b\xf6\xe9\xa3\xe6\xb0\x50\x4b\xae\x27\x45\xd0\x88\xff\xa8\xe6\x00\x8d\x11\x92\x50\x91\x84\xcb\xe9\xe7\x36\x9a\xf8\xb3\x4f\xba\x42\xa0\x62\x17\xf4\x9b\xb7\xae\xcc\xae\x6d\x90\x2a\xc7\xd5\x59\x8b\xea\x07\x05\xb2\xeb\x21\xfe\xb0\xc1\x5f\x7b\x87\x43\x9a\x18\xfd\x60\x76\x3b\x45\xde\xff\xf9\xaf\xba\xd7\x55\x86\xd6\x1a\x9b\x93\xe4\xef\xc6\x9b\x3f\x93\x30\x20\x5e\xc6\x42\x92\x84\xea\xd8\xa8\xce\xc1\xc2\x3b\x5b\xc0\x22\xda\x32\x80\x12\xd2\xbf\x31\xfa\x7d\xaf\xab\x8e\x94\x5b\xab\xb4\x83\x85\xd1\x8b\xe0\x80\x94\x42\xed\xc3\x37\xfd\xde\x98\x27\xb4\xe3\x89\xef\xc4\x0c\x19\x45\x9a\xb0\x28\x73\x03\xdc\xae\x86\x7c\x6e\x9e\xe5\xc0\xe1\x52\xf7\x13\xb4\x96\x6e\x75\x43\xe1\x81\x50\x48\xab\xf6\x68\x8b\xec\xd6\x0d\x6f\xf9\xd7\xbc\x70\x43\x71\x66\x9e\x26\x89\x1b\x8a\x5d\x5f\x7c\x34\xd5\x0f\xfe\x94\x58\xd3\x00\xf2\xe1\x17\xdd\xc4\x63\xc2\xc4\xb7\x25\xd4\x74\x83\xaf\x49\x70\x15\xf3\xa5\x5c\xd2\x24\x49\x6a\x2a\x20\x59\x10\xd0\x2c\xba\xde\x6a\x8a\x31\x4d\x42\xdb\x3f\xe9\x79\xfa\x42\x4a\x1a\x04\xfa\xe4\x5e\x3a\xc3\xed\x04\xa3\x2f\x2b\x73\x51\x88\x33\x57\x59\x0d\xb3\xf6\xe5\x1c\xcc\xef\xa5\x76\x99\xc8\x3d\x88\xb6\x45\x2d\xb3\x0b\xd1\x12\xea\x9c\x52\xa1\x56\x47\x30\x97\x65\x18\x4c\xf0\xe9\x52\x42\x0f\xb3\x59\x5e\x2b\x2d\x3b\xce\xac\xb7\x96\x4f\xe7\xcd\x3d\x4f\xc9\xdb\x65\x79\x1c\x01\x4a\x83\x1a\x3a\xce\x41\xf1\xd6\x64\x9c\xe7\x98\x61\x98\x9b\x7b\x78\xe1\x4d\x8e\xbe\xfb\x77\x13\x10\x4e\x73\xc5\x42\x69\xe5\x28\xef\x53\x9e\xc6\xfe\x8c\x42\x42\xfd\x79\x40\x5e\x9b\xee\xfa\x1f\xac\x42\x23\x17\x4b\x39\x31\xc1\x3d\x3c\xe2\xd3\x15\x36\xc8\xc6\xe0\xf2\x91\x18\xc8\x0b\x4f\x5d\x79\x0b\xb5\xb2\x9d\x03\x4d\xdb\x81\x90\x27\x4d\x05\x38\x08\x1a\x79\x60\xfe\xe6\x51\xf3\x4a\x77\xf7\xa0\xb4\xc4\x61\x8c\xe6\x55\xec\x4a\x84\x3d\x3c\x59\xd1\xfa\xb9\xda\xa8\x3d\x6a\x08\x74\x5c\xac\x06\xcf\x6d\x02\xb4\x69\xc7\xd3\x60\xa4\xe8\xb6\x1d\x6a\x27\x7c\xa3\x88\xb7\xb7\x08\x4a\xa2\x60\xbe\x34\xd0\xf5\x2d\xaf\x85\x59\x3f\x3b\x76\x68\x7a\x47\xc8\x26\xee\x14\xfa\x00\x38\x38\x2b\xfc\xaa\x73\x86\xc3\x98\xa8\xb3\x2c\xe1\x1f\x5b\xd4\x20\xe2\x19\xe3\x9f\xdd\x87\xf1\x25\xb6\x5f\x82\x72\xb0\x41\xe7\x93\xe8\xa8\x92\xb3\x1c\x94\xee\x9c\x20\x6c\x30\x14\x3d\xd1\x09\x2d\x61\x64\x36\x61\x91\x33\xa4\x52\x92\x03\x26\x77\x5a\x39\x31\x0e\x56\x27\x49\xdf\xa1\x85\x5d\xdf\xb9\x38\x86\x48\x3e\x79\x8f\xe2\x8e\xb6\xac\xb1\xbc\x9f\x0d\x11\x30\xdd\x63\x2c\xd8\x78\xcd\x05\x71\x95\x25\x59\x7f\xa8\x41\x40\xd5\x18\x5a\xef\x33\x31\x15\x11\x77\x6b\x94\x12\x25\x7b\xd6\x18\x2e\x82\x0d\x6a\xb4\xbc\xfc\x50\x3b\xe5\x14\x76\xcb\x31\x42\x3e\x39\x90\x5f\xd1\xb6\x8d\x42\x9a\xb6\x7f\xf7\x68\x0f\x4b\x4e\x2f\xa0\xe4\xce\xb3\x24\x01\x24\x02\xaf\xf8\x1b\x69\x7d\xfd\xfa\x95\xca\x49\x9e\xd8\x0a\x9e\x54\xd3\xc0\x1a\x01\x07\xac\x7a\x87\x92\x81\xb3\xb5\xa6\xdf\xf8\x9d\x27\x03\x84\xb6\xaa\xda\x8e\x3b\x99\x5f\x15\x57\x52\x7d\x34\x0e\xfd\xd0\x8f\xd8\x53\x1d\x68\xe3\x60\x63\xac\xe9\x1d\xbd\x37\x3a\x51\x63\xd8\xde\xa3\xd2\xb4\xc3\xf9\xf6\xe9\x56\x84\xce\x09\xeb\xaf\x3c\x2b\x2e\xd4\xd6\xec\x8a\x34\x91\x76\xff\x0c\xb8\xde\xc7\x10\x77\x3a\x3f\xa8\x9a\x03\x61\xf1\x7c\xa9\xb8\x61\x86\xa1\xd4\x4f\x8c\xc6\xa7\xd5\x10\xb2\xa4\xc2\x6a\x7c\x7a\xf6\x48\x09\xa0\xf4\x2c\xc1\xea\x59\xe5\x06\x08\xaf\xa2\xe2\xc1\xff\xbf\x84\xcb\xb8\x72\x98\x16\xd1\xd2\xaf\xad\xdc\xd3\x1b\x7f\xd1\x1c\x4b\xbb\x2f\xbc\xc3\x3c\x4d\x54\xcd\xc7\x7f\xba\x07\xad\x1a\x26\xbb\xc0\x56\x5a\x35\xcb\xb8\x52\xe2\xd9\x8b\xe8\xf9\xe8\x06\x62\x3e\x0e\xe0\x8e\xfe\x39\x2d\xc9\x20\xe4\xb7\x1a\x46\x8e\x7e\x5e\x4f\xe2\x88\x16\x2d\x31\x5f\x8c\xd7\x19\x10\x7b\xa3\x64\x9c\x29\x63\xa7\x91\xe2\x29\x25\x97\xd4\x87\xeb\x43\x55\xc0\xe7\xad\xe9\x1b\x49\xe8\x22\x75\x94\x60\x74\x73\xa0\x07\xdd\x75\xfd\x19\xf5\x4e\x41\x50\x3d\xce\x8b\x9b\x43\x36\x35\x6e\xaa\x24\x8c\x64\xce\x19\x83\xcf\xf8\xad\xd7\x3c\x4b\x3b\x58\xc7\x69\xfb\x5d\xac\x5d\x8b\x2e\xb8\xcf\x72\x82\x30\x61\x6c\x16\x46\x41\xed\x9c\x14\xe2\xa6\x34\x1d\xfa\xd7\x2f\x31\x12\xd3\x42\x74\x3d\xf3\xcb\x6a\xd3\xeb\x06\xa6\xd6\x47\x3f\xbe\x25\x93\x23\xff\xfd\x53\x86\x63\x6e\xfc\x72\xce\x6e\xdf\x57\x43\xe1\xfd\x7c\xbf\x46\x6d\x17\x74\x76\x19\x25\x2b\xfe\x2a\xcc\x11\x2f\x63\xa0\x23\x5b\xfe\xdf\xa1\x46\x5f\xe7\xc1\xfe\x9c\x7d\x2f\xc2\x8d\x0e\x7e\x15\xf0\xbb\x01\xab\xb8\x82\x86\x82\xbe\xae\x37\x9e\x24\xd7\x27\xdf\xd3\xaa\x87\xc3\x12\x84\xdd\x74\x4b\xd8\xfb\x2c\xe9\x8f\xa3\xe3\x69\xf6\x66\x9d\xb0\x12\x2e\x23\x97\xcb\xc8\xe7\xc1\x36\x0f\xc3\xcb\xfc\x3d\xc5\xc6\x9f\xd7\x83\x63\xd1\x1f\x1c\xdd\xe8\xf3\x6a\x78\x7b\x61\xe1\xdb\xf3\x17\xc4\xfd\xbc\xfa\x99\x56\x4d\xce\x7f\x64\x86\x77\xe3\x7f\x03\x00\x00\xff\xff\x9d\x65\x7e\xf5\x46\x0f\x00\x00") func templateTxTmplBytes() ([]byte, error) { return bindataRead( @@ -1059,7 +1059,7 @@ func templateTxTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/tx.tmpl", size: 3807, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/tx.tmpl", size: 3910, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/tx.tmpl b/entc/gen/template/tx.tmpl index 763ff5638..24dd6ed66 100644 --- a/entc/gen/template/tx.tmpl +++ b/entc/gen/template/tx.tmpl @@ -23,6 +23,10 @@ type Tx struct { {{ $n.Name }} *{{ $n.Name }}Client {{ end }} + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -52,9 +56,11 @@ type Tx struct { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/config/ent/tx.go b/entc/integration/config/ent/tx.go index 5271bf78d..3bbb717c4 100644 --- a/entc/integration/config/ent/tx.go +++ b/entc/integration/config/ent/tx.go @@ -19,6 +19,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -63,9 +67,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/customid/ent/tx.go b/entc/integration/customid/ent/tx.go index 4d68e384d..d0dc3c938 100644 --- a/entc/integration/customid/ent/tx.go +++ b/entc/integration/customid/ent/tx.go @@ -27,6 +27,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -71,9 +75,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/ent/tx.go b/entc/integration/ent/tx.go index a05d68bdf..0c9dd6957 100644 --- a/entc/integration/ent/tx.go +++ b/entc/integration/ent/tx.go @@ -41,6 +41,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -85,9 +89,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/gremlin/ent/tx.go b/entc/integration/gremlin/ent/tx.go index a05d68bdf..0c9dd6957 100644 --- a/entc/integration/gremlin/ent/tx.go +++ b/entc/integration/gremlin/ent/tx.go @@ -41,6 +41,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -85,9 +89,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/hooks/ent/tx.go b/entc/integration/hooks/ent/tx.go index 990470f46..c0648f65d 100644 --- a/entc/integration/hooks/ent/tx.go +++ b/entc/integration/hooks/ent/tx.go @@ -21,6 +21,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -65,9 +69,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/idtype/ent/tx.go b/entc/integration/idtype/ent/tx.go index 5271bf78d..3bbb717c4 100644 --- a/entc/integration/idtype/ent/tx.go +++ b/entc/integration/idtype/ent/tx.go @@ -19,6 +19,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -63,9 +67,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/json/ent/tx.go b/entc/integration/json/ent/tx.go index 5271bf78d..3bbb717c4 100644 --- a/entc/integration/json/ent/tx.go +++ b/entc/integration/json/ent/tx.go @@ -19,6 +19,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -63,9 +67,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/migrate/entv1/tx.go b/entc/integration/migrate/entv1/tx.go index 755abced7..380572a1f 100644 --- a/entc/integration/migrate/entv1/tx.go +++ b/entc/integration/migrate/entv1/tx.go @@ -21,6 +21,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -65,9 +69,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/migrate/entv2/tx.go b/entc/integration/migrate/entv2/tx.go index 69e97e711..f6cae0513 100644 --- a/entc/integration/migrate/entv2/tx.go +++ b/entc/integration/migrate/entv2/tx.go @@ -25,6 +25,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -69,9 +73,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/privacy/ent/tx.go b/entc/integration/privacy/ent/tx.go index 31f85e2ac..2b5fc7a69 100644 --- a/entc/integration/privacy/ent/tx.go +++ b/entc/integration/privacy/ent/tx.go @@ -21,6 +21,10 @@ type Tx struct { // Planet is the client for interacting with the Planet builders. Planet *PlanetClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -65,9 +69,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/entc/integration/template/ent/tx.go b/entc/integration/template/ent/tx.go index 4b6b65f12..03a9964d3 100644 --- a/entc/integration/template/ent/tx.go +++ b/entc/integration/template/ent/tx.go @@ -23,6 +23,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -67,9 +71,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/edgeindex/ent/tx.go b/examples/edgeindex/ent/tx.go index c7cc2234e..b701ce8ac 100644 --- a/examples/edgeindex/ent/tx.go +++ b/examples/edgeindex/ent/tx.go @@ -21,6 +21,10 @@ type Tx struct { // Street is the client for interacting with the Street builders. Street *StreetClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -65,9 +69,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/entcpkg/ent/tx.go b/examples/entcpkg/ent/tx.go index 5271bf78d..3bbb717c4 100644 --- a/examples/entcpkg/ent/tx.go +++ b/examples/entcpkg/ent/tx.go @@ -19,6 +19,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -63,9 +67,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/m2m2types/ent/tx.go b/examples/m2m2types/ent/tx.go index dbaca2990..47c419f0b 100644 --- a/examples/m2m2types/ent/tx.go +++ b/examples/m2m2types/ent/tx.go @@ -21,6 +21,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -65,9 +69,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/m2mbidi/ent/tx.go b/examples/m2mbidi/ent/tx.go index 5271bf78d..3bbb717c4 100644 --- a/examples/m2mbidi/ent/tx.go +++ b/examples/m2mbidi/ent/tx.go @@ -19,6 +19,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -63,9 +67,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/m2mrecur/ent/tx.go b/examples/m2mrecur/ent/tx.go index 5271bf78d..3bbb717c4 100644 --- a/examples/m2mrecur/ent/tx.go +++ b/examples/m2mrecur/ent/tx.go @@ -19,6 +19,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -63,9 +67,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/o2m2types/ent/tx.go b/examples/o2m2types/ent/tx.go index f20b01880..80bf661ce 100644 --- a/examples/o2m2types/ent/tx.go +++ b/examples/o2m2types/ent/tx.go @@ -21,6 +21,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -65,9 +69,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/o2mrecur/ent/tx.go b/examples/o2mrecur/ent/tx.go index b7db6a3ea..982edf8a5 100644 --- a/examples/o2mrecur/ent/tx.go +++ b/examples/o2mrecur/ent/tx.go @@ -19,6 +19,10 @@ type Tx struct { // Node is the client for interacting with the Node builders. Node *NodeClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -63,9 +67,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/o2o2types/ent/tx.go b/examples/o2o2types/ent/tx.go index 990470f46..c0648f65d 100644 --- a/examples/o2o2types/ent/tx.go +++ b/examples/o2o2types/ent/tx.go @@ -21,6 +21,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -65,9 +69,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/o2obidi/ent/tx.go b/examples/o2obidi/ent/tx.go index 5271bf78d..3bbb717c4 100644 --- a/examples/o2obidi/ent/tx.go +++ b/examples/o2obidi/ent/tx.go @@ -19,6 +19,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -63,9 +67,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/o2orecur/ent/tx.go b/examples/o2orecur/ent/tx.go index b7db6a3ea..982edf8a5 100644 --- a/examples/o2orecur/ent/tx.go +++ b/examples/o2orecur/ent/tx.go @@ -19,6 +19,10 @@ type Tx struct { // Node is the client for interacting with the Node builders. Node *NodeClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -63,9 +67,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/start/ent/tx.go b/examples/start/ent/tx.go index 2b5b0b4c0..b9de0bdf1 100644 --- a/examples/start/ent/tx.go +++ b/examples/start/ent/tx.go @@ -23,6 +23,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -67,9 +71,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() { diff --git a/examples/traversal/ent/tx.go b/examples/traversal/ent/tx.go index 4b6b65f12..03a9964d3 100644 --- a/examples/traversal/ent/tx.go +++ b/examples/traversal/ent/tx.go @@ -23,6 +23,10 @@ type Tx struct { // User is the client for interacting with the User builders. User *UserClient + // lazily loaded. + client *Client + clientOnce sync.Once + // completion callbacks. mu sync.Mutex onCommit []func(error) @@ -67,9 +71,11 @@ func (tx *Tx) OnRollback(f func(error)) { // Client returns a Client that binds to current transaction. func (tx *Tx) Client() *Client { - client := &Client{config: tx.config} - client.init() - return client + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client } func (tx *Tx) init() {