diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index 41327d53c..4ea2981c5 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -126,7 +126,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _templateBaseTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\xdf\x6f\xdc\xbe\x0d\x7f\x3e\xff\x15\x84\x71\xfb\xce\xce\xf7\x62\xa7\x79\x5b\x81\x3c\xa4\x59\xb3\x05\x68\xd3\x0e\xe9\xd6\x87\xa2\x18\x14\x9b\xf6\x09\x91\x25\x47\x92\x93\x1c\x0c\xff\xef\x03\x25\xff\xba\xcb\x35\x49\x9b\xae\x0f\x85\x8f\x94\xc8\x0f\xc9\x0f\x69\x3a\x6d\x9b\x1e\x04\x67\xaa\xde\x68\x5e\xae\x2d\x1c\x1f\xbd\xf9\xdb\x61\xad\xd1\xa0\xb4\x70\xce\x32\xbc\x56\xea\x06\x2e\x64\x96\xc0\xa9\x10\xe0\x0e\x19\x20\xbd\xbe\xc3\x3c\x09\xbe\xac\xb9\x01\xa3\x1a\x9d\x21\x64\x2a\x47\xe0\x06\x04\xcf\x50\x1a\xcc\xa1\x91\x39\x6a\xb0\x6b\x84\xd3\x9a\x65\x6b\x84\xe3\xe4\x68\xd0\x42\xa1\x1a\x99\x07\x5c\x3a\xfd\x87\x8b\xb3\xf7\x97\x57\xef\xa1\xe0\x02\xa1\x97\x69\xa5\x2c\xe4\x5c\x63\x66\x95\xde\x80\x2a\xc0\xce\x9c\x59\x8d\x98\x04\x07\x69\xd7\x05\x41\xdb\x42\x8e\x05\x97\x08\xe1\x35\x33\x18\x42\x2f\x5c\xd6\x37\x25\xbc\x3d\x01\x12\xc2\x32\x39\x53\xb2\xe0\x65\xf2\x99\x65\x37\xac\x44\x3a\xd4\xb6\x60\xb1\xaa\x05\xb3\x08\xe1\x1a\x59\x8e\x3a\x84\xe5\x70\x7d\x52\xf1\xaa\x56\xda\x0e\xaa\x34\x05\xca\x0e\x13\x9c\x19\x34\x60\x15\xb0\x3b\xc5\x73\xf0\xa7\x20\x53\xb2\x10\x3c\xb3\x14\x47\x63\x50\xff\xd5\xb8\xcc\x24\x81\xdd\xd4\x08\x51\xb0\xf8\x54\xc3\xf0\xef\x84\x2c\x25\x9f\xea\x60\xf1\x4f\xca\xf3\x5c\x48\x82\x60\xf1\x1f\x26\x1a\x9c\x8b\x9d\x20\x58\xfc\xab\x41\xbd\x99\xcb\x9d\x20\x58\x7c\x56\x82\x67\x9b\x99\xdc\x0b\x82\xc5\xc7\xc6\x32\xab\xf4\xa4\xe8\x05\xbd\x86\x2b\xb9\xad\xe1\x4a\xf6\x2a\x3c\x6f\x64\x36\x57\x39\x41\x10\xbb\x44\x7c\xd2\x54\x62\x56\xd7\x82\xa3\x01\x26\x41\x91\x80\xcb\x12\x94\x04\xe4\x76\x8d\x1a\x4a\xcd\xea\x35\x58\xcd\xee\x50\x1b\x26\x40\x69\x30\xb7\x02\x0c\x0a\x57\xda\x3e\x31\xde\x52\xd1\xc8\x2c\xa2\xd2\x25\x57\x56\x69\x56\x62\xf2\xae\xe1\x82\x34\x5d\x17\xbb\xaa\x68\x26\x4b\x84\x65\xb1\x82\xa5\xf3\x45\x05\xf6\x0f\x5d\x17\x2c\xe8\x6a\x01\x27\x50\x33\x93\x31\x41\xcf\x24\x4d\x53\xf0\x8a\xae\x1b\xb1\x12\xc5\x4a\x7e\x87\x12\x0a\x8e\x22\x37\x54\xae\xb6\x85\xa6\xae\x51\xf7\x47\x9d\xd9\x24\x58\x10\xa8\xd1\x40\xd4\x1f\x4f\x92\xc4\x58\x8a\x34\xee\xa1\xb7\xc1\x62\xd1\xb6\x87\x70\xcf\xed\x1a\xf0\xc1\xa2\xcc\x21\xe2\x32\xc7\x07\x58\x26\x97\x2a\x47\x03\x47\x31\x84\x94\xbc\x90\x4c\x85\xee\x5a\x38\x84\x71\x48\x40\x17\x2e\x00\x5b\xd5\x82\xc2\xaa\x35\x97\xb6\x80\x30\xe7\x8c\x52\x95\xfe\xc5\xa4\xaa\xbf\x33\xa4\x07\xfc\x2d\x8d\xb6\xd1\x0e\xff\xc3\xc8\x5a\x6f\x26\xf1\x27\xda\x16\x08\x8f\x73\xe2\x78\x4f\xbf\x86\x36\x79\xc2\x5f\xa9\x55\x53\xa7\x86\x97\x92\xd9\x46\xe3\x8e\xe7\x34\x85\xd3\xb2\xd4\x58\x92\xbf\x19\x09\x58\x2f\x24\x56\x19\x8b\x35\x91\xc1\xe5\x9b\xac\x1d\x5e\x6f\x26\x32\xa4\x13\x0b\x7e\x04\xde\xf1\xec\xd4\xd0\x64\x61\x50\x1b\x6c\x72\xb5\xe5\x80\xaa\xe3\x1f\x94\x06\x8d\x92\x55\x44\x3f\x26\x95\x23\x9f\xff\x7f\x38\x63\x7c\x75\xb2\xc6\x58\x55\x81\x64\x15\x9a\x04\xce\x95\x06\x7c\x60\x55\x2d\xf0\x6d\x90\xa6\x41\x9a\x2e\xfe\x41\x40\xdf\x6d\x7c\xad\xdf\xac\x3c\x45\x8e\xe3\x84\x74\x63\xc4\xd1\x30\x62\xba\x2e\x39\x35\xf3\x5f\x57\x4d\xd5\x5f\x8d\x57\x10\x9a\xa6\xfa\xaf\xff\x15\xc6\x2b\x78\xc1\xad\xe3\xad\x5b\xc7\x61\xec\x1d\x5f\x65\x4c\x46\x99\x7d\x58\xc1\x1f\x77\x31\x01\x75\xbc\x3c\x35\x51\x21\xa7\x32\xac\x5c\x65\x07\x66\x4e\xd5\x69\x03\x47\x4e\x9f\xd7\x27\x4a\xcd\xcc\x2e\xbb\x9e\xe1\x56\x37\xef\x4a\xca\xe8\x0a\x96\x94\xe4\x73\xc2\x4e\xac\x62\x23\x86\xb1\x41\xa5\x63\x5b\xdf\xa2\x74\x67\x54\x3d\x4b\xc5\x4c\x49\x63\x77\x21\xb6\x2d\xf0\x02\xd6\xcc\x7c\xd9\x06\x38\x50\xff\x99\x96\xbc\x64\x15\x31\xdb\x01\x19\xfb\x53\xce\x3a\xf2\xe9\xa6\xea\x11\x0c\x1d\x35\x4e\x1b\xb9\x3b\x6e\xda\x16\x6e\x1b\x65\x71\x8c\x79\x3f\x8f\x95\x4b\x36\x2f\xe6\x79\xec\xba\x9d\x79\x45\xef\xc3\xd1\x29\xb2\x6c\xed\x9b\x6b\x6b\x5a\x11\x80\x68\x8f\x29\x6f\xc0\x73\x64\xb4\xb1\x43\x96\x9f\x19\x65\x12\xc2\xaf\x83\xf9\x70\xee\xea\x65\x33\xcd\x17\xb6\xf0\xc6\x7e\xdb\x60\x4b\x53\xb8\x54\xf6\x9c\xb6\x8c\xf7\x5a\xbb\xd1\x40\xa6\x0c\xdc\xaf\x51\x82\xd5\x1b\x9a\x12\x56\x41\x81\x36\x5b\x03\x03\x53\x63\xc6\x0b\x9e\xd1\x7b\x8e\xdb\x0d\x30\x99\x03\xb7\x70\xcf\x0c\x48\x65\xfd\xba\x32\xac\x26\x39\xb3\x8c\x96\x8a\xfe\xd5\xb5\xed\xc7\x58\xdd\x64\x96\x72\x28\xd8\x35\x8a\x3e\xcf\x81\x87\xe4\x8f\x70\x9a\x35\x15\x4a\xeb\x79\x81\x5e\x28\x2d\xea\x82\x65\x98\xf8\xc6\x8e\x10\x0e\xb6\x2c\xc7\xfe\x76\x14\xf7\x26\xc9\x45\x9f\x9f\x70\x1a\x23\x6f\x21\x84\x3f\x01\x13\xef\xfc\x4f\x08\x27\xf8\x61\x0f\xe2\xc2\x0c\x76\xc7\xa4\x30\xb8\x56\x4a\x20\x93\xc0\x65\xce\x33\x66\xc9\xfe\xfd\x1a\xdd\xf4\x9c\x61\xa4\x93\x53\x3a\x9c\xb0\x87\x3b\x19\x8d\x50\x6b\xaf\x8a\x9d\x55\xc2\xc9\x0b\x92\xc0\xc9\x09\x48\xee\x04\x03\xf2\x82\x09\x83\x54\xba\xc5\x1d\xd3\xb0\x1b\xf2\x18\xa0\x33\x67\x68\x60\xa2\xd6\x2b\xf8\x03\xe3\x3e\x96\x8f\xcc\xdc\x8c\xd1\x54\xcc\xdc\x50\xb9\xf4\x1e\x7c\xf3\x83\x73\x84\x3e\x30\x0f\x71\x3b\x86\x78\x8e\x53\x72\xe1\x50\x4e\x78\x82\x91\x64\x57\x5c\x96\x8d\x60\xfa\x65\x3c\xeb\x0f\xcf\x79\x56\x29\x8d\x94\x65\xea\x7d\x74\x94\x7b\x86\x6e\xdb\x1e\x7f\x33\xe3\xb6\x8c\xbf\x86\x74\x43\xa8\x5b\xbc\x1b\xac\xff\x32\xf5\xa6\x04\xee\xb2\x6f\x30\xfd\x6a\x02\x6e\x65\xe0\x79\x0e\x5e\x2a\xfb\x41\xb1\x1c\x9f\x1e\x34\x25\x5a\x17\x41\x4e\xa5\x66\xd3\x64\x11\xee\x2a\xd0\x56\xb4\x46\xb8\xa5\x3d\x7e\x2a\xf4\xdc\xee\x54\x66\xcc\x4b\x7c\x6d\x95\x67\x96\x7f\xae\xc6\xce\x39\x95\xd8\x3d\x6c\x47\xb1\x55\x69\xef\xe1\x97\xeb\xdc\xe7\xe5\x51\x95\xbd\xd9\x57\xd7\x78\x16\xff\xf3\x15\x3e\xa3\xad\x43\x33\x2e\xed\x93\x25\xce\x34\x32\x8b\x69\x53\xe7\xf4\x9e\xa2\x5e\x56\xda\x37\xb7\x6b\x76\xbf\x1d\xe7\x64\x70\xae\x73\x5f\xb6\xc8\x35\x64\xa3\x17\x03\x05\xe3\x02\xf3\xad\xe5\x74\x05\x77\x5c\x09\xbf\x2c\xa8\xc2\xa7\x5f\x69\xb2\xe6\x5f\xe8\x8d\xe4\xb7\x0d\x4a\x34\xa6\xe7\xcf\x2e\xea\x89\x40\x95\x29\x07\xfe\x2c\xee\x35\xab\x7d\xe4\xbf\xc4\xa5\x1d\x27\x2f\xe5\xd2\x14\x6b\x1f\xea\x40\xaf\xca\x0c\x9c\xfe\xb7\x74\xd0\xf6\x01\x31\xc9\x57\xcd\xdc\x97\xda\x3e\x76\x3f\x82\xe4\x2d\x45\xb3\x61\x3f\x14\x3c\x21\xc5\x48\xda\x1f\x95\xf9\x67\xa8\xbb\x13\x58\xa3\x71\x24\xef\x8e\xf9\xd7\x51\x78\xc7\xd8\x33\x1c\x6e\xdb\xf4\x00\xf0\xa1\x66\xc3\x5b\x11\x88\x21\x8e\x8e\x50\x0a\x75\xcd\x04\xac\x51\xd4\xa8\x4d\x02\xee\x8f\x2a\xe3\xce\xb6\x77\x65\xf3\x4e\x76\xd6\xb5\xa7\xb6\xf0\x3d\x0b\xdc\xb2\xbf\xf3\xe8\x4b\x74\xff\x92\xe8\x40\xfe\x1f\x5c\x72\xf7\x91\xf2\x68\xbb\x4d\x2e\xfe\x9e\x7c\xa1\x26\xf2\x9f\xb9\x37\xb8\x31\x23\x1d\xa8\xe2\x24\x48\x79\x6e\xa0\xd0\xaa\xf2\x1c\xa0\x7e\xac\x58\xdd\x97\x9b\x0e\x44\x15\x09\xbe\xf5\x6e\xba\xee\xbb\xef\xc0\xb6\x8b\xe1\xdb\xf7\x51\x4a\x65\x36\x04\xa2\x62\x37\x18\xcd\x14\x2b\x38\x5a\x81\x40\x19\x55\x71\x1c\x2c\xe8\xf3\xd6\x83\xf5\x1f\x5b\x95\xa3\x87\x81\x13\xfa\xc6\x40\x99\x47\x66\x05\x3c\x8f\xe7\x5b\x8a\x09\xe6\xe1\xfe\x2f\x00\x00\xff\xff\x0a\x40\xf0\xe3\xeb\x13\x00\x00") +var _templateBaseTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\x5f\x4f\xdc\x46\x10\x7f\x3e\x7f\x8a\x91\x75\x4d\x6d\x72\xd8\x84\xb7\x46\xe2\x81\xd0\xd0\x22\x25\x24\x15\x69\xf3\x10\x45\xd5\x62\x8f\x7d\x2b\xec\x5d\xb3\xbb\x06\x4e\x96\xbf\x7b\x35\xbb\xfe\x7b\x5c\x80\x84\x34\x0f\x91\x6f\x66\x77\xfe\xfd\x7e\x33\x1e\xd3\x34\xf1\x9e\x77\x22\xab\x8d\xe2\xf9\xda\xc0\xe1\xc1\xab\xdf\xf6\x2b\x85\x1a\x85\x81\x53\x96\xe0\xa5\x94\x57\x70\x26\x92\x08\x8e\x8b\x02\xec\x21\x0d\xa4\x57\x37\x98\x46\xde\xa7\x35\xd7\xa0\x65\xad\x12\x84\x44\xa6\x08\x5c\x43\xc1\x13\x14\x1a\x53\xa8\x45\x8a\x0a\xcc\x1a\xe1\xb8\x62\xc9\x1a\xe1\x30\x3a\xe8\xb5\x90\xc9\x5a\xa4\x1e\x17\x56\xff\xee\xec\xe4\xed\xf9\xc5\x5b\xc8\x78\x81\xd0\xc9\x94\x94\x06\x52\xae\x30\x31\x52\x6d\x40\x66\x60\x26\xce\x8c\x42\x8c\xbc\xbd\xb8\x6d\x3d\xaf\x69\x20\xc5\x8c\x0b\x04\xff\x92\x69\xf4\xa1\x13\x2e\xab\xab\x1c\x5e\x1f\x01\x09\x61\x19\x9d\x48\x91\xf1\x3c\xfa\xc8\x92\x2b\x96\x23\x1d\x6a\x1a\x30\x58\x56\x05\x33\x08\xfe\x1a\x59\x8a\xca\x87\x65\x7f\x7d\x54\xf1\xb2\x92\xca\xf4\xaa\x38\x06\xaa\x0e\x2b\x38\xd3\xa8\xc1\x48\x60\x37\x92\xa7\xe0\x4e\x41\x22\x45\x56\xf0\xc4\x50\x1e\xb5\x46\xf5\xab\xb6\x95\x89\x3c\xb3\xa9\x10\x02\x6f\xf1\xa1\x82\xfe\xdf\x11\x59\x8a\x3e\x54\xde\xe2\x4f\xaa\xf3\x54\x48\x02\x6f\xf1\x0f\x2b\x6a\x9c\x8a\xad\xc0\x5b\xfc\x55\xa3\xda\x4c\xe5\x56\xe0\x2d\x3e\xca\x82\x27\x9b\x89\xdc\x09\xbc\xc5\xfb\xda\x30\x23\xd5\xa8\xe8\x04\x9d\x86\x4b\x31\xd7\x70\x29\x3a\x15\x9e\xd6\x22\x99\xaa\xac\xc0\x0b\x6d\x21\x3e\xa8\x14\x95\x3d\xc0\xaa\xaa\xe0\xa8\x81\x09\x90\x24\xe4\x22\x07\x29\x00\xb9\x59\xa3\x82\x5c\xb1\x6a\x0d\x46\xb1\x1b\x54\x9a\x15\x20\x15\xe8\xeb\x02\x34\x16\x16\xde\xae\x38\xa3\xb5\xac\x16\x49\x40\x10\x46\x17\x46\x2a\x96\x63\xf4\xa6\xe6\x05\xd1\xa9\x6d\x43\x8b\x8e\x62\x22\x47\x58\x66\x2b\x58\x5a\x7f\x04\xb4\x7b\x68\x5b\x6f\x41\x57\x33\x38\x82\x8a\xe9\x84\x15\xf4\x4c\xd2\x38\x06\xa7\x68\xdb\x21\x5e\xa2\x5a\xce\x6f\x50\x40\xc6\xb1\x48\x35\xc1\xd6\x34\x50\x57\x15\xaa\xee\xa8\x35\x1b\x79\x0b\x0a\x6a\x30\x10\x74\xc7\xa3\x28\xd2\x86\xb2\x0d\x27\xe1\x37\xde\x62\xd1\x34\xfb\x70\xcb\xcd\x1a\xf0\xce\xa0\x48\x21\xe0\x22\xc5\x3b\x58\x46\xe7\x32\x45\x0d\x07\x21\xf8\x74\xd6\x27\x73\xbe\xbd\xea\xf7\xa9\xec\x53\xb0\x0b\x9b\x84\x29\xab\x82\x52\xab\x14\x17\x26\x03\x3f\xe5\x8c\x4a\x16\xff\xa2\x63\xd9\xdd\xe9\x4b\x04\xee\x96\x42\x53\x2b\x9b\xc3\xdd\xc0\x60\x67\x26\x72\x27\x9a\x06\x28\x1e\xeb\xc4\xf6\x00\xfd\xea\x5b\xe6\x01\x7f\xb9\x92\x75\x15\x6b\x9e\x0b\x66\x6a\x85\x5b\x9e\xe3\x18\x8e\xf3\x5c\x61\xde\x33\x66\x42\x08\xd6\x29\x88\x65\xda\x60\x45\xc4\xb0\x75\x27\x8b\xfb\x97\x9b\x91\x18\xf1\xc8\x88\x6f\x25\x60\x79\x77\xac\x69\xd2\x30\xa8\x34\xd6\xa9\x9c\x39\x20\x94\xdc\x83\x54\xa0\x50\xb0\x92\xa8\xc8\x84\xb4\x44\x74\xff\xf7\x67\xb4\x43\x28\xa9\xb5\x91\x25\x08\x56\xa2\x8e\xe0\x54\x2a\xc0\x3b\x56\x56\x05\xbe\xf6\xe2\xd8\x8b\xe3\xc5\x1f\x14\xe8\x9b\x8d\xc3\xfc\xd5\xca\x51\xe5\x30\x8c\x48\x37\x64\x1d\xf4\x23\xa7\x6d\xa3\x63\x3d\xfd\x75\x51\x97\xdd\xd5\x70\x05\xbe\xae\xcb\x7f\xdd\x2f\x3f\x5c\xc1\x13\x6e\x1d\xce\x6e\x1d\xfa\xa1\x73\x7c\x91\x30\x11\x24\xe6\x6e\x05\x2f\x6e\x42\x0a\xd4\xf2\xf3\x58\x07\x99\x98\x43\xb1\xb2\x08\xf7\x2c\x9d\xa3\xd4\x78\x96\xa8\xae\xbe\x0f\xc0\xce\xf4\x36\xd3\x1e\xe1\x59\x3b\xed\x52\xaa\xec\x0a\x96\x54\xec\x53\xca\x81\x18\xd6\x63\x86\x63\xc3\x0a\xcb\xbc\xae\x65\xe9\xce\xa0\x7a\x94\x96\x89\x14\xda\x6c\x87\xd8\x34\xc0\x33\x58\x33\xfd\x69\x1e\x60\xdf\x06\x8f\xb4\xe7\x39\x2b\x89\xe5\x36\x90\xa1\x57\xc5\xa4\x3b\x1f\x6e\xb0\x2e\x82\xbe\xbb\x86\xe9\x23\xb6\xc7\x4f\xd3\xc0\x75\x2d\x0d\x0e\x39\xef\xe6\xb3\xb4\xc5\xe6\xd9\xb4\x8e\x6d\xbb\x35\xbf\xe8\x3d\x39\x38\x45\x96\xac\x5d\x93\xcd\xa6\x17\x05\x10\xec\x30\xe5\x0c\x38\x9e\x0c\x36\x76\x10\xe6\x7b\x46\x9b\x00\xff\x73\xef\xc2\x9f\xba\x7b\xda\x8c\x73\xe0\x66\xce\xd8\x4f\x1b\x74\x71\x0c\xe7\xd2\x9c\xd2\x06\xf2\x56\x29\x3b\x26\xc8\x94\x86\xdb\x35\x0a\x30\x6a\x43\x13\xc3\x48\xc8\xd0\x24\x6b\x60\xa0\x2b\x4c\x78\xc6\x13\x7a\x07\x72\xb3\x01\x26\x52\xe0\x06\x6e\x99\x06\x21\x8d\x5b\x65\xfa\xb5\x25\x65\x86\xd1\xc2\xd1\xbd\xd2\xe6\x7e\xb4\x51\x75\x62\xa8\x86\x05\xbb\xc4\xa2\xab\xb5\xe7\x42\x72\x47\x38\xcd\x9d\x12\x85\x71\xdc\x40\x27\x14\x06\x55\xc6\x12\x8c\x5c\x93\x07\x08\x7b\x33\xcb\xa1\xbb\x1d\x84\x9d\x49\x72\xd1\xd5\xc7\x1f\x47\xca\x6b\xf0\xe1\x25\x60\xe4\x9c\xbf\x04\x7f\x0c\xdf\xef\x82\x38\xd3\xbd\xdd\xa1\x28\x0c\x2e\xa5\x2c\x90\x09\xe0\x22\xe5\x09\x33\x64\xff\x76\x8d\x76\x92\x4e\x62\xa4\x93\x63\x39\xac\xb0\x0b\x77\x34\x1a\xa0\x52\x4e\x15\x5a\xab\x14\x27\xcf\x48\x02\x47\x47\x20\xb8\x15\xf4\x91\x67\xac\xd0\x48\xd0\x2d\x6e\x98\x82\xed\x94\x87\x04\xad\x39\x4d\xc3\x13\x95\x5a\xc1\x0b\x0c\xbb\x5c\xde\x33\x7d\x35\x64\x53\x32\x7d\x45\x70\xa9\x1d\xf1\x4d\x0f\x4e\x23\x74\x89\xb9\x10\xe7\x39\x84\xd3\x38\x05\x2f\x6c\x94\x63\x3c\xde\x40\xb2\x0b\x2e\xf2\xba\x60\xea\x69\x3c\xeb\x0e\x4f\x79\x56\x4a\x85\x54\x65\xea\x7f\xb4\x94\x7b\x84\x6e\x73\x8f\x3f\x99\x71\x33\xe3\xcf\x21\x5d\x9f\xea\x8c\x77\xbd\xf5\x1f\xa6\xde\x58\xc0\x6d\xf6\xf5\xa6\x9f\x4d\xc0\x59\x05\x1e\xe7\xe0\xb9\x34\xef\x24\x4b\xf1\xe1\x41\x93\xa3\xb1\x19\xa4\x04\x35\x1b\x27\x4b\x61\xaf\x02\x6d\x48\x6b\x84\x6b\xda\xf1\x47\xa0\xa7\x76\x47\x98\x31\xcd\xf1\xb9\x28\x4f\x2c\x7f\x1f\xc6\xd6\x39\x41\x6c\x1f\xe6\x59\xcc\x90\x76\x1e\x7e\x18\xe7\xae\x2e\xf7\x50\x76\x66\x9f\x8d\xf1\x24\xff\xc7\x11\x3e\xa1\xcd\x43\x31\x2e\xcc\x83\x10\x27\x0a\x99\xc1\xb8\xae\x52\x7a\x4f\x51\x2f\x4b\xe5\x9a\xdb\x36\xbb\xdb\x94\x53\x32\x38\xd5\xd9\xaf\x5e\xe4\x0a\x92\xc1\x8b\x86\x8c\xf1\x02\xd3\xd9\xa2\xba\x82\x1b\x2e\x0b\xb7\x30\xc8\xcc\x95\x5f\x2a\xb2\xe6\x5e\xea\xb5\xe0\xd7\x35\x0a\xd4\xba\xe3\xcf\x76\xd4\x23\x81\x4a\x9d\xf7\xfc\x59\xdc\x2a\x56\xb9\xcc\x7f\x88\x4b\x5b\x4e\x9e\xca\xa5\x31\xd7\x2e\xd5\x9e\x5e\xa5\xee\x39\xfd\xb7\xb0\xa1\xed\x0a\x44\x47\x9f\x15\xb3\x5f\x6f\xbb\xd8\x7d\x2f\x24\x67\x29\x98\x0c\xfb\x1e\xf0\x88\x14\x03\x69\xbf\x05\xf3\xf7\x50\x77\x2b\xb1\x5a\xe1\x40\xde\x2d\xf3\xcf\xa3\xf0\x96\xb1\x47\x38\xdc\x34\xf1\x1e\xe0\x5d\xc5\xfa\xb7\x22\x10\x43\x2c\x1d\x21\x2f\xe4\x25\x2b\x60\x8d\x45\x85\x4a\x47\x60\xff\xe0\x32\xec\x6c\x3b\x57\x36\xe7\x64\x6b\x5d\x7b\x68\x13\xdf\xb1\xc0\x2d\xbb\x3b\xf7\xbe\x4c\x77\x2f\x89\x36\xc8\xff\xc1\x25\xb7\x1f\x2a\xf7\xb6\xdb\xe8\xec\xf7\xe8\x13\x35\x91\xfb\xec\xbd\xc2\x8d\x1e\xe8\x40\x88\x93\x20\xe6\xa9\x86\x4c\xc9\xd2\x71\x80\xfa\xb1\x64\x55\x07\x37\x1d\x08\x4a\x12\x7c\xe9\xdc\xb4\xed\x57\xd7\x81\x4d\x1b\xc2\x97\xaf\x83\x94\x60\xd6\x14\x44\xc9\xae\x30\x98\x28\x56\x70\xb0\x82\x02\x45\x50\x86\xa1\xb7\xa0\x4f\x5d\x17\xac\xfb\xe0\x2a\x2d\x3d\x34\x1c\xd1\x77\x06\x8a\x34\xd0\x2b\xe0\x69\x38\xdd\x52\xb4\x37\x4d\xf7\xbf\x00\x00\x00\xff\xff\xd0\x7f\x3c\x96\x07\x14\x00\x00") func templateBaseTmplBytes() ([]byte, error) { return bindataRead( @@ -141,7 +141,7 @@ func templateBaseTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/base.tmpl", size: 5099, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/base.tmpl", size: 5127, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -206,7 +206,7 @@ func templateBuilderMutationTmpl() (*asset, error) { return a, nil } -var _templateBuilderQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x5a\x5f\x6f\xdb\xb8\xb2\x7f\xb6\x3f\xc5\xac\x91\x0d\xec\xc0\x95\xdb\xbe\xdd\x5c\xe4\x02\xd9\xa6\xbd\xc7\xc0\xa2\xbb\xdb\xf6\x60\x17\x28\x8a\x5d\x46\x1a\xd9\xdc\xca\xa4\x96\xa4\x9c\x04\x39\xfe\xee\x07\x1c\x52\x12\xad\x3f\xb1\x9c\x04\x7b\x8a\xf3\x64\x4b\x22\x87\xe4\xcc\x6f\x7e\x33\xe4\xf0\xfe\x7e\x71\x36\x7e\x23\xf3\x3b\xc5\x57\x6b\x03\xaf\x5f\xbe\xfa\x9f\x17\xb9\x42\x8d\xc2\xc0\x3b\x16\xe3\xb5\x94\x5f\x61\x29\xe2\x08\x2e\xb3\x0c\xa8\x91\x06\xfb\x5d\x6d\x31\x89\xc6\x9f\xd6\x5c\x83\x96\x85\x8a\x11\x62\x99\x20\x70\x0d\x19\x8f\x51\x68\x4c\xa0\x10\x09\x2a\x30\x6b\x84\xcb\x9c\xc5\x6b\x84\xd7\xd1\xcb\xf2\x2b\xa4\xb2\x10\xc9\x98\x0b\xfa\xfe\xe3\xf2\xcd\xdb\xf7\x1f\xdf\x42\xca\x33\x04\xff\x4e\x49\x69\x20\xe1\x0a\x63\x23\xd5\x1d\xc8\x14\x4c\x30\x98\x51\x88\xd1\xf8\x6c\xb1\xdb\x8d\xc7\xf7\xf7\x90\x60\xca\x05\xc2\xe4\xaf\x02\xd5\xdd\x04\x76\x3b\xfb\xf2\x24\xff\xba\x82\xf3\x0b\xb8\x66\x1a\xe1\x24\x7a\x23\x45\xca\x57\xd1\xcf\x2c\xfe\xca\x56\x08\xbe\xa7\xc1\x4d\x9e\x31\x83\x30\x59\x23\x4b\x50\x4d\xe0\xa4\xfd\x89\x6f\x72\xa9\x4c\xf9\xc9\x3d\xc1\x74\x3c\xba\xbf\x7f\x01\x8a\x89\x15\xc2\x49\xce\xcc\xda\x0e\x76\x12\x7d\xe4\xd7\x19\x17\xab\x25\xb5\xd2\xb6\xc7\x68\x34\xa1\xe9\xd8\x26\xbb\xdd\xc4\xf5\x43\x91\xd8\x6f\xb3\x31\x8d\x75\x72\x5d\xf0\xcc\xaa\x8b\x44\xfc\x62\x97\xf1\x9e\x6d\xb0\x5c\x89\xc2\x18\xf9\xd6\x7d\xae\xfe\x57\x7d\xec\xa4\x16\x0b\x08\xc5\xec\x76\xd6\x14\x56\x8f\xe5\x9b\x54\x2a\x20\xf5\x70\xb1\xb2\x4d\x73\xa6\x63\x96\xc1\x49\xe4\xc7\x01\x14\x86\x1b\x8e\x3a\x1a\x9b\xbb\x1c\x9b\xd2\xb4\x51\x45\x6c\xe0\x7e\x3c\x8a\x49\x8f\xe3\x51\xc6\x37\xdc\x8c\x46\x67\x5c\x98\xf1\x48\xa6\xa9\xc6\xfa\x49\x25\xa8\x46\xa3\xcf\x5f\x7e\xb2\x7f\xc6\xa3\x42\xf0\xbf\x0a\xb4\x2f\xb4\x51\x5c\xac\xc6\xa3\x5c\x61\xc2\x63\x66\x50\xc3\xe8\xf3\x97\xea\x29\xb2\xa3\x96\x33\x72\x7a\xba\xe1\x66\x0d\x27\xd1\xdb\x64\x85\x5e\x99\x8b\x05\x20\x5b\xa1\x7a\x91\x49\x96\xd8\xd5\xa0\xfd\x16\x8d\x47\xa1\x3d\xd0\xaa\x2a\x72\x1d\x46\x56\x46\xb0\x64\xac\xd6\x7c\x66\xc7\xc3\xe8\xd3\x5d\x8e\xfb\x4a\x1f\x85\x36\x6a\xfd\x5f\x9c\xc1\x65\x92\x70\xc3\xa5\x60\x19\xa4\x1c\xb3\x44\x83\x91\xc0\x92\xc4\xfe\x04\x6a\x8f\x80\x30\x4a\xbd\x4e\xcc\x26\xcf\xec\xb4\x72\xc5\x85\x49\x61\x92\x70\x96\x61\x6c\x16\xdf\xeb\x05\x59\x66\xe1\x24\x4d\x2c\x88\x8c\x54\x1e\xa5\xd4\x97\xa7\xb0\x66\xfa\x53\x89\x48\x27\xaa\x9a\xe7\xad\xd9\xff\x10\xb5\x66\xbd\x58\x00\x17\x06\xd5\x06\x13\x6e\xdb\xd1\x78\x30\xe5\x11\x46\x60\x14\xdb\xa2\xd2\x2c\x03\x8b\xd0\x59\x64\x7b\xee\x4d\x01\xc2\xe7\xe8\x87\x1a\x75\x23\x82\x74\x5a\x88\x78\x1a\x4b\x61\xf0\xd6\x58\x2f\xb3\xbf\x33\x98\xf6\x74\x9a\x03\x2a\x25\xd5\x6c\xec\x40\xfb\xeb\x1a\x15\x5a\xc5\x69\x60\x20\xf0\x06\x2a\x2c\x10\x62\x43\x55\x8e\xed\x40\x4e\x6e\xe5\x03\xa5\x0d\x6b\xa4\xce\x9c\xc8\x69\xae\x21\x8a\xa2\x6e\x64\xcd\x9a\x9d\x2c\xae\x43\xb9\xbb\x5d\x14\x20\xf4\x02\x58\x9e\xa3\x48\x9a\x43\x07\x6d\xe6\x90\xeb\x28\x8a\x66\xe3\x91\x42\x53\x28\x01\x8d\xa6\x7e\xb5\x3f\x5a\x9f\x29\x57\x4b\x0e\x04\xda\x60\x5e\x82\x86\xac\x32\x78\x9d\x24\x6c\xea\xa4\x70\x61\x0e\x2e\xca\xce\xd8\xb5\xbe\x80\x53\xfa\x73\x60\xb6\x3f\x91\x53\xfb\xe9\x0a\x70\x3e\xfe\x84\x09\x3b\x79\x53\x2f\x67\xe8\x94\x7d\xf3\x0b\x38\x75\xff\x0e\x4d\xda\x52\x4e\x3d\x67\x7a\x7a\xc2\x94\x6d\xff\xa9\xb4\x50\xa2\xbf\xc3\x66\x4c\x83\xf6\xa2\x86\x3e\xcf\x41\x1e\xc2\x8b\x8d\xcd\x2e\xe8\x51\x68\x5d\x33\x0d\x9a\x6f\x78\xc6\x14\x37\x77\x8e\x17\x2d\xf3\xd1\x8a\x38\x6a\x1b\x38\xe3\x8c\xa3\x30\x11\x91\x00\x11\xcf\xfd\x7d\x49\x88\xbf\xcf\x3d\x29\x86\x5c\x4a\xf4\x97\xac\xf0\xf7\x20\xfc\x10\x3b\xc1\xb4\x26\x4b\x62\x47\xeb\x39\x33\x98\xfc\x52\x05\x58\x4b\x29\xf4\xd4\x49\xac\xf1\x9a\x71\xe1\x02\x50\x5c\x28\x65\xd3\x09\x47\x39\xd2\x45\x77\xc7\xbb\x55\xe8\x49\x56\x18\x8d\x47\x03\x6d\xd2\x3b\xea\xd4\x5b\x67\x6f\x45\xce\x44\x23\x37\xfa\xf9\x05\x9c\x76\xb4\xb8\x77\x31\xed\xbc\x69\x85\xc8\xbd\xdf\x95\xfd\x23\xe2\xbb\x0b\xcf\x78\xe6\x16\xda\xac\x97\x2a\xb9\xf9\x67\x1f\x61\x12\xf7\x79\xfe\xa3\x59\x8d\x78\x4a\xaf\xce\x2f\x5a\x43\xe7\x0a\x73\xa6\x90\x16\x6b\xc7\x9a\xfd\x2f\xb5\xfc\xee\x02\x04\xcf\x5c\xe7\x12\x3b\x82\x67\x24\xd9\xbe\xa3\x78\x57\xc5\x4d\xbc\x35\x36\x02\x9c\xc0\xe4\x83\x17\x3d\x09\x46\x99\x58\x20\x4c\x2c\x2c\x26\xcb\x04\x85\x99\xc0\x84\xa6\x3f\x81\x17\x2e\x6e\x12\x3e\x0e\x46\x2d\xab\x94\x66\xcc\x1a\x3d\x14\x98\xea\xe0\xea\xc7\xf1\xeb\xa0\xc1\xe7\x76\x39\x63\xb7\x10\xff\x9e\x86\x19\x8f\x08\xcd\x3e\xa0\x59\x4f\x7f\xc7\x95\x36\xe0\xda\x38\xa8\xa5\xf4\x26\x64\x7a\x97\xd5\xdc\x95\x49\xa5\xb3\x22\x7c\xf0\x7d\xce\xde\x4b\xf3\xce\x26\xa2\x6f\xad\x49\xe0\x66\x8d\x02\x84\xb4\x02\x32\x79\x63\x33\xac\x4a\xcc\x0d\xd3\x2e\x65\x1d\xcc\x1c\x34\xbb\x1e\x90\x9c\x85\x53\x9c\x07\x80\xb0\xa8\xce\x0a\x45\x79\xd9\x87\x5a\xfa\xbc\x0f\x24\x2e\x04\xbc\x9a\x45\x97\x59\x46\x20\x19\x97\x88\x0a\x70\xd2\x42\xc9\x8e\x5a\x65\x28\xa6\x3d\xe3\xcd\xe0\xe2\x02\x5e\xb6\x3a\x9f\xee\xa9\xeb\xde\x29\xba\xce\xa7\xa3\x1f\xd9\x35\x66\x3b\x92\x5f\xb3\x5a\x97\xfc\xcf\x2f\xbf\x38\x33\x07\x86\xfc\xcd\xed\x1d\xbe\xa2\x7b\x9c\xc3\x75\x61\x20\x67\x82\xc7\xda\x66\x3f\x4c\x38\x35\x81\x8c\xe3\x42\xe9\xe3\xcc\xf0\x5b\xb7\x1d\xf6\xcc\x50\x12\xf9\x20\xbd\x57\xc6\x6d\x29\xfc\xf4\x14\xbe\x5b\xea\x52\x51\x53\x54\xde\xd3\x69\x25\xf4\xd8\xd0\xcf\xde\x80\xa1\x42\x96\x57\x87\xb0\xcd\x93\xe3\x70\xcd\x93\xc7\xe2\x78\x79\xd5\x83\x64\x9e\xb8\x29\x2d\xaf\x28\x4c\x74\x70\xdc\x96\x29\xe0\x89\x86\xcf\x5f\x1a\x0d\x49\x73\x3c\xd1\xae\xc3\x03\xd8\x5e\x5e\xe9\x6e\x02\x74\xea\x09\xf1\xcc\x13\x1d\x60\xd7\xc9\x1d\x8a\xda\x50\x9c\x37\x0f\x4f\x74\x27\x54\x97\x57\xfb\x60\x5d\x5e\x3d\x2f\x5c\xfb\xd4\xdd\xd0\xa0\x5d\x24\x4f\x1e\x06\xa9\x13\xf5\x44\x98\xf2\xa4\x4c\xae\x44\x76\xb7\x87\x4a\x69\x5f\x1c\x22\xdc\x79\xd5\xa5\x52\x0b\x4f\x41\x48\x03\x78\xcb\x62\x93\xd9\xac\x00\xcb\x8e\x16\xa1\xae\x39\x0e\x07\xa9\x9d\xd7\xdf\xc3\xb5\xaf\x8f\xe7\x5a\x7d\xc3\x4d\xbc\x7e\x98\x6f\xed\xbe\x9a\x69\x84\x57\xe7\xb5\x90\x43\xe4\xe9\x7a\xbc\x3c\x7f\x24\x4b\x27\x98\xb2\x22\x33\x5d\xdd\x3f\x72\xb1\x2a\x32\xa6\x0e\xf2\x7c\x8d\x8a\x9a\xbe\xed\xd3\x73\xb9\x03\x49\x7e\x6e\xf2\x2e\xc1\xd2\x69\xc0\xa3\x78\xda\x4a\x6a\xd0\x74\xdb\x21\x1a\x2c\x3d\xcc\x19\x3c\x55\x3f\xca\x11\xfe\x73\x64\xfd\x7a\x18\x59\x07\x0e\x41\x84\xbd\x07\x7e\x9e\xc0\x85\x27\xde\x10\xe1\xc7\x71\x79\x80\xed\xba\xe3\x60\x54\x97\x73\x0d\xd0\x1d\x30\xbe\x53\xf1\xb3\x22\xfc\x79\xf8\xbe\xb6\xfd\x11\xc8\xae\xa8\xfd\x32\xcb\x00\x6f\x31\x2e\x0c\xea\x1a\xad\xc0\x44\x52\x03\x16\x32\xae\x0d\xc8\x74\x8f\x9a\x3c\xce\x07\xaf\xd8\xd3\x67\x07\x3e\x3f\x7f\xe9\x25\xeb\xa7\xec\x93\xba\x38\xb9\x7b\xd7\x1d\x35\x0e\xbe\x2a\xa6\xaf\x54\x54\xd3\xdc\x65\x96\x3d\x17\x06\xac\xdc\x6e\x95\x34\x34\xf2\x98\xb0\xf5\x50\xb4\xea\x25\xbb\xae\x11\xbc\x12\x96\x57\xfa\x28\x9c\x84\x44\x38\x5c\x25\x9e\x46\x3a\x41\xd2\xc5\x61\x83\xf8\xab\x47\x43\x1f\xd1\xee\x67\xa7\x4d\x3e\x78\xc7\x31\x4b\x96\x57\xb3\xe8\x63\xcc\x84\x9d\xcc\x1c\x4e\x2d\x5d\x1d\x83\x2f\x62\xcc\x3a\x7b\x5c\x5e\xe9\x1a\x40\xcb\x2b\xfd\x5c\x00\xb2\x72\xfb\x00\xd4\xc9\x21\xba\x17\x2e\x25\x7f\x1f\xc3\x20\xda\x2f\xef\x8d\x2c\xc4\xfe\x86\x3c\xa6\x37\x54\xbb\x41\x58\xf1\x2d\x8a\x23\xcf\xdf\x48\x64\x5f\x38\x13\xe6\x99\x29\xe2\xe5\xb1\x04\x51\x4d\x6f\x16\xaa\xa0\xb6\x31\x3d\x3e\x97\x95\x9d\xec\x6e\x65\x70\xe1\x6b\x33\x85\x57\x4a\x97\x1e\x82\xd9\x0e\xb6\x2e\x49\xf4\x8b\x7b\x7b\xcb\xc3\x03\x17\x55\xa0\x5d\x4e\xcd\x01\x6b\xa6\x01\x33\xdc\xa0\x30\xba\xcc\x79\x56\x8a\xe5\xeb\xc1\x4b\xa4\x11\x7a\xcc\x7d\x2d\x65\xf6\xcc\xf6\x4e\x59\xa6\xf1\x58\x9b\x57\x73\x9c\x85\x6a\xa9\x6d\x4e\x8f\xcf\x65\x73\x27\xbb\x5b\x23\x56\x21\x76\x35\xe8\x06\xec\x51\x46\x30\xdd\xc1\x46\x27\x89\x25\xa2\x33\x9b\x8f\xd6\xd4\x9e\x14\x79\xe6\xea\x33\x32\xb4\xbd\x9f\xf4\x1c\xb8\x88\xb3\x82\xca\x72\x2c\xcb\x80\x69\x2d\x63\xce\x0c\x26\x74\x08\xaf\x23\x58\x1a\x88\x99\x80\x6b\xb4\xc2\x0b\x8d\x54\x31\xf3\x16\x83\x58\x6e\x36\x52\xec\x8b\xd4\x14\x5b\x0a\x8d\x76\xb4\x0d\x24\x3c\x4d\x51\xa1\xb0\x99\x32\x4b\x8d\xaf\x30\xc7\x34\x4b\xae\x61\xc3\x12\x1c\xee\x51\xb6\xd7\xb4\xf3\x4c\xdf\x6b\xe2\x74\xff\x8b\x55\x59\x79\x56\xdc\x3a\xf6\x77\x1f\xe6\xe3\x91\x2b\x8d\x9e\xc3\xa8\xbb\xfc\x62\x5b\xb8\x52\x46\x87\x10\xf7\x81\x9a\xa8\x04\x95\x15\xe2\xcb\x08\xbe\x9a\x7a\xbf\x9b\xb7\x6c\x4c\x4d\xa3\x28\x9a\xd9\x7e\xae\xd8\x7a\x0e\x75\x3f\x57\x74\xed\xea\xe8\xda\x96\x3d\xeb\x72\xd6\x39\x54\x9d\xbb\x2b\x68\x5d\xc2\xea\xee\xa5\xc0\xc5\xa2\x34\x4c\xab\xf6\xe8\xca\xb5\x7b\x8e\xd5\x3e\x7e\x6f\x34\x88\xbc\xbd\x68\xae\xcc\xac\xdb\x1d\xec\xdb\xb9\xdf\x98\x36\x8b\xc1\xad\xba\x47\x58\x72\xef\xac\x01\x2f\x16\x00\xbf\xf6\x95\x8e\x0d\x66\x59\x90\x00\xbd\x28\xa5\x19\x19\x54\xa7\x5d\x03\x21\x13\xca\x95\x98\x01\x07\x72\x21\x30\x36\x84\x7c\x1a\xc4\xb6\x99\xec\x55\x44\x26\xae\x24\x02\x9f\xec\x8e\x32\xf7\x75\x66\xa6\x56\x85\xe3\xd6\xd2\x6d\x1c\xe2\x0a\x85\x6d\x47\x2c\xbd\xf3\xb8\xd2\x4a\xdf\x6a\xa7\x32\x37\x54\x4f\xa5\xca\xc7\xd9\x9e\xfa\x76\xbb\x59\xa7\x07\x35\x4b\x2e\x47\x95\x5b\x52\xa9\xe0\xf7\xb9\x5d\x3b\x5d\x79\x20\x33\xd2\x1c\xa8\xf0\x21\x73\x33\x25\xe9\x33\x5f\x28\x68\x0a\xea\x2d\xf8\x5f\x94\xc5\x84\xbe\xba\x1b\x55\x19\xaa\xba\x39\x5d\xbe\x58\x29\x59\xe4\x3f\x04\x05\xb2\xbd\x9b\x13\xff\xaa\x0a\x23\xdf\xeb\xff\xa7\x96\xae\x3e\x66\xe9\xcd\x3f\x57\xf6\x22\x49\xb0\x45\x65\x78\x8c\x1a\xae\xdd\x5e\x5f\x2a\xd8\x48\x85\xfe\x1e\xc1\x22\x96\x59\xb1\x11\x3a\xa2\x84\xd1\x58\x4e\x93\xa9\x41\xe1\x84\x50\x55\x87\xad\x56\x0a\x57\x54\x22\x2f\x44\x6c\xd1\xa1\xe7\x14\x7b\x48\xa3\x7f\x4a\x2e\x60\xfa\x15\xef\x74\xdd\x70\x06\x93\x39\x4c\x68\x97\x56\xd5\x86\x32\x14\x70\xe2\xb2\x5c\xed\xee\x99\xbc\x80\x93\xd4\x2e\x90\x8b\x04\x6f\xeb\x6f\x2f\xed\xd7\xc5\xc2\x85\x3a\xb6\xc9\x33\x3c\x77\x8f\x94\x6e\x6f\x81\x08\xc6\x5d\x0e\x59\x2c\x9c\x2d\xd2\xe8\x23\xbd\x22\x09\xe5\x0d\x82\xb4\xca\x41\xff\x08\xdb\x7c\x62\x2b\xd8\xed\xfe\xa0\xbe\x2e\x83\xb4\xc9\xcc\x1f\x7f\x6a\x29\xce\x27\x2e\xa1\x91\x1b\x6e\x70\x93\x9b\xbb\x09\x35\xf3\xb3\x19\xf9\x6a\x67\xc7\x65\x16\xe7\xc8\xd3\x59\x44\x52\xbd\x19\x5a\x19\xbe\x9b\xc5\x1b\x29\xb4\x61\xc2\x58\x20\xbb\xf6\x97\xa5\xda\xa8\x47\xfe\x75\x55\x27\x4f\x33\xdf\x24\xd8\x13\x6c\x67\x76\x3a\x01\x68\x06\xfa\x5a\x39\x2b\x32\x3b\x38\x8e\x9e\x97\x97\x49\xa2\x28\x72\x6f\xbc\x6b\xed\x61\xd0\xf9\x97\x03\x53\xe9\x5e\x8d\x06\x87\x5d\x8c\x3a\x44\x7e\xb8\x0b\x68\x06\x0b\xfa\xb0\x2b\xe7\xe3\x4a\xd5\xae\xcb\xe1\x1a\x68\xae\x70\x3b\xb8\x04\xfa\xa4\x0a\x68\xbb\x00\xba\xeb\x75\xed\x66\x34\xf1\x10\xf1\x67\xa9\x75\xf2\x43\xab\x1c\x7b\xdf\xd7\xb4\x37\x1c\xe4\xfc\x6e\x1b\x59\xf9\xbe\x7b\xec\x70\x70\x2a\x73\xb6\x37\x44\xdf\xb2\x5f\x1e\xeb\x70\x3d\x3b\xea\x3e\x7f\x7b\x06\x67\xf2\x23\x0e\xf2\xa5\x7d\x9b\x3a\x67\x72\xef\xa4\xaa\xfc\xa9\xd9\xe8\xb0\x43\x95\x22\x8e\xf3\xa9\xaa\xd7\x7f\xbb\x5b\x95\x0b\xb5\x9e\x35\xd0\xa8\xcd\x99\xb6\x75\xe2\xf6\x54\x6e\x33\xd8\x95\x0b\xee\x6d\x75\x14\x6e\x7b\x77\x49\xb6\xb1\xdf\x24\x75\xec\x92\xaa\x7d\x51\xa5\x8b\x03\x4a\x80\x0b\x3b\xf9\x2d\xad\xdf\x5f\xdf\x3b\x89\xfe\xc1\xf4\xcf\x32\xe3\xf1\x9d\xbb\x04\xb1\x6f\xa1\xd0\x4f\x5c\xab\xe8\xed\x96\x65\xd5\xda\x5b\xe9\x76\xbf\xd9\xaa\x59\x86\x17\x00\x6b\x93\x7a\x6a\x6b\xdc\x0f\xf1\x50\x9a\xd4\x16\x98\xf8\x19\x4d\xca\x10\x38\x1e\x74\x1d\xa4\x7d\x7b\xb1\xfb\x16\x48\x70\x97\x83\x2e\x3a\x11\xed\x5e\xd7\xf9\x6b\x75\xb7\xd7\x85\xb6\x0f\x9d\x37\x60\x1b\x51\xaf\xba\x06\xdb\x0c\x97\x1d\x77\x61\xa9\xc9\x8b\xeb\xbb\xa1\x77\x61\x9b\x22\xdb\x17\x62\xbd\xdf\xd7\x97\x5c\x53\xa1\x01\x00\x3e\x7f\xa9\x12\x8a\x6f\xf8\x22\x66\x35\x47\x77\x77\xae\x8e\x4f\x65\x12\xc9\xa5\xa8\xf3\xcd\xf2\x36\x5d\xa5\xc5\xd6\xb1\xde\xbe\xd5\x4a\xf7\x6e\x68\x71\x56\x0f\x3b\xb5\xda\x8a\xa2\xe8\xb2\xce\x59\xfb\x32\x9f\x2e\xf1\x91\xed\xbe\x77\xe5\xae\xab\xc5\x1c\x52\xd1\xbe\xa7\xd9\x6c\xe9\x35\x62\xc3\x92\x15\x98\x71\x7f\xd2\xbd\xbf\x58\x3a\x96\xd0\xb6\x0d\x5d\x57\x47\x5d\x64\x94\xba\xca\x40\x77\x5b\x96\x15\xf8\x08\xad\x94\x11\xb1\xc9\x78\x73\xd8\x3a\xf8\xa4\x2c\xc6\xfb\x5d\x40\x80\xbe\xb6\x18\x30\x4a\x6b\xfd\x01\xc7\xf5\x16\xae\xcb\xa3\xb0\x4e\x01\x6d\x92\xf3\x9b\xa9\x07\x74\xd9\xec\x54\xc7\xfa\xed\x2c\xd0\x73\x7d\x7c\x66\x9f\x8e\x38\x3d\x3b\x42\xa1\x9d\xc7\x68\x2d\x8d\xb6\x4e\x16\x5b\x2b\x0a\x97\xd0\x22\xe1\xfd\x03\x35\xc7\x60\xc1\x0d\x4c\xe3\xa9\x73\xc3\x0d\xdf\x06\x87\x11\x69\x98\x5b\x1a\x9b\x57\xba\x0a\x8c\x3f\x86\x70\x4d\x76\xbb\xea\x1c\xae\xa3\x10\x67\x13\x2a\x97\x5b\x96\x38\x8d\xca\xfd\xa3\xc8\xee\x80\x65\x99\xbc\xb1\x3b\xc8\x75\x99\x73\x72\xb1\xaa\x21\x4d\xe1\xc0\x26\xab\xc4\x62\x7b\x27\x06\x03\x55\x5c\xce\xf1\xc1\xba\x8d\x69\x14\x6c\x82\x8b\x68\x1d\x0e\x4b\x84\x3a\x83\xff\x83\x57\x9d\x79\x89\x54\x3a\x7a\x8f\x37\xd3\x49\xbd\x4d\x3b\xef\xe2\xea\xa8\x52\x1f\xd7\x54\x69\x67\xf1\x9a\xe3\x96\x5d\x67\xe8\xd4\x41\xed\xad\x3a\x28\x4d\x37\x6b\x26\xe0\x95\x53\xc4\xa4\x3c\x61\x28\x53\xea\x72\x11\xad\x00\xfe\x00\x4c\x4e\x3b\x70\xf2\x70\x8e\xb5\xad\xd2\xa7\x3d\xf3\xd7\x5e\x52\xbe\x39\xe8\x29\x8f\xb7\xe3\x83\x15\x25\x53\x1e\xf2\x6c\x1f\xe6\x9c\x10\x14\x3d\xb9\x55\xe8\x31\x7b\x3a\x68\xdc\xf8\x7c\x28\x67\x69\xe6\x01\x87\x32\x15\x6a\xff\xd8\x4c\xc5\x65\xb2\x1d\x89\x8a\xfb\xd0\x9d\xa9\x34\xf7\x13\x55\xaa\xd2\xda\x8d\x74\xe4\x2a\x7e\x44\x9f\x60\x78\xb7\x1f\x90\xb3\xb4\x64\x0f\x48\x5a\xbe\xcd\x04\xa5\x33\x1e\x57\x9b\xb6\xc7\xc7\xe3\x86\xc9\x4a\xa7\x68\x2a\xee\x79\x22\x72\x6b\xb0\xa3\x43\x72\x5b\xc2\x90\x98\x7c\xb0\xd7\x73\x07\xe5\xa3\xb4\xfa\xc8\xb0\xdc\x5e\xd4\x37\x1f\x97\xab\xbd\x7e\x6f\x5c\x76\x2d\x6c\x24\xea\x0e\xc5\x83\x15\xfb\xe4\x60\xdc\x56\xef\xa3\xa3\x71\x73\x76\x07\xc3\x71\xad\x85\x27\xc4\xe3\x87\xf0\xf1\x8d\x04\xe4\xa3\xad\xf9\x98\x90\xdc\xed\xfc\x7f\x43\x4c\x6e\x45\xbc\x43\x41\x59\xfb\x03\xd4\x47\x44\xe5\xf2\xef\xbf\x03\x00\x00\xff\xff\x95\x46\xdc\x23\xcf\x3c\x00\x00") +var _templateBuilderQueryTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x5a\xff\x6f\xdb\xb8\x92\xff\xd9\xfe\x2b\xe6\x19\x79\x81\x1d\xb8\x72\xdb\xdf\x2e\x87\x1c\xd0\xd7\xb4\x77\x06\x16\x7d\x6f\xdb\x1e\x76\x81\xa2\xd8\x65\xa4\x91\xcd\xad\x4c\x6a\x49\xca\x49\x90\xf3\xff\x7e\xe0\x90\x92\xa8\x6f\xb1\x9c\x06\x7b\xc5\xfd\x64\x4b\x22\x87\xe4\xcc\x67\x3e\x33\xe4\xf0\xe1\x61\x75\x31\x7d\x2b\xf3\x7b\xc5\x37\x5b\x03\xaf\x5f\xbe\xfa\xb7\x17\xb9\x42\x8d\xc2\xc0\x7b\x16\xe3\x8d\x94\xdf\x60\x2d\xe2\x08\xde\x64\x19\x50\x23\x0d\xf6\xbb\xda\x63\x12\x4d\x3f\x6f\xb9\x06\x2d\x0b\x15\x23\xc4\x32\x41\xe0\x1a\x32\x1e\xa3\xd0\x98\x40\x21\x12\x54\x60\xb6\x08\x6f\x72\x16\x6f\x11\x5e\x47\x2f\xcb\xaf\x90\xca\x42\x24\x53\x2e\xe8\xfb\x4f\xeb\xb7\xef\x3e\x7c\x7a\x07\x29\xcf\x10\xfc\x3b\x25\xa5\x81\x84\x2b\x8c\x8d\x54\xf7\x20\x53\x30\xc1\x60\x46\x21\x46\xd3\x8b\xd5\xe1\x30\x9d\x3e\x3c\x40\x82\x29\x17\x08\xb3\x3f\x0b\x54\xf7\x33\x38\x1c\xec\xcb\xb3\xfc\xdb\x06\x2e\xaf\xe0\x86\x69\x84\xb3\xe8\xad\x14\x29\xdf\x44\xff\x62\xf1\x37\xb6\x41\xf0\x3d\x0d\xee\xf2\x8c\x19\x84\xd9\x16\x59\x82\x6a\x06\x67\xdd\x4f\x7c\x97\x4b\x65\xca\x4f\xee\x09\xe6\xd3\xc9\xc3\xc3\x0b\x50\x4c\x6c\x10\xce\x72\x66\xb6\x76\xb0\xb3\xe8\x13\xbf\xc9\xb8\xd8\xac\xa9\x95\xb6\x3d\x26\x93\x19\x4d\xc7\x36\x39\x1c\x66\xae\x1f\x8a\xc4\x7e\x5b\x4c\x69\xac\xb3\x9b\x82\x67\x56\x5d\x24\xe2\x67\xbb\x8c\x0f\x6c\x87\xe5\x4a\x14\xc6\xc8\xf7\xee\x73\xf5\xbf\xea\x63\x27\xb5\x5a\x41\x28\xe6\x70\xb0\xa6\xb0\x7a\x2c\xdf\xa4\x52\x01\xa9\x87\x8b\x8d\x6d\x9a\x33\x1d\xb3\x0c\xce\x22\x3f\x0e\xa0\x30\xdc\x70\xd4\xd1\xd4\xdc\xe7\xd8\x96\xa6\x8d\x2a\x62\x03\x0f\xd3\x49\x4c\x7a\x9c\x4e\x32\xbe\xe3\x66\x32\xb9\xe0\xc2\x4c\x27\x32\x4d\x35\xd6\x4f\x2a\x41\x35\x99\x7c\xf9\xfa\x4f\xfb\xe7\x7d\x21\xe2\xe9\xa4\x10\xfc\xcf\x02\xed\x4b\x6d\x14\x17\x9b\xe9\x24\x57\x98\xf0\x98\x19\xd4\x30\xf9\xf2\xb5\x7a\x8a\xec\xc8\xe5\xac\x9c\xae\x6e\xb9\xd9\xc2\x59\xf4\x2e\xd9\xa0\x57\xe8\x6a\x05\xc8\x36\xa8\x5e\x64\x92\x25\x76\x45\x68\xbf\x45\xd3\x49\x68\x13\xb4\xea\x8a\x5c\x87\x89\x95\x11\x2c\x1b\xab\x75\x5f\xd8\xf1\x30\xfa\x7c\x9f\x63\x53\xf1\x93\xd0\x4e\x9d\xff\xab\x0b\x78\x93\x24\xdc\x70\x29\x58\x06\x29\xc7\x2c\xd1\x60\x24\xb0\x24\xb1\x3f\x81\xea\x23\x20\x9c\x52\xaf\x33\xb3\xcb\x33\x3b\xad\x5c\x71\x61\x52\x98\x25\x9c\x65\x18\x9b\xd5\xdf\xf5\x8a\xac\xb3\x72\x92\x66\x16\x48\x46\x2a\x8f\x54\xea\xcb\x53\xd8\x32\xfd\xb9\x44\xa5\x13\x55\xcd\xf3\xce\x34\x3f\x44\x9d\x59\xaf\x56\xc0\x85\x41\xb5\xc3\x84\xdb\x76\x34\x1e\xcc\x79\x84\x11\x18\xc5\xf6\xa8\x34\xcb\xc0\xa2\x74\x11\xd9\x9e\x8d\x29\x40\xf8\x1c\xfd\xa3\x46\xde\x84\x60\x9d\x16\x22\x9e\xc7\x52\x18\xbc\x33\xd6\xd3\xec\xef\x02\xe6\x03\x9d\x96\x80\x4a\x49\xb5\x98\x3a\xe0\xfe\xb2\x45\x85\x56\x71\x1a\x18\x08\xbc\x85\x0a\x0b\x84\xda\x50\x95\x53\x3b\x90\x93\x5b\xf9\x41\x69\xc3\x1a\xad\x0b\x27\x72\x9e\x6b\x88\xa2\xa8\x1f\x59\x8b\x76\x27\x8b\xed\x50\xee\xe1\x10\x05\x08\xbd\x02\x96\xe7\x28\x92\xf6\xd0\x41\x9b\x25\xe4\x3a\x8a\xa2\xc5\x74\xa2\xd0\x14\x4a\x40\xab\xa9\x5f\xed\x4f\xd6\x6f\xca\xd5\x92\x13\x81\x36\x98\x97\xa0\x21\xab\x8c\x5e\x27\x09\x9b\x3b\x29\x5c\x98\xa3\x8b\xb2\x33\x76\xad\xaf\xe0\x9c\xfe\x1c\x99\xed\x3f\xc9\xb1\xfd\x74\x05\x38\x3f\xff\x8e\x09\x3b\x79\x73\x2f\x67\xec\x94\x7d\xf3\x2b\x38\x77\xff\x8e\x4d\xda\xd2\x4e\x3d\x67\x7a\xfa\x8e\x29\xdb\xfe\x73\x69\xa1\x54\xf1\xd9\xb8\x59\xd3\xc0\x83\xc8\xa1\xcf\x4b\x90\xc7\x30\x63\x63\xb4\x0b\x7e\x14\x62\xb7\x4c\x83\xe6\x3b\x9e\x31\xc5\xcd\xbd\xe3\x46\xcb\x7e\xb4\x2a\x8e\xda\x06\xd0\x38\xe3\x28\x4c\x44\x44\x40\xe4\xf3\xf0\x50\x92\xe2\x6f\x4b\x4f\x8c\x21\x9f\x12\x05\x26\x1b\xfc\x2d\x08\x43\xc4\x50\x30\xaf\x09\x93\x18\xd2\x7a\xcf\x02\x66\x3f\x57\x81\xd6\xd2\x0a\x3d\xf5\x92\x6b\xbc\x65\x5c\xb8\x40\x14\x17\x4a\xd9\xb4\xc2\xd1\x8e\x74\x51\xde\x71\x6f\x15\x82\x92\x0d\x46\xd3\xc9\x48\xbb\x0c\x8e\x3a\xf7\xd6\x69\xac\xc8\x99\x68\xe2\x46\xbf\xbc\x82\xf3\x9e\x16\x0f\x2e\xb6\x5d\xb6\xad\x10\xb9\xf7\x87\xb2\x7f\x44\x9c\x77\xe5\x59\xcf\xdc\x41\x97\xf9\x52\x25\x77\xff\x3d\x44\x9a\xc4\x7f\x9e\x03\x69\x56\x13\x9e\xd2\xab\xcb\xab\xce\xd0\xb9\xc2\x9c\x29\xa4\xc5\xda\xb1\x16\xff\x4e\x2d\xff\x76\x05\x82\x67\xae\x73\x89\x1d\xc1\x33\x92\x6c\xdf\x51\xcc\xab\x62\x27\xde\x19\x1b\x05\xce\x60\xf6\xd1\x8b\x9e\x05\xa3\xcc\x2c\x10\x66\x16\x16\xb3\x75\x82\xc2\xcc\x60\x46\xd3\x9f\xc1\x0b\x17\x3b\x09\x1f\x47\x23\x97\x55\x4a\x3b\x6e\x4d\x1e\x0b\x4e\x75\x80\xf5\xe3\xf8\x75\xd0\xe0\x4b\xbb\x9c\xa9\x5b\x88\x7f\x4f\xc3\x4c\x27\x84\x66\x1f\xd4\xac\xb7\xbf\xe7\x4a\x1b\x70\x6d\x1c\xd4\x52\x7a\x13\xb2\xbd\xcb\x6e\xee\xcb\xe4\xd2\x59\x11\x3e\xfa\x3e\x17\x1f\xa4\x79\x6f\x13\xd2\x77\xd6\x24\x70\xbb\x45\x01\x42\x5a\x01\x99\xbc\xb5\x99\x56\x25\xe6\x96\x69\x97\xba\x8e\x66\x0f\x9a\xdd\x00\x48\x2e\xc2\x29\x2e\x03\x40\x58\x54\x67\x85\xa2\xfc\xec\x63\x2d\x7d\x39\x04\x12\x17\x06\x5e\x2d\xa2\x37\x59\x46\x20\x99\x96\x88\x0a\x70\xd2\x41\xc9\x81\x5a\x65\x28\xe6\x03\xe3\x2d\xe0\xea\x0a\x5e\x76\x3a\x9f\x37\xd4\xf5\xe0\x14\x5d\xe7\xd5\xd1\x4f\xec\x06\xb3\x03\xc9\xaf\x59\xad\x4f\xfe\x97\x97\x5f\x9d\x99\x03\x43\xfe\xea\xf6\x10\xdf\xd0\x3d\x2e\xe1\xa6\x30\x90\x33\xc1\x63\x6d\x33\x20\x26\x9c\x9a\x40\xc6\x71\xa1\xf4\x69\x66\xf8\xb5\xdf\x0e\x0d\x33\x94\x44\x3e\x4a\xef\x95\x71\x3b\x0a\x3f\x3f\x87\xbf\xad\x75\xa9\xa8\x39\x2a\xef\xe9\xb4\x12\x7a\x6c\xe9\xa7\x31\x60\xa8\x90\xf5\xf5\x31\x6c\xf3\xe4\x34\x5c\xf3\xe4\xa9\x38\x5e\x5f\x0f\x20\x99\x27\x6e\x4a\xeb\x6b\x0a\x13\x3d\x1c\xb7\x67\x0a\x78\xa2\xe1\xcb\xd7\x56\x43\xd2\x1c\x4f\xb4\xeb\xf0\x08\xb6\xd7\xd7\xba\x9f\x00\x9d\x7a\x42\x3c\xf3\x44\x07\xd8\x75\x72\xc7\xa2\x36\x14\xe7\xcd\xc3\x13\xdd\x0b\xd5\xf5\x75\x13\xac\xeb\xeb\xe7\x85\xeb\x90\xba\x5b\x1a\xb4\x8b\xe4\xc9\xe3\x20\x75\xa2\xbe\x13\xa6\x3c\x29\x13\x2c\x91\xdd\x37\x50\x29\xed\x8b\x63\x84\xbb\xac\xba\x54\x6a\xe1\x29\x08\x69\x00\xef\x58\x6c\x32\x9b\x15\x60\xd9\xd1\x22\xd4\x35\xc7\xf1\x20\xb5\xf3\xfa\x6b\xb8\xf6\xf5\xe9\x5c\xab\x6f\xb9\x89\xb7\x8f\xf3\xad\xdd\x5f\x33\x8d\xf0\xea\xb2\x16\x72\x8c\x3c\x5d\x8f\x97\x97\x4f\x64\xe9\x04\x53\x56\x64\xa6\xaf\xfb\x27\x2e\x36\x45\xc6\xd4\x51\x9e\xaf\x51\x51\xd3\xb7\x7d\x7a\x2e\x77\x20\xc9\xcf\x4d\xde\x25\x58\x7a\x0d\x78\x12\x4f\x5b\x49\x2d\x9a\xee\x3a\x44\x8b\xa5\xc7\x39\x83\xa7\xea\x27\x39\xc2\xff\x1d\x59\xbf\x1e\x47\xd6\x81\x43\x10\x61\x37\xc0\xcf\x13\xb8\xf2\xc4\x1b\x22\xfc\x34\x2e\x0f\xb0\x5d\x77\x1c\x8d\xea\x72\xae\x01\xba\x03\xc6\x77\x2a\x7e\x56\x84\x3f\x0f\xdf\xd7\xb6\x3f\x01\xd9\x15\xb5\xbf\xc9\x32\xc0\x3b\x8c\x0b\x83\xba\x46\x2b\x30\x91\xd4\x80\x85\x8c\x6b\x03\x32\x6d\x50\x93\xc7\xf9\xe8\x15\x7b\xfa\xec\xc1\xe7\x97\xaf\x83\x64\xfd\x3d\xfb\xa4\x3e\x4e\xee\xdf\x75\x47\xad\xc3\xaf\x8a\xe9\x2b\x15\xd5\x34\xf7\x26\xcb\x9e\x0b\x03\x56\x6e\xbf\x4a\x5a\x1a\x79\x4a\xd8\x7a\x2c\x5a\x0d\x92\x5d\xdf\x08\x5e\x09\xeb\x6b\x7d\x12\x4e\x42\x22\x1c\xaf\x12\x4f\x23\xbd\x20\xe9\xe3\xb0\x51\xfc\x35\xa0\xa1\x4f\x68\xf7\xb3\xf3\x36\x1f\xbc\xe7\x98\x25\xeb\xeb\x45\xf4\x29\x66\xc2\x4e\x66\x09\xe7\x96\xae\x4e\xc1\x17\x31\x66\x9d\x3d\xae\xaf\x75\x0d\xa0\xf5\xb5\x7e\x2e\x00\x59\xb9\x43\x00\xea\xe5\x10\x3d\x08\x97\x92\xbf\x4f\x61\x10\xed\x97\xf7\x56\x16\xa2\xb9\x21\x8f\xe9\x0d\xd5\x70\x10\x36\x7c\x8f\xe2\xc4\x33\x38\x12\x39\x14\xce\x84\x79\x66\x8a\x78\x79\x2a\x41\x54\xd3\x5b\x84\x2a\xa8\x6d\x4c\x8f\xcf\x65\x65\x27\xbb\x5f\x19\x5c\xf8\x1a\x4d\xe1\x95\xd2\xa7\x87\x60\xb6\xa3\xad\x4b\x12\xfd\xe2\xde\xdd\xf1\xf0\xc0\x45\x15\x68\x97\x53\x73\xc0\x96\x69\xc0\x0c\x77\x28\x8c\x2e\x73\x9e\x8d\x62\xf9\x76\xf4\x12\x69\x84\x01\x73\xdf\x48\x99\x3d\xb3\xbd\x53\x96\x69\x3c\xd5\xe6\xd5\x1c\x17\xa1\x5a\x6a\x9b\xd3\xe3\x73\xd9\xdc\xc9\xee\xd7\x88\x55\x88\x5d\x0d\xba\x01\x07\x94\x11\x4c\x77\xb4\xd1\x49\x62\x89\xe8\xcc\xe6\xa3\x35\xb5\x27\x45\x9e\xb9\x1a\x8d\x0c\x6d\xef\x27\xbd\x04\x2e\xe2\xac\xa0\xd2\x1c\xcb\x32\x60\x5a\xcb\x98\x33\x83\x09\x1d\xc4\xeb\x08\xd6\x06\x62\x26\xe0\x06\xad\xf0\x42\x23\x55\xcd\xbc\xc5\x20\x96\xbb\x9d\x14\x4d\x91\x9a\x62\x4b\xa1\xd1\x8e\xb6\x83\x84\xa7\x29\x2a\x14\x36\x53\x66\xa9\xf1\x95\xe6\x98\x66\xc9\x35\xec\x58\x82\xe3\x3d\xca\xf6\x9a\xf7\x9e\xe9\x7b\x4d\x9c\x37\xbf\x58\x95\x95\x67\xc5\x9d\x63\x7f\xf7\x61\x39\x9d\xb8\x12\xe9\x25\x4c\xfa\x4b\x30\xb6\x85\x2b\x67\xf4\x08\x71\x1f\xa8\x89\x4a\x50\x59\x21\xbe\x8c\x10\x54\x55\x1f\x0e\xcb\x8e\x9d\xa9\x79\x14\x45\x0b\xdb\xd7\x15\x5d\x2f\xa1\xee\xeb\x8a\xaf\x7d\x1d\x5d\xdb\xb2\x67\x5d\xd6\xba\x84\xaa\x73\x7f\x25\xad\x4f\x58\xdd\xbd\x14\xb8\x5a\x95\xc6\xe9\xd4\x20\x5d\xd9\xb6\xe1\x5c\xdd\x23\xf8\x56\x83\xc8\xdb\x8c\xe6\xca\xcc\xb6\xdb\xc1\xbe\x5d\xfa\xcd\x69\xbb\x28\xdc\xa9\x7d\x84\xe5\xf7\xde\x5a\xf0\x6a\x05\xf0\xcb\x50\x09\xd9\x60\x96\x05\x49\xd0\x8b\x52\x9a\x91\x41\x95\xda\x35\x10\x32\xa1\x7c\x89\x19\x70\x40\x17\x02\x63\x43\xe8\xa7\x41\x6c\x9b\x59\xa3\x2a\x32\x73\x65\x11\xf8\x6c\x77\x95\xb9\xaf\x37\x33\xb5\x29\x1c\xbf\x96\xae\xe3\x50\x57\x28\xec\x3a\x63\xe9\xa1\xa7\x95\x57\x86\x56\x3b\x97\xb9\xa1\xba\x2a\x55\x3f\x2e\x1a\xea\x3b\x1c\x16\xbd\x5e\xd4\x2e\xbb\x9c\x54\x72\x49\xa5\x82\xdf\x96\x76\xed\x74\xfd\x81\xcc\x48\x73\xa0\xe2\x87\xcc\xcd\x9c\xa4\x2f\x7c\xb1\xa0\x2d\x68\xb0\xf0\x7f\x55\x16\x14\x86\x6a\x6f\x54\x69\xa8\xea\xe7\x74\x11\x63\xa3\x64\x91\xff\x23\x28\x92\x35\x6e\x51\xfc\x4f\x55\x1c\xf9\xbb\xfe\x4f\x6a\xe9\x6a\x64\x96\xe2\xfc\x73\x65\x2f\x92\x04\x7b\x54\x86\xc7\xa8\xe1\xc6\xed\xf7\xa5\x82\x9d\x54\xe8\xef\x13\xac\x62\x99\x15\x3b\xa1\x23\x4a\x1a\x8d\xe5\x35\x99\x1a\x14\x4e\x08\x55\x76\xd8\x66\xa3\x70\x43\xa5\xf2\x42\xc4\x16\x1d\x7a\x49\xf1\x87\x34\xfa\x87\xe4\x02\xe6\xdf\xf0\x5e\xd7\x0d\x17\x30\x5b\xc2\x8c\x76\x6a\x55\x7d\x28\x43\x01\x67\x2e\xd3\xd5\xee\xce\xc9\x0b\x38\x4b\xed\x02\xb9\x48\xf0\xae\xfe\xf6\xd2\x7e\x5d\xad\x5c\xb8\x63\xbb\x3c\xc3\x4b\xf7\x48\x29\xf7\x1e\x88\x60\xdc\x45\x91\xd5\xca\xd9\x22\x8d\x3e\xd1\x2b\x92\x50\xde\x24\x48\xab\x3c\xf4\xf7\xb0\xcd\x67\xb6\x81\xc3\xe1\x77\xea\xeb\xb2\x48\x9b\xd0\xfc\xfe\x87\x96\xe2\x72\xe6\x92\x1a\xb9\xe3\x06\x77\xb9\xb9\x9f\x51\x33\x3f\x9b\x89\xaf\x78\xf6\x5c\x6c\x71\x8e\x3c\x5f\x44\x24\xd5\x9b\xa1\x93\xe5\xbb\x59\xbc\x95\x42\x1b\x26\x8c\x05\xb2\x6b\xff\xa6\x54\x1b\xf5\xc8\xbf\x6d\xea\x04\x6a\xe1\x9b\x04\xfb\x82\xfd\xc2\x4e\x27\x00\xcd\x48\x5f\x2b\x67\x45\x66\x07\xc7\xd1\xcb\xf2\x52\x49\x14\x45\xee\x8d\x77\xad\x06\x06\x9d\x7f\x39\x30\x95\xee\xd5\x6a\x70\xdc\xc5\xa8\x43\xe4\x87\xbb\x82\x76\xb0\xa0\x0f\x87\x72\x3e\xae\x5c\xed\xba\x1c\xaf\x83\xe6\x0a\xf7\xa3\xcb\xa0\xdf\x55\x05\xed\x16\x41\x0f\x83\xae\xdd\x8e\x26\x1e\x22\xfe\x3c\xb5\x4e\x80\x68\x95\x53\xef\xfb\x9a\xf6\x87\xa3\x9c\xdf\x6d\x25\x2b\xdf\x77\x8f\x3d\x0e\x4e\xa5\xce\xee\xa6\xe8\x47\xf6\xcb\x53\x1d\x6e\x60\x57\x3d\xe4\x6f\xcf\xe0\x4c\x7e\xc4\x51\xbe\xd4\xb4\xa9\x73\x26\xf7\x4e\xaa\xca\x9f\xda\x8d\x8e\x3b\x54\x29\xe2\x34\x9f\xaa\x7a\xfd\x7f\x77\xab\x72\xa1\xd6\xb3\x46\x1a\xb5\x3d\xd3\xae\x4e\xdc\xbe\xca\x6d\x08\xfb\x72\xc1\xc6\x76\x47\xe1\x7e\x70\xa7\x64\x1b\xfb\x8d\x52\xcf\x4e\xa9\xda\x1b\x55\xba\x38\xa2\x04\xb8\xb2\x93\xdf\xd3\xfa\xfd\x35\xbe\xb3\xe8\xbf\x98\xfe\x97\xcc\x78\x7c\xef\x2e\x42\x34\x2d\x14\xfa\x89\x6b\x15\xbd\xdb\xb3\xac\x5a\x7b\x27\xdd\x1e\x36\x5b\x35\xcb\xf0\x22\x60\x6d\x52\x4f\x6d\xad\x3b\x22\x1e\x4a\xb3\xda\x02\x33\x3f\xa3\x59\x19\x02\xa7\xa3\xae\x84\x74\x6f\x31\xf6\xdf\x04\x09\xee\x73\xd0\x65\x27\xa2\xdd\x9b\x3a\x7f\xad\xee\xf9\xba\xd0\xf6\xb1\xf7\x36\x6c\x2b\xea\x55\x57\x62\xdb\xe1\xb2\xe7\x5e\x2c\x35\x79\x71\x73\x3f\xf6\x5e\x6c\x5b\x64\xf7\x72\xac\xf7\xfb\xfa\xb2\x6b\x2a\x34\x00\xc0\x97\xaf\x55\x42\xe1\xae\xc5\xfe\xb0\x97\x32\xab\x79\xba\x7b\x74\x75\x8c\x2a\x13\x49\x2e\x45\x9d\x73\x96\x37\xeb\x2a\x4d\x76\x8e\xf7\x9a\x96\x2b\x5d\xbc\xa5\xc9\x45\x3d\xec\xdc\x6a\x2c\x8a\xa2\x86\xbe\x86\x33\xa0\xbe\x21\x22\x2b\xa2\x71\xfd\xae\xaf\xc5\x12\x52\xd1\xbd\xb7\xd9\x6e\xe9\xb5\x62\xc3\x93\x15\x98\x71\x7f\xea\xdd\x5c\x30\x1d\x51\x68\xdb\x86\xae\xb0\xa3\x2e\x32\x4a\x61\x65\xa0\xbf\x3d\xcb\x0a\x7c\x82\x66\xca\xc8\xd8\x66\xbe\x25\xec\x1d\x84\x52\x16\xe3\xc3\x21\x20\x42\x5f\x67\x0c\x98\xa5\xb3\xfe\x80\xeb\x06\x8b\xd8\xe5\xb1\x58\xaf\x80\x2e\xd9\xf9\x4d\xd5\x23\xba\x6c\x77\xaa\x63\xfe\x7e\x11\xe8\xb9\x3e\x4a\xb3\x4f\x27\x9c\xa4\x9d\xa0\xd0\xde\x23\xb5\x8e\x46\x3b\xa7\x8c\x9d\x15\x85\x4b\xe8\x90\x71\xf3\x70\xcd\x31\x59\x70\x1b\xd3\x78\x0a\xdd\x71\xc3\xf7\xc1\xa1\x44\x1a\xe6\x98\xc6\xe6\x97\xae\x1a\xe3\x8f\x23\x5c\x93\xc3\xa1\x3a\x93\xeb\x29\xca\xd9\xc4\xca\xe5\x98\x25\x4e\xa3\x72\x1f\x29\xb2\x7b\x60\x59\x26\x6f\xed\x4e\x72\x5b\xe6\x9e\x5c\x6c\x6a\x48\x53\x58\xb0\x49\x2b\xb1\x59\xe3\xe4\x60\xa4\x8a\xcb\x39\x3e\x5a\xc3\x31\xad\xe2\x4d\x70\x29\xad\xc7\x61\x89\x58\x17\xf0\x1f\xf0\xaa\x37\x3f\x91\x4a\x47\x1f\xf0\x76\x3e\xab\xb7\x6b\x97\x7d\x9c\x1d\x55\xea\xe3\x9a\xaa\xee\x2c\xde\x72\xdc\xb3\x9b\x0c\x9d\x3a\xa8\xbd\x55\x07\xa5\xeb\x66\xcb\x04\xbc\x72\x8a\x98\x95\x27\x0d\x65\x6a\x5d\x2e\xa2\x13\xc8\x1f\x81\xc9\x79\x0f\x4e\x1e\xcf\xb5\xf6\x55\x1a\xd5\x30\x7f\xed\x25\xe5\x9b\xa3\x9e\xf2\x74\x3b\x3e\x5a\x5d\x32\xe5\x61\xcf\xfe\x71\xce\x09\x41\x31\x90\x63\x85\x1e\xd3\xd0\x41\xeb\xf6\xe7\x63\xb9\x4b\x3b\x1f\x38\x96\xb1\x50\xfb\xa7\x66\x2c\x2e\xa3\xed\x49\x58\xdc\x87\xfe\x8c\xa5\xbd\xaf\xa8\x52\x96\xce\xae\xa4\x27\x67\xf1\x23\xfa\x44\xc3\xbb\xfd\x88\xdc\xa5\x23\x7b\x44\xf2\xf2\x63\x26\x29\xbd\xf1\xb8\xda\xbc\x3d\x3d\x1e\xb7\x4c\x56\x3a\x45\x5b\x71\xcf\x13\x91\x3b\x83\x9d\x1c\x92\xbb\x12\xc6\xc4\xe4\xa3\xbd\x9e\x3b\x28\x9f\xa4\xd5\x27\x86\xe5\xee\xa2\x7e\xf8\xb8\x5c\xed\xf9\x07\xe3\xb2\x6b\x61\x23\x51\x7f\x28\x1e\xad\xd8\xef\x0e\xc6\x5d\xf5\x3e\x39\x1a\xb7\x67\x77\x34\x1c\xd7\x5a\xf8\x8e\x78\xfc\x18\x3e\x7e\x90\x80\x7c\xb2\x35\x9f\x12\x92\xfb\x9d\xff\x2f\x88\xc9\x9d\x88\x77\x2c\x28\x6b\x7f\x90\xfa\x84\xa8\x5c\xfe\xfd\xdf\x00\x00\x00\xff\xff\xe4\x99\x16\xc3\xe3\x3c\x00\x00") func templateBuilderQueryTmplBytes() ([]byte, error) { return bindataRead( @@ -221,7 +221,7 @@ func templateBuilderQueryTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/query.tmpl", size: 15567, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/builder/query.tmpl", size: 15587, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -326,7 +326,7 @@ func templateContextTmpl() (*asset, error) { return a, nil } -var _templateDialectGremlinByTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x55\xc1\x6e\xe3\x46\x0c\x3d\x5b\x5f\x41\x18\x39\x58\x86\x2d\x6d\x73\x6b\x81\x1c\xdc\x74\x03\x04\x08\xb6\x05\x36\x6d\x8f\x0e\x3d\x43\xc9\x83\x8c\x67\x54\x0e\xe5\xad\x21\xe8\xdf\x8b\x19\xd9\x8a\x76\xb3\xdd\xe4\x64\x88\x1c\x92\x8f\xe4\xe3\x73\xd7\x95\xcb\xec\xd6\x37\x27\x36\xf5\x5e\xe0\xfa\xc3\x4f\x3f\xaf\x1b\xa6\x40\x4e\xe0\x0e\x15\xed\xbc\x7f\x86\x7b\xa7\x0a\xd8\x58\x0b\xe9\x51\x80\xe8\xe7\x23\xe9\x22\x7b\xdc\x9b\x00\xc1\xb7\xac\x08\x94\xd7\x04\x26\x80\x35\x8a\x5c\x20\x0d\xad\xd3\xc4\x20\x7b\x82\x4d\x83\x6a\x4f\x70\x5d\x7c\xb8\x78\xa1\xf2\xad\xd3\x99\x71\xc9\xff\x70\x7f\xfb\xf1\xd3\xe7\x8f\x50\x19\x4b\x70\xb6\xb1\xf7\x02\xda\x30\x29\xf1\x7c\x02\x5f\x81\x4c\x8a\x09\x13\x15\xd9\xb2\xec\xfb\x2c\xeb\x3a\xd0\x54\x19\x47\x30\xd7\x06\x2d\x29\x29\x6b\xa6\x83\x35\xae\xf4\xac\x89\xe7\xb0\xee\xfb\x6c\xd6\x75\x6b\xb8\x4a\x06\xf8\xe5\x06\xae\x8a\xcf\xca\x37\x54\xfc\x9e\x0c\xe9\x41\xd5\x3a\xb5\x10\x86\xa5\x0e\xb6\x78\x64\x3c\x12\x07\xb4\x39\x74\xd9\x6c\x56\x79\x86\xed\x0a\xaa\x18\xca\xe8\x6a\x82\xca\x90\xd5\x21\x39\x67\xc2\xc5\xaf\xa7\x45\xb5\x82\x18\xd9\x75\xd0\x60\x50\x68\x2f\xd5\xfa\x3e\xcf\x66\xb3\x3e\x9b\xf5\x59\xc4\x40\x4e\xc3\x00\xbb\x5c\x82\x6a\x83\xf8\x03\x04\x53\x3b\x94\x96\xe3\x5c\x18\x6a\xf6\x6d\xb3\xde\x9d\x20\x22\x12\xe3\x1d\xa4\x46\x7f\xd0\x67\x8a\x28\xc7\x2c\xe7\x8e\xcb\x12\xee\x05\x6a\x92\x00\xf2\xc5\x83\xc5\x1d\xd9\x00\x18\xa0\x41\xc6\x03\x09\x71\x28\xe0\x71\x1f\x7b\xe1\x20\xd0\xc6\xa5\x9d\xa7\xff\xb4\x09\x4f\x10\x84\x9a\x04\x28\x5a\x1a\x26\x6d\x14\x0a\xad\x52\x62\x74\x3a\x99\x03\x29\xef\x74\xdc\x3b\x3a\xf0\x4d\x44\x8b\x16\x1c\x1e\x68\x8c\x74\xf4\xaf\xbc\x84\x07\x58\x78\x4e\x3e\x8b\x42\x0c\x6d\xc0\x9a\xf2\x22\x9b\xc9\xa9\x21\xd8\xd4\x35\x53\x8d\x42\xa9\xf7\x45\x10\x36\xae\x5e\xc1\xf0\x9b\xc3\x68\xf8\x66\x47\xdf\x0c\xf6\x8d\x39\x61\x98\x4f\x36\x1e\x04\x59\x56\xb0\x7d\xb3\x48\xda\x35\x93\xb4\xec\xa0\x72\x97\x38\x72\x3a\x7f\xbd\xda\x37\x10\xc4\xc2\x53\x5a\x56\x6e\xca\xc9\xbb\xd6\xa9\x89\xf3\x8b\x91\xfd\x5d\x64\xdb\xf4\xcd\xdf\xa3\xf1\x55\x27\x11\xc5\xbb\x7a\x31\x55\x7a\x7b\x73\x03\xf3\xf9\x40\xe4\xf4\x09\xbf\x51\x85\xad\x95\xae\x4b\xc0\xfa\xfe\x21\x12\x67\xa0\xf0\xa5\x7f\x72\x7a\x05\xdb\x6d\xb1\x09\x43\xd5\x3c\xd2\xde\x54\x53\xb0\x7d\xff\xa7\xab\xbc\xd5\x8b\xbc\xf8\x0b\x6d\x4b\x61\x91\x4e\x26\xbd\x1c\xf2\x2e\xf2\xae\x03\xb2\x81\xa0\xef\x5f\x8c\x11\xe8\x83\x57\x68\x93\x37\x4d\x34\x96\xf9\xfe\x9c\xcb\xe5\x0b\xe9\x94\x77\x41\xd0\x49\xf8\xfa\x88\xf4\xd0\x0d\x1c\x13\x88\xe2\x9d\xb7\x94\x92\xbd\xb1\xa2\xd1\x97\xe8\x3e\xf1\x7e\x8a\xdf\xa3\xb7\x79\xae\xa3\x73\x87\x81\xe0\xaa\xb8\xf5\xae\x32\x75\xf1\x07\xaa\x67\xac\x87\x57\x65\xf9\xfd\x91\xc7\xab\x8a\x07\x74\xe9\x20\x1d\xf0\xd7\xb7\x35\x06\x00\x9e\x2f\x27\xca\xc5\x45\x37\x8a\x8b\x06\x84\xbd\x6f\xad\x86\x1d\x0d\x47\x8e\x43\xde\x20\xdc\x2a\x59\x0b\xd6\x29\x9f\x26\xe5\x75\x22\x8b\x67\x40\x38\x60\x03\xcf\x74\x4a\x2e\xe3\x84\x18\x07\x2d\x8a\x1b\x1e\x14\x3a\x51\x81\x74\xfc\x3f\x68\xbc\x0b\x74\x2e\xe7\x60\xd0\x3d\xf1\x11\xde\x3f\xad\x17\x3a\x8f\xa8\xef\xe1\x3a\x26\x3f\x78\x1e\x05\x34\x0a\x09\x1e\xbd\xd1\x71\x7f\x95\x35\x4a\x12\x84\x36\xd0\x20\x44\xb1\xc3\x38\xc1\x81\x05\x93\xaf\x17\xc6\x0c\xbc\x5a\xc1\x7c\x50\xd3\x6d\xac\x35\xcf\x9f\x12\x9a\x51\x42\x13\xec\xb3\xdc\x26\x30\x66\x82\xd3\x1f\x89\xd9\xc4\xff\x2f\x29\xb2\x59\xda\xfd\xff\xac\xe4\xe6\x75\x4f\x13\x4a\xfe\x17\x00\x00\xff\xff\xba\x39\xc3\xa2\x4f\x07\x00\x00") +var _templateDialectGremlinByTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x55\x41\x6f\xe3\x46\x0f\x3d\x5b\xbf\x82\x30\x72\xb0\x0c\x5b\xda\x2f\xb7\xaf\x40\x0e\x6e\xba\x01\x02\x04\xdb\x02\x9b\xb6\x47\x87\x9e\xa1\xe4\x41\xc6\x33\x2a\x87\xf2\xd6\x10\xf4\xdf\x8b\x19\xd9\xb2\x76\xb3\x6d\xf6\x64\x88\x1c\x92\xef\x91\x8f\x74\xd7\x95\xcb\xec\xde\x37\x27\x36\xf5\x5e\xe0\xf6\xc3\xff\xfe\xbf\x6e\x98\x02\x39\x81\x07\x54\xb4\xf3\xfe\x15\x1e\x9d\x2a\x60\x63\x2d\xa4\x47\x01\xa2\x9f\x8f\xa4\x8b\xec\x79\x6f\x02\x04\xdf\xb2\x22\x50\x5e\x13\x98\x00\xd6\x28\x72\x81\x34\xb4\x4e\x13\x83\xec\x09\x36\x0d\xaa\x3d\xc1\x6d\xf1\xe1\xe2\x85\xca\xb7\x4e\x67\xc6\x25\xff\xd3\xe3\xfd\xc7\x4f\x9f\x3f\x42\x65\x2c\xc1\xd9\xc6\xde\x0b\x68\xc3\xa4\xc4\xf3\x09\x7c\x05\x32\x29\x26\x4c\x54\x64\xcb\xb2\xef\xb3\xac\xeb\x40\x53\x65\x1c\xc1\x5c\x1b\xb4\xa4\xa4\xac\x99\x0e\xd6\xb8\xd2\xb3\x26\x9e\xc3\xba\xef\xb3\x59\xd7\xad\xe1\x26\x19\xe0\xa7\x3b\xb8\x29\x3e\x2b\xdf\x50\xf1\x6b\x32\xa4\x07\x55\xeb\xd4\x42\x18\x96\x3a\xd8\xe2\x99\xf1\x48\x1c\xd0\xe6\xd0\x65\xb3\x59\xe5\x19\xb6\x2b\xa8\x62\x28\xa3\xab\x09\x2a\x43\x56\x87\xe4\x9c\x09\x17\x3f\x9f\x16\xd5\x0a\x62\x64\xd7\x41\x83\x41\xa1\xbd\x54\xeb\xfb\x3c\x9b\xcd\xfa\x6c\xd6\x67\x11\x03\x39\x0d\x03\xec\x72\x09\xaa\x0d\xe2\x0f\x10\x4c\xed\x50\x5a\x8e\x7d\x61\xa8\xd9\xb7\xcd\x7a\x77\x82\x88\x48\x8c\x77\x90\x88\xfe\x07\xcf\x14\x51\x8e\x59\xce\x8c\xcb\x12\x1e\x05\x6a\x92\x00\xf2\xc5\x83\xc5\x1d\xd9\x00\x18\xa0\x41\xc6\x03\x09\x71\x28\xe0\x79\x1f\xb9\x70\x10\x68\xe3\xd0\xce\xdd\x7f\xd9\x84\x17\x08\x42\x4d\x02\x14\x2d\x0d\x93\x36\x0a\x85\x56\x29\x31\x3a\x9d\xcc\x81\x94\x77\x3a\xce\x1d\x1d\xf8\x26\xa2\x45\x0b\x0e\x0f\x34\x46\x3a\xfa\x5b\xae\xe1\x01\x16\x9e\x93\xcf\xa2\x10\x43\x1b\xb0\xa6\xbc\xc8\x66\x72\x6a\x08\x36\x75\xcd\x54\xa3\xd0\x43\xeb\x54\xe2\xbf\x08\xc2\xc6\xd5\x2b\x18\x7e\x73\x18\x0d\xdf\xcc\xe9\x9b\xe6\xbe\xd3\x2b\x0c\xf3\xc9\xd4\x83\x20\xcb\x0a\xb6\xef\x16\x49\xf3\x66\x92\x96\x1d\x54\xee\x12\x47\x4e\xe7\x6f\xc7\xfb\x0e\x82\x58\x78\x2a\xcd\xca\x4d\x75\x99\xf8\x5f\x9d\x5f\x8c\xec\x1f\xa2\xe2\xa6\x6f\xfe\x1c\x8d\x6f\x98\x44\x14\x3f\xc4\xc5\x54\xe9\xed\xdd\x1d\xcc\xe7\x83\x98\xd3\x27\xfc\x42\x15\xb6\x56\xba\x2e\x01\xeb\xfb\xa7\x28\x9e\x41\xc6\x17\xfe\xe4\xf4\x0a\xb6\xdb\x62\x13\x86\xaa\x79\x94\xbe\xa9\xa6\x60\xfb\xfe\x77\x57\x79\xab\x17\x79\xf1\x07\xda\x96\xc2\x22\xad\x4d\x7a\x39\xe4\x5d\xe4\x5d\x07\x64\x03\x41\xdf\x5f\x8d\x11\xe8\x93\x57\x68\x93\x37\x75\x34\x96\xf9\x7e\x9f\xcb\xe5\x55\x78\xca\xbb\x20\xe8\x24\x7c\xbd\x48\x7a\x60\x03\xc7\x04\xa2\xf8\xc1\x7d\x4a\xc9\xde\x19\xd1\xe8\x4b\x92\x9f\x78\x3f\xc5\xef\xd1\xdb\xbc\xd6\xd1\xb9\xc3\x40\x70\x53\xdc\x7b\x57\x99\xba\xf8\x0d\xd5\x2b\xd6\xc3\xab\xb2\xfc\x7e\xcb\xe3\x66\xc5\x25\xba\x30\x48\x4b\xfc\xf5\x7e\x8d\x01\x80\xe7\xed\x89\x27\xe3\x72\x3b\x8a\xcb\x1d\x08\x7b\xdf\x5a\x0d\x3b\x1a\x16\x1d\x87\xbc\x41\xb8\x55\xb2\x16\xac\x53\x3e\x4d\xca\xeb\x24\x16\xcf\x80\x70\xc0\x06\x5e\xe9\x94\x5c\xc6\x09\x31\x0e\xf7\x28\x4e\x78\xb8\xd2\x49\x0a\xa4\xe3\x7f\x42\xe3\x5d\xa0\x73\x39\x07\xc3\xed\x13\x1f\xe1\xfd\xd5\x7a\xa1\x73\x8b\xfa\x1e\x6e\x63\xf2\x83\xe7\xf1\x88\xc6\x63\x82\x47\x6f\x74\x9c\x5f\x65\x8d\x92\x04\xa1\x0d\x34\x1c\xa3\xc8\x30\x76\x70\x50\xc1\xe4\xeb\xaa\x98\x41\x57\x2b\x98\x0f\x17\x75\x1b\x6b\xcd\xf3\x97\x84\x66\x3c\xa3\x09\xf6\xf9\xe4\x26\x30\x66\x82\xd3\x1f\x89\xd9\xc4\xff\x30\x29\xb2\x59\x9a\xfd\xbf\x8c\xe4\xee\x2d\xa7\x89\x24\xff\x09\x00\x00\xff\xff\x60\x61\x69\xce\x53\x07\x00\x00") func templateDialectGremlinByTmplBytes() ([]byte, error) { return bindataRead( @@ -341,7 +341,7 @@ func templateDialectGremlinByTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/by.tmpl", size: 1871, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/by.tmpl", size: 1875, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -586,7 +586,7 @@ func templateDialectGremlinUpdateTmpl() (*asset, error) { return a, nil } -var _templateDialectSqlByTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x92\xcf\x8b\xdb\x3e\x10\xc5\xcf\xd6\x5f\xf1\x30\x7b\xb0\xc3\xc6\xde\xef\xde\xbe\x85\x1e\xd2\xb0\x81\x85\xfe\x38\xa4\xd0\x63\xf1\x4a\x23\x47\xd4\x95\x1c\x49\xde\x62\x84\xfe\xf7\x22\x79\x9b\xa6\x69\x1b\x7a\x33\x7a\x33\xf3\x79\xf3\xc6\x21\xb4\x2b\xb6\x35\xe3\x6c\x55\x7f\xf0\xb8\xbf\xfb\xef\xff\xf5\x68\xc9\x91\xf6\xd8\x75\x9c\x9e\x8c\xf9\x82\x47\xcd\x1b\x6c\x86\x01\xb9\xc8\x21\xe9\xf6\x99\x44\xc3\x3e\x1e\x94\x83\x33\x93\xe5\x04\x6e\x04\x41\x39\x0c\x8a\x93\x76\x24\x30\x69\x41\x16\xfe\x40\xd8\x8c\x1d\x3f\x10\xee\x9b\xbb\x1f\x2a\xa4\x99\xb4\x60\x4a\x67\xfd\xed\xe3\xf6\xe1\xfd\xfe\x01\x52\x0d\x84\x97\x37\x6b\x8c\x87\x50\x96\xb8\x37\x76\x86\x91\xf0\x67\x30\x6f\x89\x1a\xb6\x6a\x63\x64\x2c\x04\x08\x92\x4a\x13\x4a\xa1\xba\x81\xb8\x6f\xdd\x71\x68\x8d\x15\x64\x4b\xac\x63\x64\x45\x08\x6b\xdc\x48\xbc\x7a\x8d\x9b\x66\xcf\xcd\x48\xcd\x6e\xd2\x7c\xd1\xe4\xa4\x79\xe5\xb0\x72\xc7\xa1\xd9\xd3\x90\x79\x35\x02\x2b\x0a\x69\x2c\x3e\xdf\x22\xf7\xd9\x4e\xf7\x04\xa9\x68\x10\x2e\x8b\x85\x6b\x3e\x24\xc2\x9b\xb9\x4a\x9d\x21\x24\x40\x8c\x95\xac\x6b\x56\x14\x91\x15\x91\x25\x2a\x69\x81\xc5\x64\xbb\x02\x9f\x9c\x37\x5f\xe1\x54\xaf\x3b\x3f\xd9\x94\x82\x45\x6f\xcd\x34\xae\x9f\x66\x24\x23\x5e\x19\x8d\xbc\xd6\x5f\xb6\xca\xd5\xed\x69\xc2\xcb\x7e\x7e\x1e\x09\x9b\xbe\xb7\xd4\x77\x9e\xf2\xa4\xea\x62\x21\xe7\xad\xd2\xfd\x85\xa7\x2b\x88\xce\x95\xd7\xf2\x59\xc6\x2d\x49\x58\xf2\x93\xd5\x48\x05\x1b\x57\x49\x5d\xb9\xfa\x36\x41\xea\xdf\x43\xb8\x02\x4c\x9c\x5f\xce\xa5\xff\x7c\xaf\x2c\x7e\x53\xfe\xb0\x4b\xc7\x38\xaf\xf9\x74\x7a\xfc\x37\xe3\x67\xbe\x43\x80\x92\xa0\x63\xc6\x96\xef\xa8\xd3\x25\x62\xdc\x3c\xf7\x21\x80\x06\x47\x88\x31\x5f\x58\x2f\x1f\xcb\x42\xd5\xd2\x75\x66\x26\x46\xd7\x6c\xab\xfc\x97\xd4\x3f\x3b\xcb\x55\x79\xea\xb9\xc8\xe4\x7b\x00\x00\x00\xff\xff\xf9\x4d\xb3\x4d\x80\x03\x00\x00") +var _templateDialectSqlByTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x92\xcf\x8b\xdb\x3e\x10\xc5\xcf\xd6\x5f\xf1\x30\x7b\xb0\xc3\xc6\xde\xef\xde\xbe\x85\x1e\xd2\xb0\x81\x85\xfe\x38\xa4\xd0\x63\xf1\x4a\x23\x47\xd4\x95\x1c\x49\xde\x62\x84\xfe\xf7\x22\x79\x9b\xa6\x69\x1b\x7a\x33\x7a\x33\xf3\x79\x6f\xc6\x21\xb4\x2b\xb6\x35\xe3\x6c\x55\x7f\xf0\xb8\xbf\xfb\xef\xff\xf5\x68\xc9\x91\xf6\xd8\x75\x9c\x9e\x8c\xf9\x82\x47\xcd\x1b\x6c\x86\x01\xb9\xc8\x21\xe9\xf6\x99\x44\xc3\x3e\x1e\x94\x83\x33\x93\xe5\x04\x6e\x04\x41\x39\x0c\x8a\x93\x76\x24\x30\x69\x41\x16\xfe\x40\xd8\x8c\x1d\x3f\x10\xee\x9b\xbb\x1f\x2a\xa4\x99\xb4\x60\x4a\x67\xfd\xed\xe3\xf6\xe1\xfd\xfe\x01\x52\x0d\x84\x97\x37\x6b\x8c\x87\x50\x96\xb8\x37\x76\x86\x91\xf0\x67\x30\x6f\x89\x1a\xb6\x6a\x63\x64\x2c\x04\x08\x92\x4a\x13\x4a\xa1\xba\x81\xb8\x6f\xdd\x71\x68\x8d\x15\x64\x4b\xac\x63\x64\x45\x08\x6b\xdc\x48\xbc\x7a\x8d\x9b\x66\xcf\xcd\x48\xcd\x6e\xd2\x7c\xd1\xe4\xa4\x79\xe5\xb0\x72\xc7\xa1\xd9\xd3\x90\x79\x35\x02\x2b\x0a\x69\x2c\x3e\xdf\x22\xf7\xd9\x4e\xf7\x04\xa9\x68\x10\x2e\x8b\x85\x6b\x3e\x24\xc2\x9b\xb9\x4a\x9d\x21\x24\x40\x8c\x95\xac\x6b\x56\x14\x91\x15\x91\x25\x2a\x69\x81\xc5\x64\xbb\x02\x9f\x9c\x37\x5f\xe1\x54\xaf\x3b\x3f\xd9\xb4\x05\x8b\xde\x9a\x69\x5c\x3f\xcd\x48\x46\xbc\x32\x1a\x39\xd6\x5f\x52\xe5\xea\xf6\x34\xe1\x25\x9f\x9f\x47\xc2\xa6\xef\x2d\xf5\x9d\xa7\x9c\x2d\xc7\xba\x08\xe5\xbc\x55\xba\xbf\xf0\x75\x05\xd3\xb9\xf2\xda\x8e\x96\x71\xcb\x36\x2c\xf9\xc9\x6a\xa4\x82\x8d\xab\xa4\xae\x5c\x7d\x9b\x20\xf5\xef\x8b\xb8\x02\x4c\x9c\x5f\x4e\xa6\xff\x7c\xb3\x2c\x7e\x53\xfe\xb0\x4b\x07\x39\xaf\xf9\x74\x7a\xfc\x37\xe3\x67\xbe\x43\x80\x92\xa0\x63\xc6\x96\xef\xa8\xd3\x25\x62\xdc\x3c\xf7\x21\x80\x06\x47\x88\x31\x5f\x59\x2f\x1f\x4b\xa0\x6a\xe9\x3a\x33\x13\xa3\x6b\xb6\x55\xfe\x53\xea\x9f\x9d\xe5\xaa\x3c\xf5\x5c\xec\xe4\x7b\x00\x00\x00\xff\xff\x83\x86\x1e\x93\x84\x03\x00\x00") func templateDialectSqlByTmplBytes() ([]byte, error) { return bindataRead( @@ -601,7 +601,7 @@ func templateDialectSqlByTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/by.tmpl", size: 896, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/dialect/sql/by.tmpl", size: 900, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/base.tmpl b/entc/gen/template/base.tmpl index 8b822121f..3791ab5db 100644 --- a/entc/gen/template/base.tmpl +++ b/entc/gen/template/base.tmpl @@ -23,13 +23,13 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func({{ $.Storage.Builder }}) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func({{ $.Storage.Builder }}) {{ range $f, $order := order }} {{ $f = pascal $f }} // {{ $f }} applies the given fields in {{ upper $f }} order. - func {{ $f }}(fields ...string) Order { + func {{ $f }}(fields ...string) OrderFunc { {{- with extend (index $.Nodes 0) "Func" $f "Order" $order -}} {{ $tmpl := printf "dialect/%s/order" $.Storage }} return {{ xtemplate $tmpl . }} @@ -38,7 +38,7 @@ type Order func({{ $.Storage.Builder }}) {{ end }} {{ $tmpl := printf "dialect/%s/group/signature" $.Storage }} -// Aggregate applies an aggregation step on the group-by traversal/selector. +// AggregateFunc applies an aggregation step on the group-by traversal/selector. {{ xtemplate $tmpl . }} @@ -48,7 +48,7 @@ type Order func({{ $.Storage.Builder }}) // Aggregate({{ $pkg }}.As({{ $pkg }}.Sum(field1), "sum_field1"), ({{ $pkg }}.As({{ $pkg }}.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { {{- $tmpl = printf "dialect/%s/group/as" $.Storage }} return {{ xtemplate $tmpl . }} } @@ -63,7 +63,7 @@ func As(fn Aggregate, end string) Aggregate { {{ end }} // {{ $fn }} applies the {{ quote $name }} aggregation function on {{ if $withField }}the given field of {{ end }}each group. - func {{ $fn }}({{ if $withField }}field string{{ end }}) Aggregate { + func {{ $fn }}({{ if $withField }}field string{{ end }}) AggregateFunc { {{- with extend (index $.Nodes 0) "Func" $fn "WithField" $withField -}} {{ $tmpl := printf "dialect/%s/group/func" $.Storage }} return {{ xtemplate $tmpl . }} diff --git a/entc/gen/template/builder/query.tmpl b/entc/gen/template/builder/query.tmpl index 41521a2ca..4599a344d 100644 --- a/entc/gen/template/builder/query.tmpl +++ b/entc/gen/template/builder/query.tmpl @@ -26,7 +26,7 @@ type {{ $builder }} struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.{{ $.Name }} {{- with $.Edges }} @@ -64,7 +64,7 @@ func ({{ $receiver }} *{{ $builder }}) Offset(offset int) *{{ $builder }} { } // Order adds an order step to the query. -func ({{ $receiver }} *{{ $builder }}) Order(o ...Order) *{{ $builder }} { +func ({{ $receiver }} *{{ $builder }}) Order(o ...OrderFunc) *{{ $builder }} { {{ $receiver }}.order = append({{ $receiver }}.order, o...) return {{ $receiver }} } @@ -259,7 +259,7 @@ func ({{ $receiver }} *{{ $builder }}) Clone() *{{ $builder }} { config: {{ $receiver }}.config, limit: {{ $receiver }}.limit, offset: {{ $receiver }}.offset, - order: append([]Order{}, {{ $receiver }}.order...), + order: append([]OrderFunc{}, {{ $receiver }}.order...), unique: append([]string{}, {{ $receiver }}.unique...), predicates: append([]predicate.{{ $.Name }}{}, {{ $receiver }}.predicates...), // clone intermediate query. @@ -372,14 +372,14 @@ func ({{ $receiver }} *{{ $builder }}) prepareQuery(ctx context.Context) error { type {{ $groupBuilder }} struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). {{ $.Storage }} {{ $.Storage.Builder }} path func(context.Context) ({{ $.Storage.Builder }}, error) } // Aggregate adds the given aggregation functions to the group-by query. -func ({{ $groupReceiver }} *{{ $groupBuilder }}) Aggregate(fns ...Aggregate) *{{ $groupBuilder }} { +func ({{ $groupReceiver }} *{{ $groupBuilder }}) Aggregate(fns ...AggregateFunc) *{{ $groupBuilder }} { {{ $groupReceiver }}.fns = append({{ $groupReceiver }}.fns, fns...) return {{ $groupReceiver }} } diff --git a/entc/gen/template/dialect/gremlin/by.tmpl b/entc/gen/template/dialect/gremlin/by.tmpl index 1820c029f..ac7e12194 100644 --- a/entc/gen/template/dialect/gremlin/by.tmpl +++ b/entc/gen/template/dialect/gremlin/by.tmpl @@ -17,7 +17,7 @@ in the LICENSE file in the root directory of this source tree. {{ define "dialect/gremlin/group/signature" -}} // It gets two labels as parameters. The first used in the `As` step for the predicate, // and the second is an optional name for the next predicates (or for later usage). - type Aggregate func(string, string) (string, *dsl.Traversal) + type AggregateFunc func(string, string) (string, *dsl.Traversal) {{- end }} {{ define "dialect/gremlin/group/as" -}} diff --git a/entc/gen/template/dialect/sql/by.tmpl b/entc/gen/template/dialect/sql/by.tmpl index e87df501b..f7a80536f 100644 --- a/entc/gen/template/dialect/sql/by.tmpl +++ b/entc/gen/template/dialect/sql/by.tmpl @@ -15,7 +15,7 @@ in the LICENSE file in the root directory of this source tree. {{/* custom signature for group-by function */}} {{ define "dialect/sql/group/signature" -}} - type Aggregate func(*sql.Selector) string + type AggregateFunc func(*sql.Selector) string {{- end }} {{ define "dialect/sql/group/as" -}} diff --git a/entc/gen/type.go b/entc/gen/type.go index 28d2911e0..c6e64012d 100644 --- a/entc/gen/type.go +++ b/entc/gen/type.go @@ -918,7 +918,7 @@ func builderField(name string) string { // global identifiers used by the generated package. var globalIdent = names( - "Aggregate", + "AggregateFunc", "As", "Asc", "Count", @@ -932,7 +932,7 @@ var globalIdent = names( "Mutator", "Op", "Option", - "Order", + "OrderFunc", "Max", "Mean", "Min", diff --git a/entc/integration/config/ent/ent.go b/entc/integration/config/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/entc/integration/config/ent/ent.go +++ b/entc/integration/config/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/entc/integration/config/ent/user_query.go b/entc/integration/config/ent/user_query.go index 87c067458..47d852815 100644 --- a/entc/integration/config/ent/user_query.go +++ b/entc/integration/config/ent/user_query.go @@ -24,7 +24,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -226,7 +226,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -378,14 +378,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/entc/integration/customid/ent/blob_query.go b/entc/integration/customid/ent/blob_query.go index 62032ab4f..0b7a38b96 100644 --- a/entc/integration/customid/ent/blob_query.go +++ b/entc/integration/customid/ent/blob_query.go @@ -26,7 +26,7 @@ type BlobQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Blob // eager-loading edges. @@ -57,7 +57,7 @@ func (bq *BlobQuery) Offset(offset int) *BlobQuery { } // Order adds an order step to the query. -func (bq *BlobQuery) Order(o ...Order) *BlobQuery { +func (bq *BlobQuery) Order(o ...OrderFunc) *BlobQuery { bq.order = append(bq.order, o...) return bq } @@ -268,7 +268,7 @@ func (bq *BlobQuery) Clone() *BlobQuery { config: bq.config, limit: bq.limit, offset: bq.offset, - order: append([]Order{}, bq.order...), + order: append([]OrderFunc{}, bq.order...), unique: append([]string{}, bq.unique...), predicates: append([]predicate.Blob{}, bq.predicates...), // clone intermediate query. @@ -570,14 +570,14 @@ func (bq *BlobQuery) sqlQuery() *sql.Selector { type BlobGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (bgb *BlobGroupBy) Aggregate(fns ...Aggregate) *BlobGroupBy { +func (bgb *BlobGroupBy) Aggregate(fns ...AggregateFunc) *BlobGroupBy { bgb.fns = append(bgb.fns, fns...) return bgb } diff --git a/entc/integration/customid/ent/car_query.go b/entc/integration/customid/ent/car_query.go index c69b74362..2d17ca4fc 100644 --- a/entc/integration/customid/ent/car_query.go +++ b/entc/integration/customid/ent/car_query.go @@ -25,7 +25,7 @@ type CarQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Car // eager-loading edges. @@ -55,7 +55,7 @@ func (cq *CarQuery) Offset(offset int) *CarQuery { } // Order adds an order step to the query. -func (cq *CarQuery) Order(o ...Order) *CarQuery { +func (cq *CarQuery) Order(o ...OrderFunc) *CarQuery { cq.order = append(cq.order, o...) return cq } @@ -248,7 +248,7 @@ func (cq *CarQuery) Clone() *CarQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.Car{}, cq.predicates...), // clone intermediate query. @@ -475,14 +475,14 @@ func (cq *CarQuery) sqlQuery() *sql.Selector { type CarGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CarGroupBy) Aggregate(fns ...Aggregate) *CarGroupBy { +func (cgb *CarGroupBy) Aggregate(fns ...AggregateFunc) *CarGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/entc/integration/customid/ent/ent.go b/entc/integration/customid/ent/ent.go index 73b6169fc..1cbaafd53 100644 --- a/entc/integration/customid/ent/ent.go +++ b/entc/integration/customid/ent/ent.go @@ -31,11 +31,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -44,7 +44,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -52,8 +52,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -61,42 +61,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/entc/integration/customid/ent/group_query.go b/entc/integration/customid/ent/group_query.go index e338ce324..15160279f 100644 --- a/entc/integration/customid/ent/group_query.go +++ b/entc/integration/customid/ent/group_query.go @@ -26,7 +26,7 @@ type GroupQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Group // eager-loading edges. @@ -55,7 +55,7 @@ func (gq *GroupQuery) Offset(offset int) *GroupQuery { } // Order adds an order step to the query. -func (gq *GroupQuery) Order(o ...Order) *GroupQuery { +func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery { gq.order = append(gq.order, o...) return gq } @@ -248,7 +248,7 @@ func (gq *GroupQuery) Clone() *GroupQuery { config: gq.config, limit: gq.limit, offset: gq.offset, - order: append([]Order{}, gq.order...), + order: append([]OrderFunc{}, gq.order...), unique: append([]string{}, gq.unique...), predicates: append([]predicate.Group{}, gq.predicates...), // clone intermediate query. @@ -479,14 +479,14 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { type GroupGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ggb *GroupGroupBy) Aggregate(fns ...Aggregate) *GroupGroupBy { +func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy { ggb.fns = append(ggb.fns, fns...) return ggb } diff --git a/entc/integration/customid/ent/pet_query.go b/entc/integration/customid/ent/pet_query.go index 22602e275..fbe53e944 100644 --- a/entc/integration/customid/ent/pet_query.go +++ b/entc/integration/customid/ent/pet_query.go @@ -27,7 +27,7 @@ type PetQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Pet // eager-loading edges. @@ -60,7 +60,7 @@ func (pq *PetQuery) Offset(offset int) *PetQuery { } // Order adds an order step to the query. -func (pq *PetQuery) Order(o ...Order) *PetQuery { +func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery { pq.order = append(pq.order, o...) return pq } @@ -307,7 +307,7 @@ func (pq *PetQuery) Clone() *PetQuery { config: pq.config, limit: pq.limit, offset: pq.offset, - order: append([]Order{}, pq.order...), + order: append([]OrderFunc{}, pq.order...), unique: append([]string{}, pq.unique...), predicates: append([]predicate.Pet{}, pq.predicates...), // clone intermediate query. @@ -662,14 +662,14 @@ func (pq *PetQuery) sqlQuery() *sql.Selector { type PetGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (pgb *PetGroupBy) Aggregate(fns ...Aggregate) *PetGroupBy { +func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy { pgb.fns = append(pgb.fns, fns...) return pgb } diff --git a/entc/integration/customid/ent/user_query.go b/entc/integration/customid/ent/user_query.go index 4b641f011..3873708ba 100644 --- a/entc/integration/customid/ent/user_query.go +++ b/entc/integration/customid/ent/user_query.go @@ -27,7 +27,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -60,7 +60,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -307,7 +307,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -665,14 +665,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/entc/integration/ent/card_query.go b/entc/integration/ent/card_query.go index 116885498..9d89ca369 100644 --- a/entc/integration/ent/card_query.go +++ b/entc/integration/ent/card_query.go @@ -27,7 +27,7 @@ type CardQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Card // eager-loading edges. @@ -58,7 +58,7 @@ func (cq *CardQuery) Offset(offset int) *CardQuery { } // Order adds an order step to the query. -func (cq *CardQuery) Order(o ...Order) *CardQuery { +func (cq *CardQuery) Order(o ...OrderFunc) *CardQuery { cq.order = append(cq.order, o...) return cq } @@ -269,7 +269,7 @@ func (cq *CardQuery) Clone() *CardQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.Card{}, cq.predicates...), // clone intermediate query. @@ -571,14 +571,14 @@ func (cq *CardQuery) sqlQuery() *sql.Selector { type CardGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CardGroupBy) Aggregate(fns ...Aggregate) *CardGroupBy { +func (cgb *CardGroupBy) Aggregate(fns ...AggregateFunc) *CardGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/entc/integration/ent/comment_query.go b/entc/integration/ent/comment_query.go index ffe478353..cfafdbcbb 100644 --- a/entc/integration/ent/comment_query.go +++ b/entc/integration/ent/comment_query.go @@ -24,7 +24,7 @@ type CommentQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Comment // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (cq *CommentQuery) Offset(offset int) *CommentQuery { } // Order adds an order step to the query. -func (cq *CommentQuery) Order(o ...Order) *CommentQuery { +func (cq *CommentQuery) Order(o ...OrderFunc) *CommentQuery { cq.order = append(cq.order, o...) return cq } @@ -226,7 +226,7 @@ func (cq *CommentQuery) Clone() *CommentQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.Comment{}, cq.predicates...), // clone intermediate query. @@ -402,14 +402,14 @@ func (cq *CommentQuery) sqlQuery() *sql.Selector { type CommentGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CommentGroupBy) Aggregate(fns ...Aggregate) *CommentGroupBy { +func (cgb *CommentGroupBy) Aggregate(fns ...AggregateFunc) *CommentGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/entc/integration/ent/ent.go b/entc/integration/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/entc/integration/ent/ent.go +++ b/entc/integration/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/entc/integration/ent/fieldtype_query.go b/entc/integration/ent/fieldtype_query.go index 1a39f696e..83b3a7ab4 100644 --- a/entc/integration/ent/fieldtype_query.go +++ b/entc/integration/ent/fieldtype_query.go @@ -24,7 +24,7 @@ type FieldTypeQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.FieldType // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (ftq *FieldTypeQuery) Offset(offset int) *FieldTypeQuery { } // Order adds an order step to the query. -func (ftq *FieldTypeQuery) Order(o ...Order) *FieldTypeQuery { +func (ftq *FieldTypeQuery) Order(o ...OrderFunc) *FieldTypeQuery { ftq.order = append(ftq.order, o...) return ftq } @@ -226,7 +226,7 @@ func (ftq *FieldTypeQuery) Clone() *FieldTypeQuery { config: ftq.config, limit: ftq.limit, offset: ftq.offset, - order: append([]Order{}, ftq.order...), + order: append([]OrderFunc{}, ftq.order...), unique: append([]string{}, ftq.unique...), predicates: append([]predicate.FieldType{}, ftq.predicates...), // clone intermediate query. @@ -402,14 +402,14 @@ func (ftq *FieldTypeQuery) sqlQuery() *sql.Selector { type FieldTypeGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ftgb *FieldTypeGroupBy) Aggregate(fns ...Aggregate) *FieldTypeGroupBy { +func (ftgb *FieldTypeGroupBy) Aggregate(fns ...AggregateFunc) *FieldTypeGroupBy { ftgb.fns = append(ftgb.fns, fns...) return ftgb } diff --git a/entc/integration/ent/file_query.go b/entc/integration/ent/file_query.go index 5386e940a..220d9f586 100644 --- a/entc/integration/ent/file_query.go +++ b/entc/integration/ent/file_query.go @@ -26,7 +26,7 @@ type FileQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.File // eager-loading edges. @@ -57,7 +57,7 @@ func (fq *FileQuery) Offset(offset int) *FileQuery { } // Order adds an order step to the query. -func (fq *FileQuery) Order(o ...Order) *FileQuery { +func (fq *FileQuery) Order(o ...OrderFunc) *FileQuery { fq.order = append(fq.order, o...) return fq } @@ -268,7 +268,7 @@ func (fq *FileQuery) Clone() *FileQuery { config: fq.config, limit: fq.limit, offset: fq.offset, - order: append([]Order{}, fq.order...), + order: append([]OrderFunc{}, fq.order...), unique: append([]string{}, fq.unique...), predicates: append([]predicate.File{}, fq.predicates...), // clone intermediate query. @@ -532,14 +532,14 @@ func (fq *FileQuery) sqlQuery() *sql.Selector { type FileGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (fgb *FileGroupBy) Aggregate(fns ...Aggregate) *FileGroupBy { +func (fgb *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy { fgb.fns = append(fgb.fns, fns...) return fgb } diff --git a/entc/integration/ent/filetype_query.go b/entc/integration/ent/filetype_query.go index 3508e5665..ca3de2f36 100644 --- a/entc/integration/ent/filetype_query.go +++ b/entc/integration/ent/filetype_query.go @@ -26,7 +26,7 @@ type FileTypeQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.FileType // eager-loading edges. @@ -55,7 +55,7 @@ func (ftq *FileTypeQuery) Offset(offset int) *FileTypeQuery { } // Order adds an order step to the query. -func (ftq *FileTypeQuery) Order(o ...Order) *FileTypeQuery { +func (ftq *FileTypeQuery) Order(o ...OrderFunc) *FileTypeQuery { ftq.order = append(ftq.order, o...) return ftq } @@ -248,7 +248,7 @@ func (ftq *FileTypeQuery) Clone() *FileTypeQuery { config: ftq.config, limit: ftq.limit, offset: ftq.offset, - order: append([]Order{}, ftq.order...), + order: append([]OrderFunc{}, ftq.order...), unique: append([]string{}, ftq.unique...), predicates: append([]predicate.FileType{}, ftq.predicates...), // clone intermediate query. @@ -468,14 +468,14 @@ func (ftq *FileTypeQuery) sqlQuery() *sql.Selector { type FileTypeGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ftgb *FileTypeGroupBy) Aggregate(fns ...Aggregate) *FileTypeGroupBy { +func (ftgb *FileTypeGroupBy) Aggregate(fns ...AggregateFunc) *FileTypeGroupBy { ftgb.fns = append(ftgb.fns, fns...) return ftgb } diff --git a/entc/integration/ent/group_query.go b/entc/integration/ent/group_query.go index 4fe8f3221..34cdd0f7a 100644 --- a/entc/integration/ent/group_query.go +++ b/entc/integration/ent/group_query.go @@ -28,7 +28,7 @@ type GroupQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Group // eager-loading edges. @@ -61,7 +61,7 @@ func (gq *GroupQuery) Offset(offset int) *GroupQuery { } // Order adds an order step to the query. -func (gq *GroupQuery) Order(o ...Order) *GroupQuery { +func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery { gq.order = append(gq.order, o...) return gq } @@ -308,7 +308,7 @@ func (gq *GroupQuery) Clone() *GroupQuery { config: gq.config, limit: gq.limit, offset: gq.offset, - order: append([]Order{}, gq.order...), + order: append([]OrderFunc{}, gq.order...), unique: append([]string{}, gq.unique...), predicates: append([]predicate.Group{}, gq.predicates...), // clone intermediate query. @@ -690,14 +690,14 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { type GroupGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ggb *GroupGroupBy) Aggregate(fns ...Aggregate) *GroupGroupBy { +func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy { ggb.fns = append(ggb.fns, fns...) return ggb } diff --git a/entc/integration/ent/groupinfo_query.go b/entc/integration/ent/groupinfo_query.go index 65a109052..31f50de0a 100644 --- a/entc/integration/ent/groupinfo_query.go +++ b/entc/integration/ent/groupinfo_query.go @@ -26,7 +26,7 @@ type GroupInfoQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.GroupInfo // eager-loading edges. @@ -55,7 +55,7 @@ func (giq *GroupInfoQuery) Offset(offset int) *GroupInfoQuery { } // Order adds an order step to the query. -func (giq *GroupInfoQuery) Order(o ...Order) *GroupInfoQuery { +func (giq *GroupInfoQuery) Order(o ...OrderFunc) *GroupInfoQuery { giq.order = append(giq.order, o...) return giq } @@ -248,7 +248,7 @@ func (giq *GroupInfoQuery) Clone() *GroupInfoQuery { config: giq.config, limit: giq.limit, offset: giq.offset, - order: append([]Order{}, giq.order...), + order: append([]OrderFunc{}, giq.order...), unique: append([]string{}, giq.unique...), predicates: append([]predicate.GroupInfo{}, giq.predicates...), // clone intermediate query. @@ -468,14 +468,14 @@ func (giq *GroupInfoQuery) sqlQuery() *sql.Selector { type GroupInfoGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (gigb *GroupInfoGroupBy) Aggregate(fns ...Aggregate) *GroupInfoGroupBy { +func (gigb *GroupInfoGroupBy) Aggregate(fns ...AggregateFunc) *GroupInfoGroupBy { gigb.fns = append(gigb.fns, fns...) return gigb } diff --git a/entc/integration/ent/item_query.go b/entc/integration/ent/item_query.go index f849d72ba..94634444e 100644 --- a/entc/integration/ent/item_query.go +++ b/entc/integration/ent/item_query.go @@ -24,7 +24,7 @@ type ItemQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Item // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (iq *ItemQuery) Offset(offset int) *ItemQuery { } // Order adds an order step to the query. -func (iq *ItemQuery) Order(o ...Order) *ItemQuery { +func (iq *ItemQuery) Order(o ...OrderFunc) *ItemQuery { iq.order = append(iq.order, o...) return iq } @@ -226,7 +226,7 @@ func (iq *ItemQuery) Clone() *ItemQuery { config: iq.config, limit: iq.limit, offset: iq.offset, - order: append([]Order{}, iq.order...), + order: append([]OrderFunc{}, iq.order...), unique: append([]string{}, iq.unique...), predicates: append([]predicate.Item{}, iq.predicates...), // clone intermediate query. @@ -378,14 +378,14 @@ func (iq *ItemQuery) sqlQuery() *sql.Selector { type ItemGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (igb *ItemGroupBy) Aggregate(fns ...Aggregate) *ItemGroupBy { +func (igb *ItemGroupBy) Aggregate(fns ...AggregateFunc) *ItemGroupBy { igb.fns = append(igb.fns, fns...) return igb } diff --git a/entc/integration/ent/node_query.go b/entc/integration/ent/node_query.go index 1d0e12805..11b9be3a5 100644 --- a/entc/integration/ent/node_query.go +++ b/entc/integration/ent/node_query.go @@ -25,7 +25,7 @@ type NodeQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Node // eager-loading edges. @@ -56,7 +56,7 @@ func (nq *NodeQuery) Offset(offset int) *NodeQuery { } // Order adds an order step to the query. -func (nq *NodeQuery) Order(o ...Order) *NodeQuery { +func (nq *NodeQuery) Order(o ...OrderFunc) *NodeQuery { nq.order = append(nq.order, o...) return nq } @@ -267,7 +267,7 @@ func (nq *NodeQuery) Clone() *NodeQuery { config: nq.config, limit: nq.limit, offset: nq.offset, - order: append([]Order{}, nq.order...), + order: append([]OrderFunc{}, nq.order...), unique: append([]string{}, nq.unique...), predicates: append([]predicate.Node{}, nq.predicates...), // clone intermediate query. @@ -534,14 +534,14 @@ func (nq *NodeQuery) sqlQuery() *sql.Selector { type NodeGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ngb *NodeGroupBy) Aggregate(fns ...Aggregate) *NodeGroupBy { +func (ngb *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy { ngb.fns = append(ngb.fns, fns...) return ngb } diff --git a/entc/integration/ent/pet_query.go b/entc/integration/ent/pet_query.go index 78a9b5919..f06525d98 100644 --- a/entc/integration/ent/pet_query.go +++ b/entc/integration/ent/pet_query.go @@ -25,7 +25,7 @@ type PetQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Pet // eager-loading edges. @@ -56,7 +56,7 @@ func (pq *PetQuery) Offset(offset int) *PetQuery { } // Order adds an order step to the query. -func (pq *PetQuery) Order(o ...Order) *PetQuery { +func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery { pq.order = append(pq.order, o...) return pq } @@ -267,7 +267,7 @@ func (pq *PetQuery) Clone() *PetQuery { config: pq.config, limit: pq.limit, offset: pq.offset, - order: append([]Order{}, pq.order...), + order: append([]OrderFunc{}, pq.order...), unique: append([]string{}, pq.unique...), predicates: append([]predicate.Pet{}, pq.predicates...), // clone intermediate query. @@ -531,14 +531,14 @@ func (pq *PetQuery) sqlQuery() *sql.Selector { type PetGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (pgb *PetGroupBy) Aggregate(fns ...Aggregate) *PetGroupBy { +func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy { pgb.fns = append(pgb.fns, fns...) return pgb } diff --git a/entc/integration/ent/spec_query.go b/entc/integration/ent/spec_query.go index 979297907..316984083 100644 --- a/entc/integration/ent/spec_query.go +++ b/entc/integration/ent/spec_query.go @@ -26,7 +26,7 @@ type SpecQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Spec // eager-loading edges. @@ -55,7 +55,7 @@ func (sq *SpecQuery) Offset(offset int) *SpecQuery { } // Order adds an order step to the query. -func (sq *SpecQuery) Order(o ...Order) *SpecQuery { +func (sq *SpecQuery) Order(o ...OrderFunc) *SpecQuery { sq.order = append(sq.order, o...) return sq } @@ -248,7 +248,7 @@ func (sq *SpecQuery) Clone() *SpecQuery { config: sq.config, limit: sq.limit, offset: sq.offset, - order: append([]Order{}, sq.order...), + order: append([]OrderFunc{}, sq.order...), unique: append([]string{}, sq.unique...), predicates: append([]predicate.Spec{}, sq.predicates...), // clone intermediate query. @@ -479,14 +479,14 @@ func (sq *SpecQuery) sqlQuery() *sql.Selector { type SpecGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (sgb *SpecGroupBy) Aggregate(fns ...Aggregate) *SpecGroupBy { +func (sgb *SpecGroupBy) Aggregate(fns ...AggregateFunc) *SpecGroupBy { sgb.fns = append(sgb.fns, fns...) return sgb } diff --git a/entc/integration/ent/user_query.go b/entc/integration/ent/user_query.go index 1fd65e20e..731162487 100644 --- a/entc/integration/ent/user_query.go +++ b/entc/integration/ent/user_query.go @@ -29,7 +29,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -69,7 +69,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -442,7 +442,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -1206,14 +1206,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/entc/integration/gremlin/ent/card_query.go b/entc/integration/gremlin/ent/card_query.go index a73e6b2db..36589320b 100644 --- a/entc/integration/gremlin/ent/card_query.go +++ b/entc/integration/gremlin/ent/card_query.go @@ -26,7 +26,7 @@ type CardQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Card // eager-loading edges. @@ -56,7 +56,7 @@ func (cq *CardQuery) Offset(offset int) *CardQuery { } // Order adds an order step to the query. -func (cq *CardQuery) Order(o ...Order) *CardQuery { +func (cq *CardQuery) Order(o ...OrderFunc) *CardQuery { cq.order = append(cq.order, o...) return cq } @@ -259,7 +259,7 @@ func (cq *CardQuery) Clone() *CardQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.Card{}, cq.predicates...), // clone intermediate query. @@ -416,14 +416,14 @@ func (cq *CardQuery) gremlinQuery() *dsl.Traversal { type CardGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CardGroupBy) Aggregate(fns ...Aggregate) *CardGroupBy { +func (cgb *CardGroupBy) Aggregate(fns ...AggregateFunc) *CardGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/entc/integration/gremlin/ent/comment_query.go b/entc/integration/gremlin/ent/comment_query.go index d7f032e96..440f49e89 100644 --- a/entc/integration/gremlin/ent/comment_query.go +++ b/entc/integration/gremlin/ent/comment_query.go @@ -24,7 +24,7 @@ type CommentQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Comment // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (cq *CommentQuery) Offset(offset int) *CommentQuery { } // Order adds an order step to the query. -func (cq *CommentQuery) Order(o ...Order) *CommentQuery { +func (cq *CommentQuery) Order(o ...OrderFunc) *CommentQuery { cq.order = append(cq.order, o...) return cq } @@ -226,7 +226,7 @@ func (cq *CommentQuery) Clone() *CommentQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.Comment{}, cq.predicates...), // clone intermediate query. @@ -361,14 +361,14 @@ func (cq *CommentQuery) gremlinQuery() *dsl.Traversal { type CommentGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CommentGroupBy) Aggregate(fns ...Aggregate) *CommentGroupBy { +func (cgb *CommentGroupBy) Aggregate(fns ...AggregateFunc) *CommentGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/entc/integration/gremlin/ent/ent.go b/entc/integration/gremlin/ent/ent.go index deef1cf2e..fc706ef2f 100644 --- a/entc/integration/gremlin/ent/ent.go +++ b/entc/integration/gremlin/ent/ent.go @@ -31,11 +31,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*dsl.Traversal) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*dsl.Traversal) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(tr *dsl.Traversal) { for _, f := range fields { tr.By(f, dsl.Incr) @@ -44,7 +44,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(tr *dsl.Traversal) { for _, f := range fields { tr.By(f, dsl.Decr) @@ -52,10 +52,10 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. +// AggregateFunc applies an aggregation step on the group-by traversal/selector. // It gets two labels as parameters. The first used in the `As` step for the predicate, // and the second is an optional name for the next predicates (or for later usage). -type Aggregate func(string, string) (string, *dsl.Traversal) +type AggregateFunc func(string, string) (string, *dsl.Traversal) // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -63,7 +63,7 @@ type Aggregate func(string, string) (string, *dsl.Traversal) // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(start, _ string) (string, *dsl.Traversal) { return fn(start, end) } @@ -76,7 +76,7 @@ func As(fn Aggregate, end string) Aggregate { const DefaultCountLabel = "count" // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(start, end string) (string, *dsl.Traversal) { if end == "" { end = DefaultCountLabel @@ -92,7 +92,7 @@ func Count() Aggregate { const DefaultMaxLabel = "max" // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(start, end string) (string, *dsl.Traversal) { if end == "" { end = DefaultMaxLabel @@ -108,7 +108,7 @@ func Max(field string) Aggregate { const DefaultMeanLabel = "mean" // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(start, end string) (string, *dsl.Traversal) { if end == "" { end = DefaultMeanLabel @@ -124,7 +124,7 @@ func Mean(field string) Aggregate { const DefaultMinLabel = "min" // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(start, end string) (string, *dsl.Traversal) { if end == "" { end = DefaultMinLabel @@ -140,7 +140,7 @@ func Min(field string) Aggregate { const DefaultSumLabel = "sum" // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(start, end string) (string, *dsl.Traversal) { if end == "" { end = DefaultSumLabel diff --git a/entc/integration/gremlin/ent/fieldtype_query.go b/entc/integration/gremlin/ent/fieldtype_query.go index 5f19f4a3a..ce7c605c6 100644 --- a/entc/integration/gremlin/ent/fieldtype_query.go +++ b/entc/integration/gremlin/ent/fieldtype_query.go @@ -24,7 +24,7 @@ type FieldTypeQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.FieldType // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (ftq *FieldTypeQuery) Offset(offset int) *FieldTypeQuery { } // Order adds an order step to the query. -func (ftq *FieldTypeQuery) Order(o ...Order) *FieldTypeQuery { +func (ftq *FieldTypeQuery) Order(o ...OrderFunc) *FieldTypeQuery { ftq.order = append(ftq.order, o...) return ftq } @@ -226,7 +226,7 @@ func (ftq *FieldTypeQuery) Clone() *FieldTypeQuery { config: ftq.config, limit: ftq.limit, offset: ftq.offset, - order: append([]Order{}, ftq.order...), + order: append([]OrderFunc{}, ftq.order...), unique: append([]string{}, ftq.unique...), predicates: append([]predicate.FieldType{}, ftq.predicates...), // clone intermediate query. @@ -361,14 +361,14 @@ func (ftq *FieldTypeQuery) gremlinQuery() *dsl.Traversal { type FieldTypeGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ftgb *FieldTypeGroupBy) Aggregate(fns ...Aggregate) *FieldTypeGroupBy { +func (ftgb *FieldTypeGroupBy) Aggregate(fns ...AggregateFunc) *FieldTypeGroupBy { ftgb.fns = append(ftgb.fns, fns...) return ftgb } diff --git a/entc/integration/gremlin/ent/file_query.go b/entc/integration/gremlin/ent/file_query.go index a04ef1bff..e960f6db4 100644 --- a/entc/integration/gremlin/ent/file_query.go +++ b/entc/integration/gremlin/ent/file_query.go @@ -26,7 +26,7 @@ type FileQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.File // eager-loading edges. @@ -56,7 +56,7 @@ func (fq *FileQuery) Offset(offset int) *FileQuery { } // Order adds an order step to the query. -func (fq *FileQuery) Order(o ...Order) *FileQuery { +func (fq *FileQuery) Order(o ...OrderFunc) *FileQuery { fq.order = append(fq.order, o...) return fq } @@ -259,7 +259,7 @@ func (fq *FileQuery) Clone() *FileQuery { config: fq.config, limit: fq.limit, offset: fq.offset, - order: append([]Order{}, fq.order...), + order: append([]OrderFunc{}, fq.order...), unique: append([]string{}, fq.unique...), predicates: append([]predicate.File{}, fq.predicates...), // clone intermediate query. @@ -416,14 +416,14 @@ func (fq *FileQuery) gremlinQuery() *dsl.Traversal { type FileGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (fgb *FileGroupBy) Aggregate(fns ...Aggregate) *FileGroupBy { +func (fgb *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy { fgb.fns = append(fgb.fns, fns...) return fgb } diff --git a/entc/integration/gremlin/ent/filetype_query.go b/entc/integration/gremlin/ent/filetype_query.go index 05693b443..7309bcc83 100644 --- a/entc/integration/gremlin/ent/filetype_query.go +++ b/entc/integration/gremlin/ent/filetype_query.go @@ -24,7 +24,7 @@ type FileTypeQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.FileType // eager-loading edges. @@ -53,7 +53,7 @@ func (ftq *FileTypeQuery) Offset(offset int) *FileTypeQuery { } // Order adds an order step to the query. -func (ftq *FileTypeQuery) Order(o ...Order) *FileTypeQuery { +func (ftq *FileTypeQuery) Order(o ...OrderFunc) *FileTypeQuery { ftq.order = append(ftq.order, o...) return ftq } @@ -242,7 +242,7 @@ func (ftq *FileTypeQuery) Clone() *FileTypeQuery { config: ftq.config, limit: ftq.limit, offset: ftq.offset, - order: append([]Order{}, ftq.order...), + order: append([]OrderFunc{}, ftq.order...), unique: append([]string{}, ftq.unique...), predicates: append([]predicate.FileType{}, ftq.predicates...), // clone intermediate query. @@ -388,14 +388,14 @@ func (ftq *FileTypeQuery) gremlinQuery() *dsl.Traversal { type FileTypeGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ftgb *FileTypeGroupBy) Aggregate(fns ...Aggregate) *FileTypeGroupBy { +func (ftgb *FileTypeGroupBy) Aggregate(fns ...AggregateFunc) *FileTypeGroupBy { ftgb.fns = append(ftgb.fns, fns...) return ftgb } diff --git a/entc/integration/gremlin/ent/group_query.go b/entc/integration/gremlin/ent/group_query.go index 7adaef725..4c3bbff4f 100644 --- a/entc/integration/gremlin/ent/group_query.go +++ b/entc/integration/gremlin/ent/group_query.go @@ -25,7 +25,7 @@ type GroupQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Group // eager-loading edges. @@ -57,7 +57,7 @@ func (gq *GroupQuery) Offset(offset int) *GroupQuery { } // Order adds an order step to the query. -func (gq *GroupQuery) Order(o ...Order) *GroupQuery { +func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery { gq.order = append(gq.order, o...) return gq } @@ -288,7 +288,7 @@ func (gq *GroupQuery) Clone() *GroupQuery { config: gq.config, limit: gq.limit, offset: gq.offset, - order: append([]Order{}, gq.order...), + order: append([]OrderFunc{}, gq.order...), unique: append([]string{}, gq.unique...), predicates: append([]predicate.Group{}, gq.predicates...), // clone intermediate query. @@ -467,14 +467,14 @@ func (gq *GroupQuery) gremlinQuery() *dsl.Traversal { type GroupGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ggb *GroupGroupBy) Aggregate(fns ...Aggregate) *GroupGroupBy { +func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy { ggb.fns = append(ggb.fns, fns...) return ggb } diff --git a/entc/integration/gremlin/ent/groupinfo_query.go b/entc/integration/gremlin/ent/groupinfo_query.go index edc9aecc8..0b9933230 100644 --- a/entc/integration/gremlin/ent/groupinfo_query.go +++ b/entc/integration/gremlin/ent/groupinfo_query.go @@ -25,7 +25,7 @@ type GroupInfoQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.GroupInfo // eager-loading edges. @@ -54,7 +54,7 @@ func (giq *GroupInfoQuery) Offset(offset int) *GroupInfoQuery { } // Order adds an order step to the query. -func (giq *GroupInfoQuery) Order(o ...Order) *GroupInfoQuery { +func (giq *GroupInfoQuery) Order(o ...OrderFunc) *GroupInfoQuery { giq.order = append(giq.order, o...) return giq } @@ -243,7 +243,7 @@ func (giq *GroupInfoQuery) Clone() *GroupInfoQuery { config: giq.config, limit: giq.limit, offset: giq.offset, - order: append([]Order{}, giq.order...), + order: append([]OrderFunc{}, giq.order...), unique: append([]string{}, giq.unique...), predicates: append([]predicate.GroupInfo{}, giq.predicates...), // clone intermediate query. @@ -389,14 +389,14 @@ func (giq *GroupInfoQuery) gremlinQuery() *dsl.Traversal { type GroupInfoGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (gigb *GroupInfoGroupBy) Aggregate(fns ...Aggregate) *GroupInfoGroupBy { +func (gigb *GroupInfoGroupBy) Aggregate(fns ...AggregateFunc) *GroupInfoGroupBy { gigb.fns = append(gigb.fns, fns...) return gigb } diff --git a/entc/integration/gremlin/ent/item_query.go b/entc/integration/gremlin/ent/item_query.go index de067419c..3d212837e 100644 --- a/entc/integration/gremlin/ent/item_query.go +++ b/entc/integration/gremlin/ent/item_query.go @@ -24,7 +24,7 @@ type ItemQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Item // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (iq *ItemQuery) Offset(offset int) *ItemQuery { } // Order adds an order step to the query. -func (iq *ItemQuery) Order(o ...Order) *ItemQuery { +func (iq *ItemQuery) Order(o ...OrderFunc) *ItemQuery { iq.order = append(iq.order, o...) return iq } @@ -226,7 +226,7 @@ func (iq *ItemQuery) Clone() *ItemQuery { config: iq.config, limit: iq.limit, offset: iq.offset, - order: append([]Order{}, iq.order...), + order: append([]OrderFunc{}, iq.order...), unique: append([]string{}, iq.unique...), predicates: append([]predicate.Item{}, iq.predicates...), // clone intermediate query. @@ -337,14 +337,14 @@ func (iq *ItemQuery) gremlinQuery() *dsl.Traversal { type ItemGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (igb *ItemGroupBy) Aggregate(fns ...Aggregate) *ItemGroupBy { +func (igb *ItemGroupBy) Aggregate(fns ...AggregateFunc) *ItemGroupBy { igb.fns = append(igb.fns, fns...) return igb } diff --git a/entc/integration/gremlin/ent/node_query.go b/entc/integration/gremlin/ent/node_query.go index 8ad8d9619..fd8032f1f 100644 --- a/entc/integration/gremlin/ent/node_query.go +++ b/entc/integration/gremlin/ent/node_query.go @@ -24,7 +24,7 @@ type NodeQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Node // eager-loading edges. @@ -54,7 +54,7 @@ func (nq *NodeQuery) Offset(offset int) *NodeQuery { } // Order adds an order step to the query. -func (nq *NodeQuery) Order(o ...Order) *NodeQuery { +func (nq *NodeQuery) Order(o ...OrderFunc) *NodeQuery { nq.order = append(nq.order, o...) return nq } @@ -257,7 +257,7 @@ func (nq *NodeQuery) Clone() *NodeQuery { config: nq.config, limit: nq.limit, offset: nq.offset, - order: append([]Order{}, nq.order...), + order: append([]OrderFunc{}, nq.order...), unique: append([]string{}, nq.unique...), predicates: append([]predicate.Node{}, nq.predicates...), // clone intermediate query. @@ -414,14 +414,14 @@ func (nq *NodeQuery) gremlinQuery() *dsl.Traversal { type NodeGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ngb *NodeGroupBy) Aggregate(fns ...Aggregate) *NodeGroupBy { +func (ngb *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy { ngb.fns = append(ngb.fns, fns...) return ngb } diff --git a/entc/integration/gremlin/ent/pet_query.go b/entc/integration/gremlin/ent/pet_query.go index ab6266aaf..a3fb76de7 100644 --- a/entc/integration/gremlin/ent/pet_query.go +++ b/entc/integration/gremlin/ent/pet_query.go @@ -25,7 +25,7 @@ type PetQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Pet // eager-loading edges. @@ -55,7 +55,7 @@ func (pq *PetQuery) Offset(offset int) *PetQuery { } // Order adds an order step to the query. -func (pq *PetQuery) Order(o ...Order) *PetQuery { +func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery { pq.order = append(pq.order, o...) return pq } @@ -258,7 +258,7 @@ func (pq *PetQuery) Clone() *PetQuery { config: pq.config, limit: pq.limit, offset: pq.offset, - order: append([]Order{}, pq.order...), + order: append([]OrderFunc{}, pq.order...), unique: append([]string{}, pq.unique...), predicates: append([]predicate.Pet{}, pq.predicates...), // clone intermediate query. @@ -415,14 +415,14 @@ func (pq *PetQuery) gremlinQuery() *dsl.Traversal { type PetGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (pgb *PetGroupBy) Aggregate(fns ...Aggregate) *PetGroupBy { +func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy { pgb.fns = append(pgb.fns, fns...) return pgb } diff --git a/entc/integration/gremlin/ent/spec_query.go b/entc/integration/gremlin/ent/spec_query.go index b3ada9d40..842a256ca 100644 --- a/entc/integration/gremlin/ent/spec_query.go +++ b/entc/integration/gremlin/ent/spec_query.go @@ -24,7 +24,7 @@ type SpecQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Spec // eager-loading edges. @@ -53,7 +53,7 @@ func (sq *SpecQuery) Offset(offset int) *SpecQuery { } // Order adds an order step to the query. -func (sq *SpecQuery) Order(o ...Order) *SpecQuery { +func (sq *SpecQuery) Order(o ...OrderFunc) *SpecQuery { sq.order = append(sq.order, o...) return sq } @@ -242,7 +242,7 @@ func (sq *SpecQuery) Clone() *SpecQuery { config: sq.config, limit: sq.limit, offset: sq.offset, - order: append([]Order{}, sq.order...), + order: append([]OrderFunc{}, sq.order...), unique: append([]string{}, sq.unique...), predicates: append([]predicate.Spec{}, sq.predicates...), // clone intermediate query. @@ -364,14 +364,14 @@ func (sq *SpecQuery) gremlinQuery() *dsl.Traversal { type SpecGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (sgb *SpecGroupBy) Aggregate(fns ...Aggregate) *SpecGroupBy { +func (sgb *SpecGroupBy) Aggregate(fns ...AggregateFunc) *SpecGroupBy { sgb.fns = append(sgb.fns, fns...) return sgb } diff --git a/entc/integration/gremlin/ent/user_query.go b/entc/integration/gremlin/ent/user_query.go index 86e8d63c2..bae7ffb71 100644 --- a/entc/integration/gremlin/ent/user_query.go +++ b/entc/integration/gremlin/ent/user_query.go @@ -24,7 +24,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -63,7 +63,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -392,7 +392,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -648,14 +648,14 @@ func (uq *UserQuery) gremlinQuery() *dsl.Traversal { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). gremlin *dsl.Traversal path func(context.Context) (*dsl.Traversal, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/entc/integration/hooks/ent/card_query.go b/entc/integration/hooks/ent/card_query.go index cc2d363ec..879de7047 100644 --- a/entc/integration/hooks/ent/card_query.go +++ b/entc/integration/hooks/ent/card_query.go @@ -25,7 +25,7 @@ type CardQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Card // eager-loading edges. @@ -55,7 +55,7 @@ func (cq *CardQuery) Offset(offset int) *CardQuery { } // Order adds an order step to the query. -func (cq *CardQuery) Order(o ...Order) *CardQuery { +func (cq *CardQuery) Order(o ...OrderFunc) *CardQuery { cq.order = append(cq.order, o...) return cq } @@ -248,7 +248,7 @@ func (cq *CardQuery) Clone() *CardQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.Card{}, cq.predicates...), // clone intermediate query. @@ -475,14 +475,14 @@ func (cq *CardQuery) sqlQuery() *sql.Selector { type CardGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CardGroupBy) Aggregate(fns ...Aggregate) *CardGroupBy { +func (cgb *CardGroupBy) Aggregate(fns ...AggregateFunc) *CardGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/entc/integration/hooks/ent/ent.go b/entc/integration/hooks/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/entc/integration/hooks/ent/ent.go +++ b/entc/integration/hooks/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/entc/integration/hooks/ent/user_query.go b/entc/integration/hooks/ent/user_query.go index 082b491ca..e1331a6d0 100644 --- a/entc/integration/hooks/ent/user_query.go +++ b/entc/integration/hooks/ent/user_query.go @@ -26,7 +26,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -58,7 +58,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -287,7 +287,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -629,14 +629,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/entc/integration/idtype/ent/ent.go b/entc/integration/idtype/ent/ent.go index 420b33866..104d4e151 100644 --- a/entc/integration/idtype/ent/ent.go +++ b/entc/integration/idtype/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/entc/integration/idtype/ent/user_query.go b/entc/integration/idtype/ent/user_query.go index 32310ff5f..011c3a870 100644 --- a/entc/integration/idtype/ent/user_query.go +++ b/entc/integration/idtype/ent/user_query.go @@ -25,7 +25,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -57,7 +57,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -286,7 +286,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -663,14 +663,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/entc/integration/json/ent/ent.go b/entc/integration/json/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/entc/integration/json/ent/ent.go +++ b/entc/integration/json/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/entc/integration/json/ent/user_query.go b/entc/integration/json/ent/user_query.go index dc9c785ea..45782e50a 100644 --- a/entc/integration/json/ent/user_query.go +++ b/entc/integration/json/ent/user_query.go @@ -24,7 +24,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -226,7 +226,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -402,14 +402,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/entc/integration/migrate/entv1/car_query.go b/entc/integration/migrate/entv1/car_query.go index da28d3482..9a3f796b5 100644 --- a/entc/integration/migrate/entv1/car_query.go +++ b/entc/integration/migrate/entv1/car_query.go @@ -25,7 +25,7 @@ type CarQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Car // eager-loading edges. @@ -55,7 +55,7 @@ func (cq *CarQuery) Offset(offset int) *CarQuery { } // Order adds an order step to the query. -func (cq *CarQuery) Order(o ...Order) *CarQuery { +func (cq *CarQuery) Order(o ...OrderFunc) *CarQuery { cq.order = append(cq.order, o...) return cq } @@ -248,7 +248,7 @@ func (cq *CarQuery) Clone() *CarQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.Car{}, cq.predicates...), // clone intermediate query. @@ -451,14 +451,14 @@ func (cq *CarQuery) sqlQuery() *sql.Selector { type CarGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CarGroupBy) Aggregate(fns ...Aggregate) *CarGroupBy { +func (cgb *CarGroupBy) Aggregate(fns ...AggregateFunc) *CarGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/entc/integration/migrate/entv1/ent.go b/entc/integration/migrate/entv1/ent.go index ee3712502..4502fa3c6 100644 --- a/entc/integration/migrate/entv1/ent.go +++ b/entc/integration/migrate/entv1/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(entv1.As(entv1.Sum(field1), "sum_field1"), (entv1.As(entv1.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/entc/integration/migrate/entv1/user_query.go b/entc/integration/migrate/entv1/user_query.go index 55e3fdf8e..c5b94481a 100644 --- a/entc/integration/migrate/entv1/user_query.go +++ b/entc/integration/migrate/entv1/user_query.go @@ -26,7 +26,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -59,7 +59,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -306,7 +306,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -650,14 +650,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/entc/integration/migrate/entv2/car_query.go b/entc/integration/migrate/entv2/car_query.go index fc12776c8..41050dd16 100644 --- a/entc/integration/migrate/entv2/car_query.go +++ b/entc/integration/migrate/entv2/car_query.go @@ -25,7 +25,7 @@ type CarQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Car // eager-loading edges. @@ -55,7 +55,7 @@ func (cq *CarQuery) Offset(offset int) *CarQuery { } // Order adds an order step to the query. -func (cq *CarQuery) Order(o ...Order) *CarQuery { +func (cq *CarQuery) Order(o ...OrderFunc) *CarQuery { cq.order = append(cq.order, o...) return cq } @@ -248,7 +248,7 @@ func (cq *CarQuery) Clone() *CarQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.Car{}, cq.predicates...), // clone intermediate query. @@ -451,14 +451,14 @@ func (cq *CarQuery) sqlQuery() *sql.Selector { type CarGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CarGroupBy) Aggregate(fns ...Aggregate) *CarGroupBy { +func (cgb *CarGroupBy) Aggregate(fns ...AggregateFunc) *CarGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/entc/integration/migrate/entv2/ent.go b/entc/integration/migrate/entv2/ent.go index c37a24284..a8e4ca189 100644 --- a/entc/integration/migrate/entv2/ent.go +++ b/entc/integration/migrate/entv2/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(entv2.As(entv2.Sum(field1), "sum_field1"), (entv2.As(entv2.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/entc/integration/migrate/entv2/group_query.go b/entc/integration/migrate/entv2/group_query.go index d7c856257..e50dd0873 100644 --- a/entc/integration/migrate/entv2/group_query.go +++ b/entc/integration/migrate/entv2/group_query.go @@ -24,7 +24,7 @@ type GroupQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Group // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (gq *GroupQuery) Offset(offset int) *GroupQuery { } // Order adds an order step to the query. -func (gq *GroupQuery) Order(o ...Order) *GroupQuery { +func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery { gq.order = append(gq.order, o...) return gq } @@ -226,7 +226,7 @@ func (gq *GroupQuery) Clone() *GroupQuery { config: gq.config, limit: gq.limit, offset: gq.offset, - order: append([]Order{}, gq.order...), + order: append([]OrderFunc{}, gq.order...), unique: append([]string{}, gq.unique...), predicates: append([]predicate.Group{}, gq.predicates...), // clone intermediate query. @@ -378,14 +378,14 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { type GroupGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ggb *GroupGroupBy) Aggregate(fns ...Aggregate) *GroupGroupBy { +func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy { ggb.fns = append(ggb.fns, fns...) return ggb } diff --git a/entc/integration/migrate/entv2/pet_query.go b/entc/integration/migrate/entv2/pet_query.go index f595a3740..1c7414b62 100644 --- a/entc/integration/migrate/entv2/pet_query.go +++ b/entc/integration/migrate/entv2/pet_query.go @@ -24,7 +24,7 @@ type PetQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Pet // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (pq *PetQuery) Offset(offset int) *PetQuery { } // Order adds an order step to the query. -func (pq *PetQuery) Order(o ...Order) *PetQuery { +func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery { pq.order = append(pq.order, o...) return pq } @@ -226,7 +226,7 @@ func (pq *PetQuery) Clone() *PetQuery { config: pq.config, limit: pq.limit, offset: pq.offset, - order: append([]Order{}, pq.order...), + order: append([]OrderFunc{}, pq.order...), unique: append([]string{}, pq.unique...), predicates: append([]predicate.Pet{}, pq.predicates...), // clone intermediate query. @@ -378,14 +378,14 @@ func (pq *PetQuery) sqlQuery() *sql.Selector { type PetGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (pgb *PetGroupBy) Aggregate(fns ...Aggregate) *PetGroupBy { +func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy { pgb.fns = append(pgb.fns, fns...) return pgb } diff --git a/entc/integration/migrate/entv2/user_query.go b/entc/integration/migrate/entv2/user_query.go index fa69a034f..008250d04 100644 --- a/entc/integration/migrate/entv2/user_query.go +++ b/entc/integration/migrate/entv2/user_query.go @@ -27,7 +27,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -58,7 +58,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -269,7 +269,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -536,14 +536,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/entc/integration/privacy/ent/ent.go b/entc/integration/privacy/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/entc/integration/privacy/ent/ent.go +++ b/entc/integration/privacy/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/entc/integration/privacy/ent/galaxy_query.go b/entc/integration/privacy/ent/galaxy_query.go index 8c133951d..fdf256d27 100644 --- a/entc/integration/privacy/ent/galaxy_query.go +++ b/entc/integration/privacy/ent/galaxy_query.go @@ -26,7 +26,7 @@ type GalaxyQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Galaxy // eager-loading edges. @@ -55,7 +55,7 @@ func (gq *GalaxyQuery) Offset(offset int) *GalaxyQuery { } // Order adds an order step to the query. -func (gq *GalaxyQuery) Order(o ...Order) *GalaxyQuery { +func (gq *GalaxyQuery) Order(o ...OrderFunc) *GalaxyQuery { gq.order = append(gq.order, o...) return gq } @@ -248,7 +248,7 @@ func (gq *GalaxyQuery) Clone() *GalaxyQuery { config: gq.config, limit: gq.limit, offset: gq.offset, - order: append([]Order{}, gq.order...), + order: append([]OrderFunc{}, gq.order...), unique: append([]string{}, gq.unique...), predicates: append([]predicate.Galaxy{}, gq.predicates...), // clone intermediate query. @@ -471,14 +471,14 @@ func (gq *GalaxyQuery) sqlQuery() *sql.Selector { type GalaxyGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ggb *GalaxyGroupBy) Aggregate(fns ...Aggregate) *GalaxyGroupBy { +func (ggb *GalaxyGroupBy) Aggregate(fns ...AggregateFunc) *GalaxyGroupBy { ggb.fns = append(ggb.fns, fns...) return ggb } diff --git a/entc/integration/privacy/ent/planet_query.go b/entc/integration/privacy/ent/planet_query.go index 25e44ba8d..8c486f717 100644 --- a/entc/integration/privacy/ent/planet_query.go +++ b/entc/integration/privacy/ent/planet_query.go @@ -25,7 +25,7 @@ type PlanetQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Planet // eager-loading edges. @@ -55,7 +55,7 @@ func (pq *PlanetQuery) Offset(offset int) *PlanetQuery { } // Order adds an order step to the query. -func (pq *PlanetQuery) Order(o ...Order) *PlanetQuery { +func (pq *PlanetQuery) Order(o ...OrderFunc) *PlanetQuery { pq.order = append(pq.order, o...) return pq } @@ -248,7 +248,7 @@ func (pq *PlanetQuery) Clone() *PlanetQuery { config: pq.config, limit: pq.limit, offset: pq.offset, - order: append([]Order{}, pq.order...), + order: append([]OrderFunc{}, pq.order...), unique: append([]string{}, pq.unique...), predicates: append([]predicate.Planet{}, pq.predicates...), // clone intermediate query. @@ -513,14 +513,14 @@ func (pq *PlanetQuery) sqlQuery() *sql.Selector { type PlanetGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (pgb *PlanetGroupBy) Aggregate(fns ...Aggregate) *PlanetGroupBy { +func (pgb *PlanetGroupBy) Aggregate(fns ...AggregateFunc) *PlanetGroupBy { pgb.fns = append(pgb.fns, fns...) return pgb } diff --git a/entc/integration/template/ent/ent.go b/entc/integration/template/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/entc/integration/template/ent/ent.go +++ b/entc/integration/template/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/entc/integration/template/ent/group_query.go b/entc/integration/template/ent/group_query.go index ead49e796..fa17e89dd 100644 --- a/entc/integration/template/ent/group_query.go +++ b/entc/integration/template/ent/group_query.go @@ -24,7 +24,7 @@ type GroupQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Group // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (gq *GroupQuery) Offset(offset int) *GroupQuery { } // Order adds an order step to the query. -func (gq *GroupQuery) Order(o ...Order) *GroupQuery { +func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery { gq.order = append(gq.order, o...) return gq } @@ -226,7 +226,7 @@ func (gq *GroupQuery) Clone() *GroupQuery { config: gq.config, limit: gq.limit, offset: gq.offset, - order: append([]Order{}, gq.order...), + order: append([]OrderFunc{}, gq.order...), unique: append([]string{}, gq.unique...), predicates: append([]predicate.Group{}, gq.predicates...), // clone intermediate query. @@ -402,14 +402,14 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { type GroupGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ggb *GroupGroupBy) Aggregate(fns ...Aggregate) *GroupGroupBy { +func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy { ggb.fns = append(ggb.fns, fns...) return ggb } diff --git a/entc/integration/template/ent/pet_query.go b/entc/integration/template/ent/pet_query.go index 3755d6ab6..743786379 100644 --- a/entc/integration/template/ent/pet_query.go +++ b/entc/integration/template/ent/pet_query.go @@ -25,7 +25,7 @@ type PetQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Pet // eager-loading edges. @@ -55,7 +55,7 @@ func (pq *PetQuery) Offset(offset int) *PetQuery { } // Order adds an order step to the query. -func (pq *PetQuery) Order(o ...Order) *PetQuery { +func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery { pq.order = append(pq.order, o...) return pq } @@ -248,7 +248,7 @@ func (pq *PetQuery) Clone() *PetQuery { config: pq.config, limit: pq.limit, offset: pq.offset, - order: append([]Order{}, pq.order...), + order: append([]OrderFunc{}, pq.order...), unique: append([]string{}, pq.unique...), predicates: append([]predicate.Pet{}, pq.predicates...), // clone intermediate query. @@ -475,14 +475,14 @@ func (pq *PetQuery) sqlQuery() *sql.Selector { type PetGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (pgb *PetGroupBy) Aggregate(fns ...Aggregate) *PetGroupBy { +func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy { pgb.fns = append(pgb.fns, fns...) return pgb } diff --git a/entc/integration/template/ent/user_query.go b/entc/integration/template/ent/user_query.go index fdc0988ea..b76328fbd 100644 --- a/entc/integration/template/ent/user_query.go +++ b/entc/integration/template/ent/user_query.go @@ -26,7 +26,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -56,7 +56,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -267,7 +267,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -562,14 +562,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/examples/edgeindex/ent/city_query.go b/examples/edgeindex/ent/city_query.go index fd6c02383..f172eefcd 100644 --- a/examples/edgeindex/ent/city_query.go +++ b/examples/edgeindex/ent/city_query.go @@ -26,7 +26,7 @@ type CityQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.City // eager-loading edges. @@ -55,7 +55,7 @@ func (cq *CityQuery) Offset(offset int) *CityQuery { } // Order adds an order step to the query. -func (cq *CityQuery) Order(o ...Order) *CityQuery { +func (cq *CityQuery) Order(o ...OrderFunc) *CityQuery { cq.order = append(cq.order, o...) return cq } @@ -248,7 +248,7 @@ func (cq *CityQuery) Clone() *CityQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.City{}, cq.predicates...), // clone intermediate query. @@ -468,14 +468,14 @@ func (cq *CityQuery) sqlQuery() *sql.Selector { type CityGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CityGroupBy) Aggregate(fns ...Aggregate) *CityGroupBy { +func (cgb *CityGroupBy) Aggregate(fns ...AggregateFunc) *CityGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/examples/edgeindex/ent/ent.go b/examples/edgeindex/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/edgeindex/ent/ent.go +++ b/examples/edgeindex/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/edgeindex/ent/street_query.go b/examples/edgeindex/ent/street_query.go index fbd81ebc7..7bae2d383 100644 --- a/examples/edgeindex/ent/street_query.go +++ b/examples/edgeindex/ent/street_query.go @@ -25,7 +25,7 @@ type StreetQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Street // eager-loading edges. @@ -55,7 +55,7 @@ func (sq *StreetQuery) Offset(offset int) *StreetQuery { } // Order adds an order step to the query. -func (sq *StreetQuery) Order(o ...Order) *StreetQuery { +func (sq *StreetQuery) Order(o ...OrderFunc) *StreetQuery { sq.order = append(sq.order, o...) return sq } @@ -248,7 +248,7 @@ func (sq *StreetQuery) Clone() *StreetQuery { config: sq.config, limit: sq.limit, offset: sq.offset, - order: append([]Order{}, sq.order...), + order: append([]OrderFunc{}, sq.order...), unique: append([]string{}, sq.unique...), predicates: append([]predicate.Street{}, sq.predicates...), // clone intermediate query. @@ -475,14 +475,14 @@ func (sq *StreetQuery) sqlQuery() *sql.Selector { type StreetGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (sgb *StreetGroupBy) Aggregate(fns ...Aggregate) *StreetGroupBy { +func (sgb *StreetGroupBy) Aggregate(fns ...AggregateFunc) *StreetGroupBy { sgb.fns = append(sgb.fns, fns...) return sgb } diff --git a/examples/entcpkg/ent/ent.go b/examples/entcpkg/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/entcpkg/ent/ent.go +++ b/examples/entcpkg/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/entcpkg/ent/user_query.go b/examples/entcpkg/ent/user_query.go index be0fa9779..4bc3d66cf 100644 --- a/examples/entcpkg/ent/user_query.go +++ b/examples/entcpkg/ent/user_query.go @@ -24,7 +24,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // intermediate query (i.e. traversal path). @@ -51,7 +51,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -226,7 +226,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -378,14 +378,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/examples/m2m2types/ent/ent.go b/examples/m2m2types/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/m2m2types/ent/ent.go +++ b/examples/m2m2types/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/m2m2types/ent/group_query.go b/examples/m2m2types/ent/group_query.go index c3364f2de..66197a991 100644 --- a/examples/m2m2types/ent/group_query.go +++ b/examples/m2m2types/ent/group_query.go @@ -26,7 +26,7 @@ type GroupQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Group // eager-loading edges. @@ -55,7 +55,7 @@ func (gq *GroupQuery) Offset(offset int) *GroupQuery { } // Order adds an order step to the query. -func (gq *GroupQuery) Order(o ...Order) *GroupQuery { +func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery { gq.order = append(gq.order, o...) return gq } @@ -248,7 +248,7 @@ func (gq *GroupQuery) Clone() *GroupQuery { config: gq.config, limit: gq.limit, offset: gq.offset, - order: append([]Order{}, gq.order...), + order: append([]OrderFunc{}, gq.order...), unique: append([]string{}, gq.unique...), predicates: append([]predicate.Group{}, gq.predicates...), // clone intermediate query. @@ -503,14 +503,14 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { type GroupGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ggb *GroupGroupBy) Aggregate(fns ...Aggregate) *GroupGroupBy { +func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy { ggb.fns = append(ggb.fns, fns...) return ggb } diff --git a/examples/m2m2types/ent/user_query.go b/examples/m2m2types/ent/user_query.go index bb66a1997..d7c2130d5 100644 --- a/examples/m2m2types/ent/user_query.go +++ b/examples/m2m2types/ent/user_query.go @@ -26,7 +26,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -55,7 +55,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -248,7 +248,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -503,14 +503,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/examples/m2mbidi/ent/ent.go b/examples/m2mbidi/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/m2mbidi/ent/ent.go +++ b/examples/m2mbidi/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/m2mbidi/ent/user_query.go b/examples/m2mbidi/ent/user_query.go index 852e53a22..d6e6717d9 100644 --- a/examples/m2mbidi/ent/user_query.go +++ b/examples/m2mbidi/ent/user_query.go @@ -25,7 +25,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -54,7 +54,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -247,7 +247,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -502,14 +502,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/examples/m2mrecur/ent/ent.go b/examples/m2mrecur/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/m2mrecur/ent/ent.go +++ b/examples/m2mrecur/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/m2mrecur/ent/user_query.go b/examples/m2mrecur/ent/user_query.go index 1e126d30d..068730b53 100644 --- a/examples/m2mrecur/ent/user_query.go +++ b/examples/m2mrecur/ent/user_query.go @@ -25,7 +25,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -55,7 +55,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -266,7 +266,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -596,14 +596,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/examples/o2m2types/ent/ent.go b/examples/o2m2types/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/o2m2types/ent/ent.go +++ b/examples/o2m2types/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/o2m2types/ent/pet_query.go b/examples/o2m2types/ent/pet_query.go index 969aa4171..64dd718ab 100644 --- a/examples/o2m2types/ent/pet_query.go +++ b/examples/o2m2types/ent/pet_query.go @@ -25,7 +25,7 @@ type PetQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Pet // eager-loading edges. @@ -55,7 +55,7 @@ func (pq *PetQuery) Offset(offset int) *PetQuery { } // Order adds an order step to the query. -func (pq *PetQuery) Order(o ...Order) *PetQuery { +func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery { pq.order = append(pq.order, o...) return pq } @@ -248,7 +248,7 @@ func (pq *PetQuery) Clone() *PetQuery { config: pq.config, limit: pq.limit, offset: pq.offset, - order: append([]Order{}, pq.order...), + order: append([]OrderFunc{}, pq.order...), unique: append([]string{}, pq.unique...), predicates: append([]predicate.Pet{}, pq.predicates...), // clone intermediate query. @@ -475,14 +475,14 @@ func (pq *PetQuery) sqlQuery() *sql.Selector { type PetGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (pgb *PetGroupBy) Aggregate(fns ...Aggregate) *PetGroupBy { +func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy { pgb.fns = append(pgb.fns, fns...) return pgb } diff --git a/examples/o2m2types/ent/user_query.go b/examples/o2m2types/ent/user_query.go index 9e4e12e30..62a596407 100644 --- a/examples/o2m2types/ent/user_query.go +++ b/examples/o2m2types/ent/user_query.go @@ -26,7 +26,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -55,7 +55,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -248,7 +248,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -468,14 +468,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/examples/o2mrecur/ent/ent.go b/examples/o2mrecur/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/o2mrecur/ent/ent.go +++ b/examples/o2mrecur/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/o2mrecur/ent/node_query.go b/examples/o2mrecur/ent/node_query.go index 0761b91f6..b0fd0cbba 100644 --- a/examples/o2mrecur/ent/node_query.go +++ b/examples/o2mrecur/ent/node_query.go @@ -25,7 +25,7 @@ type NodeQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Node // eager-loading edges. @@ -56,7 +56,7 @@ func (nq *NodeQuery) Offset(offset int) *NodeQuery { } // Order adds an order step to the query. -func (nq *NodeQuery) Order(o ...Order) *NodeQuery { +func (nq *NodeQuery) Order(o ...OrderFunc) *NodeQuery { nq.order = append(nq.order, o...) return nq } @@ -267,7 +267,7 @@ func (nq *NodeQuery) Clone() *NodeQuery { config: nq.config, limit: nq.limit, offset: nq.offset, - order: append([]Order{}, nq.order...), + order: append([]OrderFunc{}, nq.order...), unique: append([]string{}, nq.unique...), predicates: append([]predicate.Node{}, nq.predicates...), // clone intermediate query. @@ -534,14 +534,14 @@ func (nq *NodeQuery) sqlQuery() *sql.Selector { type NodeGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ngb *NodeGroupBy) Aggregate(fns ...Aggregate) *NodeGroupBy { +func (ngb *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy { ngb.fns = append(ngb.fns, fns...) return ngb } diff --git a/examples/o2o2types/ent/card_query.go b/examples/o2o2types/ent/card_query.go index f17336b8d..d279a1527 100644 --- a/examples/o2o2types/ent/card_query.go +++ b/examples/o2o2types/ent/card_query.go @@ -25,7 +25,7 @@ type CardQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Card // eager-loading edges. @@ -55,7 +55,7 @@ func (cq *CardQuery) Offset(offset int) *CardQuery { } // Order adds an order step to the query. -func (cq *CardQuery) Order(o ...Order) *CardQuery { +func (cq *CardQuery) Order(o ...OrderFunc) *CardQuery { cq.order = append(cq.order, o...) return cq } @@ -248,7 +248,7 @@ func (cq *CardQuery) Clone() *CardQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.Card{}, cq.predicates...), // clone intermediate query. @@ -475,14 +475,14 @@ func (cq *CardQuery) sqlQuery() *sql.Selector { type CardGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CardGroupBy) Aggregate(fns ...Aggregate) *CardGroupBy { +func (cgb *CardGroupBy) Aggregate(fns ...AggregateFunc) *CardGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/examples/o2o2types/ent/ent.go b/examples/o2o2types/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/o2o2types/ent/ent.go +++ b/examples/o2o2types/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/o2o2types/ent/user_query.go b/examples/o2o2types/ent/user_query.go index 56da32b8f..a80a7704d 100644 --- a/examples/o2o2types/ent/user_query.go +++ b/examples/o2o2types/ent/user_query.go @@ -26,7 +26,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -55,7 +55,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -248,7 +248,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -468,14 +468,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/examples/o2obidi/ent/ent.go b/examples/o2obidi/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/o2obidi/ent/ent.go +++ b/examples/o2obidi/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/o2obidi/ent/user_query.go b/examples/o2obidi/ent/user_query.go index 71725f959..e509ca904 100644 --- a/examples/o2obidi/ent/user_query.go +++ b/examples/o2obidi/ent/user_query.go @@ -24,7 +24,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -54,7 +54,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -247,7 +247,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -474,14 +474,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/examples/o2orecur/ent/ent.go b/examples/o2orecur/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/o2orecur/ent/ent.go +++ b/examples/o2orecur/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/o2orecur/ent/node_query.go b/examples/o2orecur/ent/node_query.go index e789cc3b1..19cd7a5d9 100644 --- a/examples/o2orecur/ent/node_query.go +++ b/examples/o2orecur/ent/node_query.go @@ -25,7 +25,7 @@ type NodeQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Node // eager-loading edges. @@ -56,7 +56,7 @@ func (nq *NodeQuery) Offset(offset int) *NodeQuery { } // Order adds an order step to the query. -func (nq *NodeQuery) Order(o ...Order) *NodeQuery { +func (nq *NodeQuery) Order(o ...OrderFunc) *NodeQuery { nq.order = append(nq.order, o...) return nq } @@ -267,7 +267,7 @@ func (nq *NodeQuery) Clone() *NodeQuery { config: nq.config, limit: nq.limit, offset: nq.offset, - order: append([]Order{}, nq.order...), + order: append([]OrderFunc{}, nq.order...), unique: append([]string{}, nq.unique...), predicates: append([]predicate.Node{}, nq.predicates...), // clone intermediate query. @@ -534,14 +534,14 @@ func (nq *NodeQuery) sqlQuery() *sql.Selector { type NodeGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ngb *NodeGroupBy) Aggregate(fns ...Aggregate) *NodeGroupBy { +func (ngb *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy { ngb.fns = append(ngb.fns, fns...) return ngb } diff --git a/examples/start/ent/car_query.go b/examples/start/ent/car_query.go index 246b1dea7..27fdeb3df 100644 --- a/examples/start/ent/car_query.go +++ b/examples/start/ent/car_query.go @@ -25,7 +25,7 @@ type CarQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Car // eager-loading edges. @@ -55,7 +55,7 @@ func (cq *CarQuery) Offset(offset int) *CarQuery { } // Order adds an order step to the query. -func (cq *CarQuery) Order(o ...Order) *CarQuery { +func (cq *CarQuery) Order(o ...OrderFunc) *CarQuery { cq.order = append(cq.order, o...) return cq } @@ -248,7 +248,7 @@ func (cq *CarQuery) Clone() *CarQuery { config: cq.config, limit: cq.limit, offset: cq.offset, - order: append([]Order{}, cq.order...), + order: append([]OrderFunc{}, cq.order...), unique: append([]string{}, cq.unique...), predicates: append([]predicate.Car{}, cq.predicates...), // clone intermediate query. @@ -475,14 +475,14 @@ func (cq *CarQuery) sqlQuery() *sql.Selector { type CarGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (cgb *CarGroupBy) Aggregate(fns ...Aggregate) *CarGroupBy { +func (cgb *CarGroupBy) Aggregate(fns ...AggregateFunc) *CarGroupBy { cgb.fns = append(cgb.fns, fns...) return cgb } diff --git a/examples/start/ent/ent.go b/examples/start/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/start/ent/ent.go +++ b/examples/start/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/start/ent/group_query.go b/examples/start/ent/group_query.go index 075eaf537..cd2622d55 100644 --- a/examples/start/ent/group_query.go +++ b/examples/start/ent/group_query.go @@ -26,7 +26,7 @@ type GroupQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Group // eager-loading edges. @@ -55,7 +55,7 @@ func (gq *GroupQuery) Offset(offset int) *GroupQuery { } // Order adds an order step to the query. -func (gq *GroupQuery) Order(o ...Order) *GroupQuery { +func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery { gq.order = append(gq.order, o...) return gq } @@ -248,7 +248,7 @@ func (gq *GroupQuery) Clone() *GroupQuery { config: gq.config, limit: gq.limit, offset: gq.offset, - order: append([]Order{}, gq.order...), + order: append([]OrderFunc{}, gq.order...), unique: append([]string{}, gq.unique...), predicates: append([]predicate.Group{}, gq.predicates...), // clone intermediate query. @@ -503,14 +503,14 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { type GroupGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ggb *GroupGroupBy) Aggregate(fns ...Aggregate) *GroupGroupBy { +func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy { ggb.fns = append(ggb.fns, fns...) return ggb } diff --git a/examples/start/ent/user_query.go b/examples/start/ent/user_query.go index 6e143492a..0cacbecd1 100644 --- a/examples/start/ent/user_query.go +++ b/examples/start/ent/user_query.go @@ -27,7 +27,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -57,7 +57,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -268,7 +268,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -563,14 +563,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb } diff --git a/examples/traversal/ent/ent.go b/examples/traversal/ent/ent.go index d382e19a3..d28ff7d7b 100644 --- a/examples/traversal/ent/ent.go +++ b/examples/traversal/ent/ent.go @@ -30,11 +30,11 @@ type ( MutateFunc = ent.MutateFunc ) -// Order applies an ordering on either graph traversal or sql selector. -type Order func(*sql.Selector) +// OrderFunc applies an ordering on either graph traversal or sql selector. +type OrderFunc func(*sql.Selector) // Asc applies the given fields in ASC order. -func Asc(fields ...string) Order { +func Asc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Asc(f)) @@ -43,7 +43,7 @@ func Asc(fields ...string) Order { } // Desc applies the given fields in DESC order. -func Desc(fields ...string) Order { +func Desc(fields ...string) OrderFunc { return func(s *sql.Selector) { for _, f := range fields { s.OrderBy(sql.Desc(f)) @@ -51,8 +51,8 @@ func Desc(fields ...string) Order { } } -// Aggregate applies an aggregation step on the group-by traversal/selector. -type Aggregate func(*sql.Selector) string +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string // As is a pseudo aggregation function for renaming another other functions with custom names. For example: // @@ -60,42 +60,42 @@ type Aggregate func(*sql.Selector) string // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). // Scan(ctx, &v) // -func As(fn Aggregate, end string) Aggregate { +func As(fn AggregateFunc, end string) AggregateFunc { return func(s *sql.Selector) string { return sql.As(fn(s), end) } } // Count applies the "count" aggregation function on each group. -func Count() Aggregate { +func Count() AggregateFunc { return func(s *sql.Selector) string { return sql.Count("*") } } // Max applies the "max" aggregation function on the given field of each group. -func Max(field string) Aggregate { +func Max(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Max(s.C(field)) } } // Mean applies the "mean" aggregation function on the given field of each group. -func Mean(field string) Aggregate { +func Mean(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Avg(s.C(field)) } } // Min applies the "min" aggregation function on the given field of each group. -func Min(field string) Aggregate { +func Min(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Min(s.C(field)) } } // Sum applies the "sum" aggregation function on the given field of each group. -func Sum(field string) Aggregate { +func Sum(field string) AggregateFunc { return func(s *sql.Selector) string { return sql.Sum(s.C(field)) } diff --git a/examples/traversal/ent/group_query.go b/examples/traversal/ent/group_query.go index 725012cc0..849163168 100644 --- a/examples/traversal/ent/group_query.go +++ b/examples/traversal/ent/group_query.go @@ -26,7 +26,7 @@ type GroupQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Group // eager-loading edges. @@ -57,7 +57,7 @@ func (gq *GroupQuery) Offset(offset int) *GroupQuery { } // Order adds an order step to the query. -func (gq *GroupQuery) Order(o ...Order) *GroupQuery { +func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery { gq.order = append(gq.order, o...) return gq } @@ -268,7 +268,7 @@ func (gq *GroupQuery) Clone() *GroupQuery { config: gq.config, limit: gq.limit, offset: gq.offset, - order: append([]Order{}, gq.order...), + order: append([]OrderFunc{}, gq.order...), unique: append([]string{}, gq.unique...), predicates: append([]predicate.Group{}, gq.predicates...), // clone intermediate query. @@ -570,14 +570,14 @@ func (gq *GroupQuery) sqlQuery() *sql.Selector { type GroupGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ggb *GroupGroupBy) Aggregate(fns ...Aggregate) *GroupGroupBy { +func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy { ggb.fns = append(ggb.fns, fns...) return ggb } diff --git a/examples/traversal/ent/pet_query.go b/examples/traversal/ent/pet_query.go index 043f5b267..835fcb923 100644 --- a/examples/traversal/ent/pet_query.go +++ b/examples/traversal/ent/pet_query.go @@ -26,7 +26,7 @@ type PetQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.Pet // eager-loading edges. @@ -57,7 +57,7 @@ func (pq *PetQuery) Offset(offset int) *PetQuery { } // Order adds an order step to the query. -func (pq *PetQuery) Order(o ...Order) *PetQuery { +func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery { pq.order = append(pq.order, o...) return pq } @@ -268,7 +268,7 @@ func (pq *PetQuery) Clone() *PetQuery { config: pq.config, limit: pq.limit, offset: pq.offset, - order: append([]Order{}, pq.order...), + order: append([]OrderFunc{}, pq.order...), unique: append([]string{}, pq.unique...), predicates: append([]predicate.Pet{}, pq.predicates...), // clone intermediate query. @@ -570,14 +570,14 @@ func (pq *PetQuery) sqlQuery() *sql.Selector { type PetGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (pgb *PetGroupBy) Aggregate(fns ...Aggregate) *PetGroupBy { +func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy { pgb.fns = append(pgb.fns, fns...) return pgb } diff --git a/examples/traversal/ent/user_query.go b/examples/traversal/ent/user_query.go index 9fe1eb37a..2f5ed1745 100644 --- a/examples/traversal/ent/user_query.go +++ b/examples/traversal/ent/user_query.go @@ -27,7 +27,7 @@ type UserQuery struct { config limit *int offset *int - order []Order + order []OrderFunc unique []string predicates []predicate.User // eager-loading edges. @@ -59,7 +59,7 @@ func (uq *UserQuery) Offset(offset int) *UserQuery { } // Order adds an order step to the query. -func (uq *UserQuery) Order(o ...Order) *UserQuery { +func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery { uq.order = append(uq.order, o...) return uq } @@ -306,7 +306,7 @@ func (uq *UserQuery) Clone() *UserQuery { config: uq.config, limit: uq.limit, offset: uq.offset, - order: append([]Order{}, uq.order...), + order: append([]OrderFunc{}, uq.order...), unique: append([]string{}, uq.unique...), predicates: append([]predicate.User{}, uq.predicates...), // clone intermediate query. @@ -716,14 +716,14 @@ func (uq *UserQuery) sqlQuery() *sql.Selector { type UserGroupBy struct { config fields []string - fns []Aggregate + fns []AggregateFunc // intermediate query (i.e. traversal path). sql *sql.Selector path func(context.Context) (*sql.Selector, error) } // Aggregate adds the given aggregation functions to the group-by query. -func (ugb *UserGroupBy) Aggregate(fns ...Aggregate) *UserGroupBy { +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { ugb.fns = append(ugb.fns, fns...) return ugb }