diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index faaba0981..13bf1b936 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -506,7 +506,7 @@ func templateDialectGremlinOpenTmpl() (*asset, error) { return a, nil } -var _templateDialectGremlinPredicateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x56\xdf\x6b\xe3\x38\x10\x7e\xb6\xff\x8a\xa1\x14\xce\x0e\xa9\xd2\xdb\xb7\x3b\xe8\x43\xb7\x97\xe5\x02\x4b\xc3\xd1\xa5\xf7\x50\x4a\x50\xa5\x71\x22\xaa\x4a\x46\x92\x5d\x16\xe3\xff\xfd\x90\xe4\x38\x76\x9a\x92\x5e\x7b\x3f\xd8\xa7\x04\xcd\x68\xe6\x9b\xef\xfb\x2c\xa9\x69\x66\x93\xf4\x4a\x97\xdf\x8d\x58\x6f\x1c\x7c\x3a\xff\xf9\x97\xb3\xd2\xa0\x45\xe5\xe0\x0b\x65\xf8\xa0\xf5\x23\x2c\x14\x23\x70\x29\x25\x84\x24\x0b\x3e\x6e\x6a\xe4\x24\xfd\xb6\x11\x16\xac\xae\x0c\x43\x60\x9a\x23\x08\x0b\x52\x30\x54\x16\x39\x54\x8a\xa3\x01\xb7\x41\xb8\x2c\x29\xdb\x20\x7c\x22\xe7\xdb\x28\x14\xba\x52\x3c\x15\x2a\xc4\xbf\x2e\xae\xe6\xd7\x37\x73\x28\x84\x44\xe8\xd6\x8c\xd6\x0e\xb8\x30\xc8\x9c\x36\xdf\x41\x17\xe0\x06\xcd\x9c\x41\x24\xe9\x64\xd6\xb6\x69\xda\x34\xc0\xb1\x10\x0a\xe1\x84\x0b\x2a\x91\xb9\xd9\xda\xe0\x93\x14\x6a\x56\x1a\xe4\x82\x51\x87\x33\xc1\x4f\xe0\xac\x6d\xd3\xa4\xa8\x14\xcb\x1c\x4c\xb8\x95\xe4\x9b\xa1\x35\x1a\x4b\x65\x0e\x4d\x9a\x24\x8e\xfc\x4e\xed\xe2\xb7\x4c\xf0\x3c\x4d\xda\xb4\x69\xce\x00\x15\x87\xbf\xd1\x63\xa6\x4b\xdb\xf5\xf1\xbb\x4f\x75\x09\xbf\x5e\xc0\x29\xb9\x61\xba\x44\xb2\x2c\x07\x21\x6a\xd6\xc3\xd8\xa5\x59\x0f\x82\xd6\x69\x43\xd7\x38\x4c\xb8\xe9\x96\x8e\x0d\xe1\xf7\x8b\xc2\xb7\x26\xb7\xd4\x08\xca\x05\xf3\x13\x24\x49\x52\xfb\x72\x4f\xf4\x11\xb3\xbb\x7b\xa1\x1c\x9a\x82\x32\x6c\xda\x29\x48\x54\x59\xd3\x44\x48\x6d\x9b\xe7\x3e\xb9\xd0\x06\x84\xdf\x60\xa8\x5a\x23\xd4\xa1\x76\x92\xd4\x77\xe2\x1e\x2e\x60\x97\x7d\x27\xee\x7d\xa0\xed\x3a\x77\x7c\xed\xb8\x2c\x49\xd3\x00\xa3\x52\xf6\x43\x91\x65\x79\xe5\xad\xe2\xc9\x69\x5b\xdf\xf8\x25\xdc\x9a\x10\xbf\x0f\xa5\x45\x68\xdb\x5d\x37\xbf\x16\x3a\xe4\xef\x53\xa8\x10\x28\xf9\x50\xa0\x62\x48\xf1\x17\x1f\x7d\x9b\x4b\xb2\xaf\xf4\x01\xe5\x34\x10\x51\x90\x2b\xad\xac\xa3\xca\x41\xdb\x4e\xa1\x24\xf3\x3f\xb2\xfa\x23\x00\xf7\x5d\xf4\x1a\xc8\x63\x16\xfb\xb8\x8b\x94\x76\x41\x9a\x6b\x21\x77\x46\x3a\x4e\xc0\x11\xc9\xeb\x83\x9a\x77\x92\xf7\xf2\x46\x3f\x45\x07\x6c\xbb\x86\xa6\xb1\x75\xfe\x06\x63\x8d\x91\xe5\x7b\x1e\x7d\x87\x3c\xc8\xd7\x38\xdb\xd0\x91\x3a\x23\x7e\xe7\x7c\x4b\x6e\x88\x49\x8f\x34\xc4\x91\x04\xd4\x3d\x9c\x5d\x4e\x3c\xe3\x84\x56\x3e\xef\x64\x59\xb9\x41\x71\xcf\x12\x92\x85\x5d\x28\x2f\x4e\x57\x79\x7f\xdb\x05\x9c\x2c\xd4\x49\x1f\x9b\x4d\x80\xd6\x5a\x70\x60\xc2\xb0\x4a\x52\x03\x1c\x4b\x54\x1c\x99\x40\x0b\xe1\xc8\x4c\x86\xe8\x02\xb8\xae\xc1\x2b\x18\x3d\x47\x6f\x71\xcc\x6c\xe2\x11\x0b\xf7\x93\x05\xaa\xc0\x93\x05\xcf\xc2\x6d\xc0\xa2\x2c\xce\x0c\x16\x68\x50\x31\x9c\x82\xa3\x8f\x18\x0e\x79\xf7\xac\xa1\x46\xe3\x04\x1b\x43\x8b\x73\x7f\x16\x5c\x74\x67\x97\x23\x9f\xb5\xdb\x04\x4d\x23\xea\x81\x9c\xbd\x45\x12\xe7\x3d\x31\x60\xa6\x6d\xe7\xe3\x2d\x2f\xe2\xb7\xd9\x3f\xe8\x0a\x3f\xeb\x7f\xe5\x8c\x53\x11\x15\x5b\x8d\x93\x7a\x23\xbc\xd7\x3d\x07\x2b\x8f\xba\xff\xbf\x16\x1b\x39\x23\x20\xf1\xe6\x32\x58\xc0\x13\x52\x65\x41\x38\xb0\x1b\x5d\x49\x0e\x0f\xfe\x95\x50\x85\xf7\x84\x56\x18\x1f\x10\x08\xfd\x50\x3d\xce\x44\xa8\x29\xe8\xca\x79\xfe\x56\x2b\xb2\x50\xb7\x59\x3e\xf5\xff\x96\x95\x8b\xf6\x08\x97\xe1\x6a\x0a\xe5\xee\x3e\xf4\xe2\xdb\xee\x4e\x2c\x33\xa1\xf2\xee\x9f\xae\x5c\xbe\xbd\x0f\x13\x47\xfe\xdc\xa0\xc1\x2c\xc4\x7c\x41\x13\xff\x26\xb1\xf8\xbe\x37\x63\xb2\x50\xf9\xb4\xcf\x5a\xa8\xc3\x49\xbe\x4d\xcc\x8a\x3f\x87\xbe\x05\xd3\x0d\xe4\xf7\xbf\x94\x74\x6b\xfd\xa3\xb3\x39\x33\x1c\xe8\xd8\xf7\x15\xe1\x39\xf3\x2f\x7d\x69\x54\x8d\x9f\x71\xe6\xf0\x0d\x6d\xec\x6b\x4f\x9d\xf3\xf8\xda\xe9\x2b\xda\x70\xd3\x1c\xe6\x20\x26\x44\x22\xb6\xee\xb8\xc6\xe7\x48\x5b\x99\x45\xa1\x7d\xaf\x0b\xa0\xa5\xb7\x7f\xe6\x8c\x9d\x42\x58\x0f\x37\x96\xe9\xe8\x58\xad\xc8\x65\x8c\x12\x42\xde\xf9\x30\xd0\xe6\xc7\x1c\x7c\x69\x3e\x36\xb7\xd2\xee\x2d\x83\xef\xa1\xec\x40\x0e\x81\x5c\x6b\x97\xb9\x7d\x10\x7f\x05\x00\x00\xff\xff\xc8\x78\xeb\x82\xff\x0c\x00\x00") +var _templateDialectGremlinPredicateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x56\xdf\x6b\xe3\x38\x10\x7e\xb6\xff\x8a\x21\x14\xce\x0e\xa9\xd2\xdb\xb7\x3b\xe8\x43\xb7\x97\xe5\x02\x4b\xc3\xd1\xa5\xf7\x50\x4a\x50\xa5\x71\x22\xaa\x4a\x46\x92\x53\x16\xe3\xff\xfd\x90\xe4\x38\x76\x92\xbd\xf4\x72\x3f\x96\x7b\x8a\xf1\x8c\xe6\xfb\xe6\x9b\xcf\xd1\xd4\xf5\x74\x9c\xde\xea\xf2\xab\x11\xab\xb5\x83\x0f\x57\x3f\xfe\x74\x59\x1a\xb4\xa8\x1c\x7c\xa2\x0c\x9f\xb5\x7e\x81\xb9\x62\x04\x6e\xa4\x84\x90\x64\xc1\xc7\xcd\x06\x39\x49\xbf\xac\x85\x05\xab\x2b\xc3\x10\x98\xe6\x08\xc2\x82\x14\x0c\x95\x45\x0e\x95\xe2\x68\xc0\xad\x11\x6e\x4a\xca\xd6\x08\x1f\xc8\xd5\x36\x0a\x85\xae\x14\x4f\x85\x0a\xf1\xcf\xf3\xdb\xd9\xdd\xfd\x0c\x0a\x21\x11\xda\x77\x46\x6b\x07\x5c\x18\x64\x4e\x9b\xaf\xa0\x0b\x70\x3d\x30\x67\x10\x49\x3a\x9e\x36\x4d\x9a\xd6\x35\x70\x2c\x84\x42\x18\x71\x41\x25\x32\x37\x5d\x19\x7c\x95\x42\x4d\x4b\x83\x5c\x30\xea\x70\x2a\xf8\x08\x2e\x9b\x26\x4d\x8a\x4a\xb1\xcc\xc1\x98\x5b\x49\xbe\x18\xba\x41\x63\xa9\xcc\xa1\x4e\x93\xc4\x91\x5f\xa9\x9d\xff\x92\x09\x9e\xa7\x49\x93\xd6\xf5\x25\xa0\xe2\xf0\x17\x30\xa6\xba\xb4\x2d\x8e\x3f\x7d\xa1\x4b\xf8\xf9\x1a\x2e\xc8\x3d\xd3\x25\x92\x45\xd9\x0b\x51\xb3\xea\xc7\x6e\xcc\xaa\x17\xb4\x4e\x1b\xba\xc2\x7e\xc2\x7d\xfb\xea\x54\x13\xfe\xbc\x28\x3c\x34\x79\xa0\x46\x50\x2e\x98\xef\x20\x49\x92\x8d\x2f\xf7\x4a\x5f\x30\x7b\x7c\x12\xca\xa1\x29\x28\xc3\xba\x99\x80\x44\x95\xd5\x75\xa4\xd4\x34\x79\xee\x93\x0b\x6d\x40\xf8\x03\x86\xaa\x15\xc2\x26\xd4\x4e\x92\xcd\xa3\x78\x82\x6b\xd8\x65\x3f\x8a\x27\x1f\x68\x5a\xe4\x56\xaf\x9d\x96\x25\xa9\x6b\x60\x54\xca\xae\x29\xb2\x28\x6f\xbd\x55\xbc\x38\x4d\xe3\x81\x0f\xe9\x6e\x08\xf1\xe7\x50\x5a\x84\xa6\xd9\xa1\xf9\x77\x01\x21\x3f\x6f\x42\x85\x40\xc9\xfb\x03\x2a\xfa\x12\x7f\xf2\xd1\x77\x8c\xe8\x94\x85\xb2\xcf\xf4\x19\xe5\x24\xa8\x54\x90\x5b\xad\xac\xa3\xca\x41\xd3\x4c\xa0\x24\xb3\xdf\xf6\xb4\x3e\xb7\x8d\x7d\xaf\xfd\x69\x2b\xdf\xcf\x88\x4a\xbb\x30\xdd\x3b\x21\x7b\x5e\x3c\xad\xd3\x69\xdb\xec\x3c\x71\x68\xa0\xd6\x3f\x9d\x57\xa2\x39\xa3\x9d\x3a\xfc\x00\x1f\x49\xe4\xef\xc1\x1b\x70\xcc\xf7\x1c\x7f\xc6\x18\x91\xaf\x70\xba\xa6\x83\x29\x0e\xa4\x9e\xf1\xad\xce\x21\x26\x3d\xd3\x10\x47\x12\x58\x77\x74\x76\x39\xf1\x1f\x53\x68\xe5\xf3\x46\x8b\xca\xf5\x8a\x7b\x99\x90\xcc\xed\x5c\xf9\x39\xb5\x95\xf7\x8f\x5d\xc3\x68\xae\x46\x5d\x6c\x3a\x06\xba\xd1\x82\x03\x13\x86\x55\x92\x1a\xe0\x58\xa2\xe2\xc8\x04\x5a\x08\x7f\xc0\x49\x9f\x5d\x20\xd7\x02\x7c\x83\xa3\xd7\xe8\x3d\xe6\x99\x8e\x3d\x63\xe1\x7e\xb0\x40\x15\x78\xb1\xe0\x4d\xb8\x35\x58\x94\xc5\xa5\xc1\x02\x0d\x2a\x86\x13\x70\xf4\x05\xc3\x95\xe1\xde\x34\x6c\xd0\x38\xc1\x86\xd4\x62\xdf\x1f\x05\x17\xdd\xf4\x3f\x6a\xb7\x0e\x33\x8d\xac\x7b\xe3\xec\x7b\xc4\x27\xec\x94\x69\x9a\xd9\xf0\xc8\x41\xfc\x21\xfb\x07\x5d\xe1\x7b\xfd\xaf\x9c\x71\x21\xe2\xc4\x96\xc3\xa4\xce\x08\xe7\xba\xe7\x68\xe5\x01\xfa\xf7\xb5\xd8\xc0\x19\x81\x89\x37\x97\xc1\x02\x5e\x91\x2a\x0b\xc2\x81\x5d\xeb\x4a\x72\x78\xf6\x3b\x47\x15\xb6\x13\xad\x30\xae\x23\x08\x5d\x53\x1d\xcf\x44\xa8\x09\xe8\xca\x79\xfd\x96\x4b\x32\x57\x0f\x59\x3e\xf1\x4f\x8b\xca\x45\x7b\x84\xab\x75\x39\x81\x72\x77\xbb\xfa\xe1\xdb\xf6\x86\x2d\x33\xa1\xf2\xf6\x49\x57\x2e\xdf\xde\xae\x89\x23\xbf\xaf\xd1\x60\x16\x62\xbe\xa0\x89\x8f\x49\x2c\xbe\xef\xcd\x98\x2c\x54\x3e\xe9\xb2\xe6\xea\x78\x92\x87\x89\x59\xf1\xe7\xd8\xb7\x60\xda\x86\xfc\xf9\xc3\x91\x6e\xad\x7f\xb2\x37\x67\xfa\x0d\x9d\xfa\xbe\x22\x3d\x67\xfe\xa5\x2f\x8d\xaa\xe1\x52\x68\x8e\x5f\xe9\xc6\x7e\x6b\x71\xba\x8a\xbb\x53\x57\xd1\x86\xab\xe6\xb8\x06\x31\x21\x0a\xb1\x75\xc7\x1d\xbe\x45\xd9\xca\x2c\x0e\xda\x63\x5d\x03\x2d\xbd\xfd\x33\x67\xec\x04\xc2\xfb\xb0\x50\x99\x56\x8e\xe5\x92\xdc\xc4\x28\x21\xe4\xcc\x05\x42\x9b\xff\x67\xe3\x0b\xf3\xf7\xfa\x56\xda\xbd\xa7\xf1\x3d\x96\x2d\xc9\x3e\x91\x3b\xed\x32\x77\x40\xe2\x8f\x00\x00\x00\xff\xff\x2a\x4f\xad\x9d\x4e\x0d\x00\x00") func templateDialectGremlinPredicateTmplBytes() ([]byte, error) { return bindataRead( @@ -521,7 +521,7 @@ func templateDialectGremlinPredicateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/gremlin/predicate.tmpl", size: 3327, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/dialect/gremlin/predicate.tmpl", size: 3406, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -866,7 +866,7 @@ func templateDialectSqlUpdateTmpl() (*asset, error) { return a, nil } -var _templateEntTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x58\xdf\x6f\xe3\xb8\xf1\x7f\xb6\xfe\x8a\x39\xc1\x7b\x67\x1b\x8e\xb4\xdf\x7b\xfb\xa6\x4d\x81\x5c\x92\x05\x02\x2c\x72\x6d\x93\x45\x1f\x16\x8b\x0d\x2d\x8d\x2c\x36\x32\xe9\x25\x29\x27\x86\xa0\xff\xbd\x18\x52\x94\x29\x5b\xc9\xa5\xbd\xa7\x38\x9c\xdf\x9f\x19\x0e\x67\xd4\x34\xe9\x22\xba\x92\xdb\xbd\xe2\xeb\xd2\xc0\xaf\x1f\xff\xef\xff\xcf\xb6\x0a\x35\x0a\x03\x9f\x58\x86\x2b\x29\x9f\xe0\x56\x64\x09\x5c\x56\x15\x58\x26\x0d\x44\x57\x3b\xcc\x93\xe8\xa1\xe4\x1a\xb4\xac\x55\x86\x90\xc9\x1c\x81\x6b\xa8\x78\x86\x42\x63\x0e\xb5\xc8\x51\x81\x29\x11\x2e\xb7\x2c\x2b\x11\x7e\x4d\x3e\x7a\x2a\x14\xb2\x16\x79\xc4\x85\xa5\x7f\xbe\xbd\xba\xb9\xbb\xbf\x81\x82\x57\x08\xdd\x99\x92\xd2\x40\xce\x15\x66\x46\xaa\x3d\xc8\x02\x4c\x60\xcc\x28\xc4\x24\x5a\xa4\x6d\x1b\x45\x4d\x03\x39\x16\x5c\x20\xc4\x1b\x99\x63\x15\x43\x77\x3a\xdd\x3e\xad\xe1\xfc\x02\x56\x4c\x23\x4c\x93\x2b\x29\x0a\xbe\x4e\xfe\xce\xb2\x27\xb6\x46\x62\x6a\x1a\x30\xb8\xd9\x56\xcc\x20\xc4\x25\xb2\x1c\x55\x0c\x53\x2f\x7e\x20\xf1\xcd\x56\x2a\xe3\x49\x69\x0a\xa4\x3c\xb9\x63\x1b\xd2\x42\x31\x93\xc3\xd6\x36\xa0\x30\xdc\xec\xa1\x90\x2e\xf2\x01\xa3\xce\x4a\xdc\xb0\x24\x32\xfb\xed\x31\xc5\xa8\x3a\x33\xd0\x44\x93\xcc\x3a\x09\x03\xf3\x56\x73\x2a\x37\xdc\x18\xb6\xd6\x9d\x1b\x93\x34\x85\xdb\x6b\x87\x0b\x92\xd9\x24\x9a\xdc\x5e\x3b\xb5\xb7\xd7\xc9\x03\xd9\x68\x5b\x78\xf4\x07\xf7\xd6\xc4\x03\x5b\x43\xdb\x3e\x46\x93\xa6\x39\x03\xc5\xc4\x1a\x61\xfa\x7d\x09\xd3\x82\x70\x9a\x26\x9f\x38\x56\xb9\xb6\xea\x27\x5d\x98\x45\x27\x69\x49\xa4\xb1\x94\xc4\x42\x46\x77\xac\xaa\xd1\x7b\x10\x3b\xe6\x2e\xa2\x18\x0a\xe2\x4f\x22\x00\x80\xc9\xa8\x9e\xa6\x01\x5e\x58\x11\x5e\x55\x6c\x55\x91\xd8\xa2\x69\x00\x05\x91\x9d\x88\x8f\xc2\xf1\x0a\x69\xac\x1e\x14\x9a\x1b\xbe\x23\xca\x63\xa8\xba\x0b\x8e\x74\x54\x1a\x9d\x92\xb7\x51\xec\xcd\x39\x40\xc2\xdf\xcf\xdc\x94\x30\x4d\x6e\xf2\x35\x1e\x00\x71\xff\x1d\x10\x50\x58\x31\xc3\xa5\xd0\x29\x5a\x0a\xa5\x5d\x9a\x12\x15\x08\x99\xa3\xf6\xb5\xbc\x56\x6c\x5b\x26\x4e\xc5\x83\x07\x4e\x03\x53\x08\x2b\xe4\x62\x0d\x5b\xb9\xad\xc9\xcb\x1c\x56\xfb\x93\xba\xf9\x47\x8d\x6a\x0f\xcf\x25\x0a\x40\xb6\x46\x75\x56\x49\x96\x93\x14\x5d\x07\xa4\xbc\x4f\x9c\x5f\xa1\x90\x3b\x79\xfc\xb7\x96\xe2\x3c\xb6\xce\xc5\x8f\x87\x20\xcf\x7c\x94\xe9\x02\x2e\xf3\x9c\x53\x0c\xac\x72\x39\xd3\x60\x24\xb0\xbc\x77\x45\x1b\xa9\xe8\xbe\xe4\x8a\xef\x50\x25\x60\x2f\x9d\x15\x9e\x9a\xcd\xb6\xa2\xc2\xd9\x2a\x2e\x4c\x01\x71\xce\x59\x85\x99\x49\x3f\xe8\xd4\xa1\xed\x14\xc6\x30\x4d\xee\x3b\x2d\x5e\x96\x17\x50\x32\xfd\xe0\xb3\xe3\x54\x59\x98\x89\xfa\x62\x86\x84\x64\x34\x45\xef\x70\xbe\xd6\xa1\xcb\x27\xd5\xe0\x64\x52\xd6\x6b\xe9\x2e\x97\x6d\x00\xa7\x35\x70\x74\xf3\xff\x5c\x35\x9c\x74\x01\xa7\xee\xd0\x0a\x82\x2b\x8a\x84\x72\x32\xb8\x97\xf8\xce\x7b\xe9\x78\x7d\xa3\x21\xc7\x12\x0b\xf2\x88\x86\xe0\x96\x61\xf2\x45\xf0\x1f\x35\xc9\x7c\xfd\xd6\xdf\x92\x85\x13\xa3\x5b\xd9\x6b\x6c\x9a\x0e\x26\x3c\xb9\x85\x89\xbf\x8d\x23\x57\x2c\x4d\x81\xca\x18\x73\x52\x16\x82\xc8\x45\x21\xd5\xc6\xe2\x68\x01\x54\x48\xbd\xd7\x96\x7b\x01\xcc\x0a\x5a\xe4\x9e\x99\xee\x34\xc0\xcc\xb2\xfd\xa8\x51\x1b\xcc\xe7\x04\xf3\xf0\x9e\x48\x4a\x00\xdd\x93\xd0\xe2\xd7\xa6\x81\x0a\x85\x75\xf2\xdb\x4a\xca\xca\x27\xbd\x83\x9c\x2f\x07\xb0\xbf\x82\xfa\xef\xea\x46\x91\x71\x53\x2b\xa1\x03\xbc\x8f\x90\xed\x32\xa2\x80\x09\x40\xa5\xa4\xa2\x60\x6c\xdf\xce\xd7\x68\x95\x53\x38\x84\x7c\x17\xd2\x71\x0c\x5d\xb3\x0c\xd2\xb2\x24\x75\x1d\xf7\xaa\x36\xbd\x02\xfb\xb0\xf6\xa0\x27\xd1\xa4\xa8\x45\x06\xb3\x91\x52\x9b\xbf\x1e\xd1\x6c\x0e\xb3\xff\xa5\x1a\x96\x2e\xba\x39\x95\xef\x84\x17\x80\x49\x00\x39\x21\x3e\xe5\x04\xb7\x25\xfb\x36\x10\x6a\xa7\x63\x27\x37\x0a\xe3\xc5\x05\x08\x5e\x39\xe9\xbe\x99\x12\x84\x47\x55\x1e\xd4\xc6\x31\x90\xcb\x5e\xf6\x04\xb4\xc4\x91\x5c\x32\xc9\xd0\x12\x7e\xbe\x93\xe6\x13\xd1\x6e\x28\xac\xa6\x62\x2b\xac\xce\x21\x88\xfb\x30\x4c\x24\x9f\x89\xe8\x22\x68\x7d\x78\xbe\xda\x7b\xad\xe3\x81\x2d\xc9\x5a\xe4\xe4\x8e\xcd\x7f\xb6\x71\x38\xfb\x14\xea\xb9\x7b\x69\xfb\x60\xe3\x36\x9a\xb4\x51\x60\x2c\xf8\x69\x87\x20\xdb\x40\x47\x7b\x74\x8e\x34\xb3\xa5\x52\xe0\x51\x87\x6e\x9a\x93\x0e\xdc\x4f\x45\x53\x85\x19\xd2\x4b\xe0\x26\x86\x7f\xfa\xff\x3a\x72\x30\x53\xa0\xe3\x38\xbc\xa0\xf6\xad\xa6\x6a\xf4\x4f\x06\xc4\xf6\x6d\x8b\x4f\x11\xe9\x2f\x9c\xe5\x6f\x5b\xf8\x51\xa3\xe2\xa8\x5f\x69\x69\x61\xb3\xf3\x84\xbe\xf4\x07\x4e\xb7\x2d\x2c\x42\xae\x79\x68\x65\x36\x87\xe3\xa2\xf6\xcf\x6f\x73\x48\xcd\xec\xe7\x50\xc1\x55\xc5\x51\x98\xc6\xcd\x6d\xae\x36\x02\x63\x89\x3b\x6f\xe7\x49\x68\xe6\x88\x69\xee\x32\xd8\x67\x2d\x4d\xe1\xcb\x36\x27\xec\x7d\x63\x61\xb0\xaa\x79\x45\xe3\x34\xb5\xc4\x9a\x88\xd4\xd8\xec\x44\x3c\x8c\x39\x4d\xe1\x4e\x1a\x04\x53\x32\xb3\x84\xbd\xac\x41\x20\xe6\xf4\x2a\x66\xac\xaa\x86\xcc\x5f\xc4\xb3\x62\xdb\xd9\x1c\x56\x58\x48\x85\x96\xa3\x57\xbb\x41\x53\xca\x7c\xe9\x1a\xd5\x91\x99\xa8\x6b\x58\xce\x3d\xcc\xa1\x50\x72\x03\x0c\x8c\x62\x42\xb3\x8c\x7a\xf7\x12\x98\xc8\x6d\x4e\x82\x43\x2b\x94\xc9\x0d\xcd\x60\x98\x53\x03\x53\xb2\xaa\xa8\x81\xb1\xec\x29\x89\xde\x95\x2e\x87\x8c\xcf\x94\x3f\x77\xa7\xbf\x0b\xa4\x44\xfd\xa9\x3c\xf5\x9a\x4e\xb3\xd4\xa5\xc6\xa2\x06\xb5\xfd\xa3\xfd\xf4\x4d\x43\x3f\x61\xfe\x47\xb8\x00\x2b\x0c\x2a\xe0\x8e\x31\xab\xa4\xc6\x7c\x49\x6a\xb5\x74\xf2\x94\x25\x81\x2f\xa6\xaf\xf8\x67\x5e\x55\xb0\x42\xc0\x17\xcc\x6a\x82\xcd\x94\x4a\xd6\xeb\xd2\x5a\x76\x43\x19\x3c\x97\x3c\x2b\x21\x53\xc8\x1c\xc3\x00\xf5\xf7\x02\xeb\xab\x61\x70\x4e\x78\x9a\x97\x25\xc8\x27\xba\xb5\xe3\xa8\x25\xdd\x68\x38\x5b\x98\x97\x6b\xfb\x73\x1e\x51\x17\xff\x49\x3e\xd9\x7b\xb3\x65\x82\x67\xb3\xd8\x6f\x64\x6d\x7b\x7e\xb2\x40\x51\x13\x1e\xe0\xc4\xfc\x2a\x15\xdb\xdb\x31\x79\xd3\x32\x5c\x80\x79\x49\x72\xb5\xeb\x73\x7f\xc4\xde\xa5\xee\xde\x28\x3b\x48\x6c\xb6\x15\x6e\x50\x18\x97\xbd\x62\x63\x12\x47\x41\xf5\x4e\xac\x1c\xfb\x6c\x4e\xd3\x1a\x69\x6c\xa2\xc9\x8e\xa9\xfe\x92\xba\x53\x9d\xfc\xe6\xfe\x8f\x26\x1d\x21\xf9\x97\xe2\x06\x3b\xe1\x38\x54\x39\xa3\x30\xc7\xb8\xac\x73\xae\x77\xcf\x62\x9e\x5f\x7c\xd8\xc5\xcb\x93\x34\xdc\x5e\xcf\xe7\x83\x79\x91\x8f\xaf\x74\xfe\xc5\x1d\xee\x50\xf4\x3c\x8d\x3a\xb8\x84\xc1\x4e\x77\xf1\x57\xed\xa5\xfe\x46\xee\xba\x17\xce\x6d\x5a\xfe\xc1\x9b\xea\x22\x5c\x08\x3e\xe8\xe4\x03\x8d\xff\xbd\xb3\x27\x6b\x60\x38\x08\x0c\x56\x41\x3f\x0a\xec\x7c\xdd\xe9\x02\xda\xf6\x2f\xb0\x83\x9f\x06\x53\xc0\xbb\x3c\xb7\xee\x0e\x2c\xdd\xea\x07\xbe\xe9\xed\x8c\xab\xd9\x25\x9f\xec\x28\x3a\x33\x7c\x83\xc9\xe5\xdd\xfd\xed\xd5\x3c\x50\x64\x43\xf7\xda\xba\xd2\x7a\x53\xdf\x62\x77\x2c\xfd\x26\xfb\x20\xf5\x36\xef\x8b\xdd\xc0\x7e\x3f\x5c\x04\x03\x47\xa0\xf5\xbf\x41\xe6\x55\x60\xc6\x94\xf4\xd9\x78\x15\x9f\x3f\x82\xe7\x4d\xad\x47\x2a\xde\x92\x39\x85\xe8\xa0\x25\x50\x23\xc2\x4a\xeb\xff\x3b\x5e\x27\xfd\xef\x81\xa1\xdf\xf6\x06\x67\xbf\xcc\x7f\x99\xf7\xad\xc5\x93\x7d\x0f\x88\xba\xb9\x48\x57\x3c\xb3\x23\xcf\xb6\xaa\x15\xab\x86\xaf\xe5\x81\xc1\xf5\x3b\x06\x5b\xa6\xb4\x2d\x75\x77\x2c\x8b\xa3\x87\xbc\x5f\x0f\x7b\xb1\xaf\xdf\x06\x5d\xc8\x5a\xb5\xab\x17\xbe\x18\xf2\x7d\x0a\xf1\x3d\xf1\xc6\x07\x19\xd7\x37\xdf\x58\xd3\xbb\x11\x70\xc3\xc4\xfe\x74\x4b\x1f\x5f\xc3\x83\x41\x65\xbc\x57\x86\x4e\xcf\xc1\x35\xea\x59\x56\xac\xbb\x9f\x76\x39\xa0\x31\xe6\x3b\x27\xa7\x5c\xc7\x3a\xd1\xd1\xed\xa8\xc1\xd9\xd7\xef\xfc\x5b\xd7\xf6\xe1\x02\xb2\x62\x4d\xef\xc2\xc0\x9d\xa6\x49\x17\x70\x79\x58\xf2\xed\xfe\x4d\xb3\x06\x95\x9e\xdb\xab\xcf\x0c\x5b\xeb\xee\x83\xc0\xf1\x77\xc3\xe0\xdb\x90\xfd\x32\xd4\x6d\xff\x0f\x6c\xed\x36\x46\xb7\xcc\x06\x1d\xd6\xf8\xf5\xb0\x5b\x95\xe8\x18\x3e\x76\x10\x1c\x3e\x63\x19\x7a\xf1\xe2\xb3\xb8\x3f\x7c\x0c\xc9\xaf\x39\x6f\x87\x81\x8c\x09\x7a\xfa\xe5\x0e\x95\xe2\xdd\x3a\x23\x95\xfd\xac\xea\x3e\x73\xb0\xb1\xef\x1f\x76\x24\x61\x59\x69\x17\xe5\x64\x3c\xd6\x91\x2f\x1f\xe4\x0e\x8a\xbc\x6d\xa3\xff\x04\x00\x00\xff\xff\x84\x6b\x4d\xa7\x16\x16\x00\x00") +var _templateEntTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x58\x5f\x6f\xe3\xb8\x11\x7f\xb6\x3e\xc5\x9c\xe0\xbd\xb3\x0d\x47\xba\xde\x5b\xd3\xa6\x40\x2e\xc9\xb6\x01\x16\xb9\xb6\xc9\xa2\x0f\x8b\xc5\x86\x96\x46\x16\x1b\x99\xf4\x92\x94\x13\x43\xd0\x77\x2f\x86\x14\x65\xca\x56\xd2\xb4\xf7\x14\x87\xf3\xff\x37\xc3\xe1\x8c\x9a\x26\x5d\x44\x57\x72\xbb\x57\x7c\x5d\x1a\xf8\xe5\xe7\x3f\xfc\xf1\x6c\xab\x50\xa3\x30\xf0\x91\x65\xb8\x92\xf2\x09\x6e\x45\x96\xc0\x65\x55\x81\x65\xd2\x40\x74\xb5\xc3\x3c\x89\x1e\x4a\xae\x41\xcb\x5a\x65\x08\x99\xcc\x11\xb8\x86\x8a\x67\x28\x34\xe6\x50\x8b\x1c\x15\x98\x12\xe1\x72\xcb\xb2\x12\xe1\x97\xe4\x67\x4f\x85\x42\xd6\x22\x8f\xb8\xb0\xf4\x4f\xb7\x57\x37\x77\xf7\x37\x50\xf0\x0a\xa1\x3b\x53\x52\x1a\xc8\xb9\xc2\xcc\x48\xb5\x07\x59\x80\x09\x8c\x19\x85\x98\x44\x8b\xb4\x6d\xa3\xa8\x69\x20\xc7\x82\x0b\x84\x78\x23\x73\xac\x62\xe8\x4e\xa7\xdb\xa7\x35\x9c\x5f\xc0\x8a\x69\x84\x69\x72\x25\x45\xc1\xd7\xc9\xdf\x59\xf6\xc4\xd6\x48\x4c\x4d\x03\x06\x37\xdb\x8a\x19\x84\xb8\x44\x96\xa3\x8a\x61\xea\xc5\x0f\x24\xbe\xd9\x4a\x65\x3c\x29\x4d\x81\x94\x27\x77\x6c\x43\x5a\x28\x66\x72\xd8\xda\x06\x14\x86\x9b\x3d\x14\xd2\x45\x3e\x60\xd4\x59\x89\x1b\x96\x44\x66\xbf\x3d\xa6\x18\x55\x67\x06\x9a\x68\x92\x59\x27\x61\x60\xde\x6a\x4e\xe5\x86\x1b\xc3\xd6\xba\x73\x63\x92\xa6\x70\x7b\xed\x70\x41\x32\x9b\x44\x93\xdb\x6b\xa7\xf6\xf6\x3a\x79\x20\x1b\x6d\x0b\x8f\xfe\xe0\xde\x9a\x78\x60\x6b\x68\xdb\xc7\x68\xd2\x34\x67\xa0\x98\x58\x23\x4c\xbf\x2d\x61\x5a\x10\x4e\xd3\xe4\x23\xc7\x2a\xd7\x56\xfd\xa4\x0b\xb3\xe8\x24\x2d\x89\x34\x96\x92\x58\xc8\xe8\x8e\x55\x35\x7a\x0f\x62\xc7\xdc\x45\x14\x43\x41\xfc\x49\x04\x00\x30\x19\xd5\xd3\x34\xc0\x0b\x2b\xc2\xab\x8a\xad\x2a\x12\x5b\x34\x0d\xa0\x20\xb2\x13\xf1\x51\x38\x5e\x21\x8d\xd5\x83\x42\x73\xc3\x77\x44\x79\x0c\x55\x77\xc1\x91\x8e\x4a\xa3\x53\xf2\x36\x8a\xbd\x39\x07\x48\xf8\xfb\x99\x9b\x12\xa6\xc9\x4d\xbe\xc6\x03\x20\xee\xbf\x03\x02\x0a\x2b\x66\xb8\x14\x3a\x45\x4b\xa1\xb4\x4b\x53\xa2\x02\x21\x73\xd4\xbe\x96\xd7\x8a\x6d\xcb\xc4\xa9\x78\xf0\xc0\x69\x60\x0a\x61\x85\x5c\xac\x61\x2b\xb7\x35\x79\x99\xc3\x6a\x7f\x52\x37\xff\xa8\x51\xed\xe1\xb9\x44\x01\xc8\xd6\xa8\xce\x2a\xc9\x72\x92\xa2\xeb\x80\x94\xf7\x89\xf3\x2b\x14\x72\x27\x8f\xff\xd6\x52\x9c\xc7\xd6\xb9\xf8\xf1\x10\xe4\x99\x8f\x32\x5d\xc0\x65\x9e\x73\x8a\x81\x55\x2e\x67\x1a\x8c\x04\x96\xf7\xae\x68\x23\x15\xdd\x97\x5c\xf1\x1d\xaa\x04\xec\xa5\xb3\xc2\x53\xb3\xd9\x56\x54\x38\x5b\xc5\x85\x29\x20\xce\x39\xab\x30\x33\xe9\x07\x9d\x3a\xb4\x9d\xc2\x18\xa6\xc9\x7d\xa7\xc5\xcb\xf2\x02\x4a\xa6\x1f\x7c\x76\x9c\x2a\x0b\x33\x51\x5f\xcc\x90\x90\x8c\xa6\xe8\x1d\xce\xd7\x3a\x74\xf9\xa4\x1a\x9c\x4c\xca\x7a\x2d\xdd\xe5\xb2\x0d\xe0\xb4\x06\x8e\x6e\xfe\xef\xab\x86\x93\x2e\xe0\xd4\x1d\x5a\x41\x70\x45\x91\x50\x4e\x06\xf7\x12\xdf\x79\x2f\x1d\xaf\x6f\x34\xe4\x58\x62\x41\x1e\xd1\x10\xdc\x32\x4c\x3e\x0b\xfe\xbd\x26\x99\x2f\x5f\xfb\x5b\xb2\x70\x62\x74\x2b\x7b\x8d\x4d\xd3\xc1\x84\x27\xb7\x30\xf1\xb7\x71\xe4\x8a\xa5\x29\x50\x19\x63\x4e\xca\x42\x10\xb9\x28\xa4\xda\x58\x1c\x2d\x80\x0a\xa9\xf7\xda\x72\x2f\x80\x59\x41\x8b\xdc\x33\xd3\x9d\x06\x98\x59\xb6\xef\x35\x6a\x83\xf9\x9c\x60\x1e\xde\x13\x49\x09\xa0\x7b\x12\x5a\xfc\xd2\x34\x50\xa1\xb0\x4e\x7e\x5d\x49\x59\xf9\xa4\x77\x90\xf3\xe5\x00\xf6\x57\x50\xff\x4d\xdd\x28\x32\x6e\x6a\x25\x74\x80\xf7\x11\xb2\x5d\x46\x14\x30\x01\xa8\x94\x54\x14\x8c\xed\xdb\xf9\x1a\xad\x72\x0a\x87\x90\xef\x42\x3a\x8e\xa1\x6b\x96\x41\x5a\x96\xa4\xae\xe3\x5e\xd5\xa6\x57\x60\x1f\xd6\x1e\xf4\x24\x9a\x14\xb5\xc8\x60\x36\x52\x6a\xf3\xd7\x23\x9a\xcd\x61\xf6\xff\x54\xc3\xd2\x45\x37\xa7\xf2\x9d\xf0\x02\x30\x09\x20\x27\xc4\xa7\x9c\xe0\xb6\x64\xdf\x06\x42\xed\x74\xec\xe4\x46\x61\xbc\xb8\x00\xc1\x2b\x27\xdd\x37\x53\x82\xf0\xa8\xca\x83\xda\x38\x06\x72\xd9\xcb\x9e\x80\x96\x38\x92\x4b\x26\x19\x5a\xc2\x8f\x77\xd2\x7c\x24\xda\x0d\x85\xd5\x54\x6c\x85\xd5\x39\x04\x71\x1f\x86\x89\xe4\x13\x11\x5d\x04\xad\x0f\xcf\x57\x7b\xaf\x75\x3c\xb0\x25\x59\x8b\x9c\xdc\xb1\xf9\x4f\x36\x0e\x67\x9f\x42\x3d\x77\x2f\x6d\x1f\x6c\xdc\x46\x93\x36\x0a\x8c\x05\x3f\xed\x10\x64\x1b\xe8\x68\x8f\xce\x91\x66\xb6\x54\x0a\x3c\xea\xd0\x4d\x73\xd2\x81\xfb\xa9\x68\xaa\x30\x43\x7a\x09\xdc\xc4\xf0\x4f\xff\x5f\x47\x0e\x66\x0a\x74\x1c\x87\x17\xd4\xbe\xd5\x54\x8d\xfe\xc9\x80\xd8\xbe\x6d\xf1\x29\x22\xfd\x85\xb3\xfc\x6d\x0b\xdf\x6b\x54\x1c\xf5\x2b\x2d\x2d\x6c\x76\x9e\xd0\x97\xfe\xc0\xe9\xb6\x85\x45\xc8\x35\x0f\xad\xcc\xe6\x70\x5c\xd4\xfe\xf9\x6d\x0e\xa9\x99\xfd\x18\x2a\xb8\xaa\x38\x0a\xd3\xb8\xb9\xcd\xd5\x46\x60\x2c\x71\xe7\xed\x3c\x09\xcd\x1c\x31\xcd\x5d\x06\xfb\xac\xa5\x29\x7c\xde\xe6\x84\xbd\x6f\x2c\x0c\x56\x35\xaf\x68\x9c\xa6\x96\x58\x13\x91\x1a\x9b\x9d\x88\x87\x31\xa7\x29\xdc\x49\x83\x60\x4a\x66\x96\xb0\x97\x35\x08\xc4\x9c\x5e\xc5\x8c\x55\xd5\x90\xf9\xb3\x78\x56\x6c\x3b\x9b\xc3\x0a\x0b\xa9\xd0\x72\xf4\x6a\x37\x68\x4a\x99\x2f\x5d\xa3\x3a\x32\x13\x75\x0d\xcb\xb9\x87\x39\x14\x4a\x6e\x80\x81\x51\x4c\x68\x96\x51\xef\x5e\x02\x13\xb9\xcd\x49\x70\x68\x85\x32\xb9\xa1\x19\x0c\x73\x6a\x60\x4a\x56\x15\x35\x30\x96\x3d\x25\xd1\xbb\xd2\xe5\x90\xf1\x99\xf2\xe7\xee\xf4\x37\x81\x94\xa8\xdf\x95\xa7\x5e\xd3\x69\x96\xba\xd4\x58\xd4\xa0\xb6\x7f\xb4\x9f\xbe\x69\xe8\x27\xcc\xff\x1b\x2e\xc0\x0a\x83\x0a\xb8\x63\xcc\x2a\xa9\x31\x5f\x92\x5a\x2d\x9d\x3c\x65\x49\xe0\x8b\xe9\x2b\xfe\x99\x57\x15\xac\x10\xf0\x05\xb3\x9a\x60\x33\xa5\x92\xf5\xba\xb4\x96\xdd\x50\x06\xcf\x25\xcf\x4a\xc8\x14\x32\xc7\x30\x40\xfd\xbd\xc0\xfa\x6a\x18\x9c\x13\x9e\xe6\x65\x09\xf2\x89\x6e\xed\x38\x6a\x49\x37\x1a\xce\x16\xe6\xe5\xda\xfe\x9c\x47\xd4\xc5\x7f\x90\x4f\xf6\xde\x6c\x99\xe0\xd9\x2c\xf6\x1b\x59\xdb\x9e\x9f\x2c\x50\xd4\x84\x07\x38\x31\xbf\x4a\xc5\xf6\x76\x4c\xde\xb4\x0c\x17\x60\x5e\x92\x5c\xed\xfa\xdc\x1f\xb1\x77\xa9\xbb\x37\xca\x0e\x12\x9b\x6d\x85\x1b\x14\xc6\x65\xaf\xd8\x98\xc4\x51\x50\xbd\x13\x2b\xc7\x3e\x9b\xd3\xb4\x46\x1a\x9b\x68\xb2\x63\xaa\xbf\xa4\xee\x54\x27\xbf\xba\xff\xa3\x49\x47\x48\xfe\xa5\xb8\xc1\x4e\x38\x0e\x55\xce\x28\xcc\x31\x2e\xeb\x9c\xeb\xdd\xb3\x98\xe7\x17\x1f\x76\xf1\xf2\x24\x0d\xb7\xd7\xf3\xf9\x60\x5e\xe4\xe3\x2b\x9d\x7f\x71\x87\x3b\x14\x3d\x4f\xa3\x0e\x2e\x61\xb0\xd3\x5d\xfc\x59\x7b\xa9\xbf\x90\xbb\xee\x85\x73\x9b\x96\x7f\xf0\xa6\xba\x08\x17\x82\x0f\x3a\xf9\x40\xe3\x7f\xef\xec\xc9\x1a\x18\x0e\x02\x83\x55\xd0\x8f\x02\x3b\x5f\x77\xba\x80\xb6\xfd\x13\xec\xe0\x87\xc1\x14\xf0\x2e\xcf\xad\xbb\x03\x4b\xb7\xfa\x81\x6f\x7a\x3b\xe3\x6a\x76\xc9\x47\x3b\x8a\xce\x0c\xdf\x60\x72\x79\x77\x7f\x7b\x35\x0f\x14\xd9\xd0\xbd\xb6\xae\xb4\xde\xd4\xb7\xd8\x1d\x4b\xbf\xc9\x3e\x48\xbd\xcd\xfb\x62\x37\xb0\xdf\x0f\x17\xc1\xc0\x11\x68\xfd\x5f\x90\x79\x15\x98\x31\x25\x7d\x36\x5e\xc5\x27\x84\x87\xde\x81\x10\xa2\x59\xb7\xc6\xff\x8d\xe9\xbf\x4a\x7a\x67\xe7\xef\x33\x76\xa4\xf9\x2d\x99\x53\xe4\x0e\x5a\x02\x35\x22\x2c\xc0\xfe\xbf\xe3\x2d\xd3\xff\x1e\x18\xfa\x75\x6f\x70\xf6\xd3\xfc\xa7\x79\xdf\x71\x3c\xd9\xb7\x86\xa8\x1b\x97\x74\xc5\x33\x3b\x09\x6d\xab\x5a\xb1\x6a\xf8\x88\x1e\x18\x5c\x1b\x64\xb0\x65\x4a\xdb\x1b\xe0\x8e\x65\x71\xf4\xbe\xf7\x5b\x63\x2f\xf6\xe5\xeb\xa0\x39\x59\xab\x76\x23\xc3\x17\x43\xbe\x4f\x21\xbe\x27\xde\xf8\x20\xe3\xda\xe9\x1b\xdb\x7b\x37\x19\x6e\x98\xd8\x9f\x2e\xef\xe3\xdb\x79\x30\xbf\x8c\xb7\xd0\xd0\xe9\x39\xb8\xfe\x3d\xcb\x8a\x75\xf7\xd3\xee\x0c\x34\xdd\x7c\xe3\xe4\x94\x6b\x64\x27\x3a\xba\xd5\x35\x38\xfb\xf2\x8d\x7f\xed\x5e\x03\xb8\x80\xac\x58\xd3\x73\x31\x70\xa7\x69\xd2\x05\x5c\x1e\x76\x7f\xbb\x96\xd3\x08\x42\xd5\xe8\xd6\xed\x33\xc3\xd6\xba\xfb\x4e\x70\xfc\x39\x31\xf8\x64\x64\x3f\x18\x75\x1f\x05\x1e\xd8\xda\x2d\x92\x6e\xc7\x0d\x1a\xaf\xf1\x5b\x63\xb7\x41\xd1\x31\xfc\xdc\x41\x70\xf8\xba\x65\xe8\x21\x8c\xcf\xe2\xfe\xf0\x31\x24\xbf\xe6\xbc\x9d\x11\x32\x26\x68\x22\x90\x3b\x54\x8a\x77\x5b\x8e\x54\xf6\x6b\xab\xfb\xfa\xc1\xc6\x3e\x8b\xd8\x49\x85\x65\xa5\xdd\x9f\x93\xf1\x58\x47\x3e\x88\x90\x3b\x28\xf2\xb6\x8d\xfe\x13\x00\x00\xff\xff\xa2\x10\x09\x07\x2d\x16\x00\x00") func templateEntTmplBytes() ([]byte, error) { return bindataRead( @@ -881,7 +881,7 @@ func templateEntTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/ent.tmpl", size: 5654, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/ent.tmpl", size: 5677, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1106,7 +1106,7 @@ func templateTxTmpl() (*asset, error) { return a, nil } -var _templateWhereTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x57\xdf\x6f\xdb\x36\x10\x7e\xb6\xfe\x8a\x83\xa0\x62\x72\xd1\x50\x5d\xdf\x36\x20\x0f\x59\x93\xae\x1e\x86\xa4\x5b\x8a\xed\xa1\x28\x06\x46\x3c\x59\x44\x64\x52\x25\x69\xa7\x81\xa0\xff\x7d\x38\x52\xbf\xec\x38\x89\xb3\x06\x43\xf3\xe4\x90\xc7\xfb\xf1\xdd\xf7\x1d\xc5\xa6\xc9\x5e\x46\x6f\x75\x7d\x6b\xe4\xb2\x74\xf0\xe6\xf5\x8f\x3f\x1d\xd5\x06\x2d\x2a\x07\xef\x78\x8e\x57\x5a\x5f\xc3\x42\xe5\x0c\x4e\xaa\x0a\xbc\x91\x05\xda\x37\x1b\x14\x2c\xfa\x58\x4a\x0b\x56\xaf\x4d\x8e\x90\x6b\x81\x20\x2d\x54\x32\x47\x65\x51\xc0\x5a\x09\x34\xe0\x4a\x84\x93\x9a\xe7\x25\xc2\x1b\xf6\xba\xdf\x85\x42\xaf\x95\x88\xa4\xf2\xfb\xbf\x2f\xde\x9e\x9d\x5f\x9e\x41\x21\x2b\x84\x6e\xcd\x68\xed\x40\x48\x83\xb9\xd3\xe6\x16\x74\x01\x6e\x12\xcc\x19\x44\x16\xbd\xcc\xda\x36\x8a\x9a\x06\x04\x16\x52\x21\xc4\x37\x25\x1a\x8c\x21\xac\x1e\xc1\x8d\x74\x25\xe0\x57\x87\x4a\x40\x02\xf1\x07\x9e\x5f\xf3\x25\xc6\x90\xb0\xee\x27\x1c\xb5\x6d\x34\x6b\x1a\x70\xb8\xaa\x2b\xee\x10\xe2\x12\xb9\x40\x13\x03\x23\x2f\x4d\x03\x74\xb6\x8b\x32\x1a\xc9\x55\xad\x8d\x8b\x21\xf1\x5b\x59\x06\x8b\x53\x4a\xde\xa1\xb1\xb0\x41\xe3\x64\x8e\x16\xae\x38\xa1\xa0\x7d\x39\xd2\x80\x14\xa8\x9c\x2c\x24\x1a\x16\x15\x6b\x95\xc3\xe2\x34\x95\x02\x9a\x06\x12\xb6\x38\x65\x1f\x6f\x6b\x84\xb6\x9d\x43\x6d\x50\xc8\x9c\x3b\x64\x7e\xeb\x9c\xaf\x68\x1d\x9a\x68\x66\xd0\xad\x8d\xba\xc7\x20\x8d\x66\x33\xaa\x39\x71\xab\xba\x82\x9f\x8f\xa1\x36\x52\xb9\x02\x62\x21\x79\x85\xb9\xcb\x5e\xd8\x6c\x38\x99\x49\x41\x28\x5c\x3a\x6d\x08\x05\x02\xc1\x1f\xfe\x3a\x94\x18\xdc\x24\x01\xa0\x79\x14\x00\x30\x5c\x2d\x11\x12\x5d\x93\x7f\x5d\x5b\x9f\x39\x74\x10\x26\xdc\x2c\x69\x3d\x26\xdf\x6d\xdb\x34\x20\x0b\xb2\x65\x7f\x71\x23\xb9\x90\x79\x58\xf4\x66\xde\xca\x76\x66\x1d\xc2\xde\x87\x07\x66\x92\xfc\xe2\xf4\x85\x8d\xbd\x97\xae\xcc\x68\x96\x65\x30\x58\xb6\x2d\xf0\xba\xae\x24\x5a\xcf\x19\x5a\x1f\x4d\x47\xa0\xba\x26\x84\x2e\x61\x25\x58\x34\xf3\xc7\x27\x7e\xd2\x3e\x35\x82\x7a\x5f\xea\x8c\xb1\x21\xd7\x27\xf4\xec\xf1\xa6\xcd\xf6\x30\xf5\xc4\x2c\xe3\x90\x4e\x7c\x51\xfb\xfa\x21\xee\x9a\x35\xed\x9b\x6f\x8e\xf7\x70\x70\xdb\x33\x5d\xdb\x3b\xad\xdf\xdf\x7c\xd6\x6d\xd2\x1e\xe5\x15\xa2\xcd\xa3\xd9\xae\x2e\x3a\x5a\x14\x14\x3e\x61\xef\x08\x61\xdb\x75\x34\x7b\x09\xbf\x5d\x5e\x9c\x43\xce\x95\xd2\x0e\xae\x68\x4c\xac\x6a\x6e\x68\x3c\x58\xa9\x96\x10\x1f\xc7\xc0\x95\x80\x33\xb5\x5e\x41\xc9\x2d\x70\x70\x84\x6a\x50\xb4\x08\xc0\x50\xef\x7c\xe3\x40\x11\x6e\x5e\xf6\xbe\xe8\x92\xdb\x0f\x14\x95\x7c\xa7\xda\x40\x52\xb0\x85\xf5\x01\xfd\x2f\x72\x3a\x1f\xb8\x15\x22\xf3\xab\x0a\x3d\x7d\x0d\xa4\x74\x2c\x29\xd8\x7b\x6e\x7f\xd5\xd4\xcb\x39\xa4\x49\xc1\x7e\xe1\x56\xe6\xbe\xb5\xf1\x26\xee\x8f\x1f\x11\x25\x28\xd1\x10\x73\xea\xac\x6d\x23\xe8\xfe\xa6\x32\xd8\xc4\xbd\xae\x46\x5a\x27\x05\xbb\x74\x66\x9d\x3b\x0f\x52\xd8\xbf\x87\xcf\xf8\x65\xcd\x2b\xe9\x6e\x21\x2f\x31\xbf\xbe\xcb\xe5\xa6\x81\x2f\x6b\x4d\xcd\x2a\x06\xbe\x05\x72\xc3\xc2\xfd\x60\xbb\x71\x93\xf3\x0a\x9c\x9e\x06\x38\xfb\x83\x45\xb3\xc7\xe8\x9f\x14\x07\x71\xbb\xc7\x65\x8a\x61\xcf\xa8\x8d\x2f\x38\xf8\xda\x42\x74\x8a\xd7\x2e\x6e\x04\x5b\x7e\xc7\xa2\x27\x60\xf0\xfc\xb8\xa0\x1e\x51\x94\xc7\x3e\x26\xbe\xf6\xfa\x39\x5c\x40\x45\x77\x76\x57\x3f\x0f\x0a\x68\x47\x41\x24\xa1\x59\x47\xaa\xae\xac\x83\xf5\x44\xa3\xc0\x0e\xd3\xb7\xe8\x57\x7d\xb1\x43\x52\xec\xa2\xb6\x23\xf7\xc8\xf2\x98\x68\x85\x4a\xd8\xf0\x6f\x9a\xf3\xaa\xda\xb1\x4f\x8a\x41\x29\x93\x81\xbc\x35\xf1\xfd\xd9\xdd\x69\xbf\x39\x64\xd8\x6f\x1e\x9d\xf5\xbb\xd2\xd8\x1a\xf9\xbe\x3d\x44\x9f\x20\x21\x62\x12\x19\xd3\xfc\x18\x62\xf7\x7a\xef\x02\x7b\xf3\x63\x70\x46\xae\xfa\xbb\x3e\xac\x8d\x77\xff\x56\x42\xdf\x70\xab\xdc\xaf\xc4\xfd\xd7\x8c\x2c\xfc\xbc\xf2\x3e\x65\xb5\x03\xd6\xa1\xd7\x8f\x0b\x52\x1b\xd6\x1e\xd4\x69\x2f\xd3\x6d\x97\x44\xc5\x0d\x41\xba\xe2\xd7\x98\x7e\xfa\x2c\x95\x43\x53\xf0\x1c\x9b\xf6\x15\x54\xa8\x26\x33\x61\x4e\x94\x9d\x15\xda\x80\xa4\x03\x81\x15\x9b\x30\x03\x66\x9b\x4f\xf2\x33\x1c\xc3\x68\xfd\x49\x7e\xa6\x8d\xee\xf2\x18\x49\x10\x8f\x1f\x1a\x58\x59\xec\x27\x6a\xba\x83\xc6\x7c\xdf\x3c\x79\x70\x9c\xec\xc4\xc9\xa7\x81\xfa\xb9\xf1\xad\xf7\xf0\x38\x35\x9e\xf7\x4a\xf6\x4c\x79\x9e\x5b\x79\xa2\xdd\xbd\x03\xe5\x9f\x57\x90\x04\x0d\xb1\x33\xb1\x44\x7b\x8f\x12\xe3\xf7\x9c\x92\xc1\x3b\x57\xd5\x03\x1a\x79\xcf\x2d\xb9\x7c\x48\x1c\x38\x50\x12\xc5\x12\xf7\x69\xe3\xf9\xbf\xa3\x28\x27\x2a\xe5\xe9\x6d\xa1\x1c\xb3\x92\x3f\x53\x57\x42\x89\x63\xc8\x17\xf6\x6f\xe9\xca\x78\x28\xfd\x79\xb1\x0d\x28\x70\x58\xca\x0d\x2a\xc8\xb5\x12\xd2\x49\xad\x2c\xa4\xda\x95\x68\x46\x47\x76\xbe\xaf\x0d\xb4\x6d\x81\x31\xb6\x8d\x35\x86\xb9\xdb\x05\xfa\x1e\x7b\x75\x13\x30\x7d\xbe\x6f\xdb\x2c\x83\x13\x25\x60\x69\xf4\xba\xa6\x87\xad\x75\xf4\x0e\x1d\xe1\x1b\xbf\x4e\x4f\xce\x4f\x41\xd7\x68\xb8\xd3\x06\xae\xd0\xdd\x20\xfa\x1e\xad\xba\xb7\xde\x89\x12\xe9\xe4\xdc\x1d\x70\x0f\x81\xf5\x09\xcf\xbf\x47\x00\xe3\xea\xb0\xe7\x1f\x9b\x3c\xff\xb2\x0c\x2e\xcc\x21\x50\x5c\xfc\xf9\x20\x12\x17\xe6\x3b\x02\x42\x9b\xff\x82\xc3\xb9\x76\x5b\x02\xa5\xfb\x6b\x28\xb9\xd3\x66\xd0\xde\x98\x62\x28\xfe\x5c\xbb\xb4\xbe\x27\xf1\xff\xa7\x62\xa5\xdd\x93\x4b\x1e\x15\xf1\x6f\x00\x00\x00\xff\xff\x1f\xb0\xc8\x6c\x2f\x12\x00\x00") +var _templateWhereTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x57\xdf\x6f\xdb\x36\x10\x7e\xb6\xfe\x8a\x83\xa0\x62\x76\xd1\x50\x5d\xdf\x36\x20\x0f\x59\x93\xae\x1e\x86\xa4\x5b\x8a\xed\xa1\x28\x06\x46\x3c\x59\x44\x64\x52\x25\x69\xa5\x81\xa0\xff\x7d\x38\x52\xbf\xec\x38\x89\xb3\x06\x43\xf3\xe4\x90\xc7\xfb\xf1\xdd\xf7\x1d\xc5\xa6\x49\x5f\x46\x6f\x75\x75\x6b\xe4\xaa\x70\xf0\xe6\xf5\x8f\x3f\x1d\x55\x06\x2d\x2a\x07\xef\x78\x86\x57\x5a\x5f\xc3\x52\x65\x0c\x4e\xca\x12\xbc\x91\x05\xda\x37\x35\x0a\x16\x7d\x2c\xa4\x05\xab\x37\x26\x43\xc8\xb4\x40\x90\x16\x4a\x99\xa1\xb2\x28\x60\xa3\x04\x1a\x70\x05\xc2\x49\xc5\xb3\x02\xe1\x0d\x7b\xdd\xef\x42\xae\x37\x4a\x44\x52\xf9\xfd\xdf\x97\x6f\xcf\xce\x2f\xcf\x20\x97\x25\x42\xb7\x66\xb4\x76\x20\xa4\xc1\xcc\x69\x73\x0b\x3a\x07\x37\x09\xe6\x0c\x22\x8b\x5e\xa6\x6d\x1b\x45\x4d\x03\x02\x73\xa9\x10\xe2\x9b\x02\x0d\xc6\x10\x56\x8f\xe0\x46\xba\x02\xf0\xab\x43\x25\x20\x81\xf8\x03\xcf\xae\xf9\x0a\x63\x48\x58\xf7\x13\x8e\xda\x36\x9a\x35\x0d\x38\x5c\x57\x25\x77\x08\x71\x81\x5c\xa0\x89\x81\x91\x97\xa6\x01\x3a\xdb\x45\x19\x8d\xe4\xba\xd2\xc6\xc5\x90\xf8\xad\x34\x85\xe5\x29\x25\xef\xd0\x58\xa8\xd1\x38\x99\xa1\x85\x2b\x4e\x28\x68\x5f\x8e\x34\x20\x05\x2a\x27\x73\x89\x86\x45\xf9\x46\x65\xb0\x3c\x9d\x4b\x01\x4d\x03\x09\x5b\x9e\xb2\x8f\xb7\x15\x42\xdb\x2e\xa0\x32\x28\x64\xc6\x1d\x32\xbf\x75\xce\xd7\xb4\x0e\x4d\x34\x33\xe8\x36\x46\xdd\x63\x30\x8f\x66\x33\xaa\x39\x71\xeb\xaa\x84\x9f\x8f\xa1\x32\x52\xb9\x1c\x62\x21\x79\x89\x99\x4b\x5f\xd8\x74\x38\x99\x4a\x41\x28\x5c\x3a\x6d\x08\x05\x02\xc1\x1f\xfe\x3a\x94\x18\xdc\x24\x01\xa0\x45\x14\x00\x30\x5c\xad\x10\x12\x5d\x91\x7f\x5d\x59\x9f\x39\x74\x10\x26\xdc\xac\x68\x3d\x26\xdf\x6d\xdb\x34\x20\x73\xb2\x65\x7f\x71\x23\xb9\x90\x59\x58\xf4\x66\xde\xca\x76\x66\x1d\xc2\xde\x87\x07\x66\x92\xfc\xf2\xf4\x85\x8d\xbd\x97\xae\xcc\x68\x96\xa6\x30\x58\xb6\x2d\xf0\xaa\x2a\x25\x5a\xcf\x19\x5a\x1f\x4d\x47\xa0\xba\x26\x84\x2e\x61\x29\x58\x34\xf3\xc7\x27\x7e\xe6\x7d\x6a\x04\xf5\xbe\xd4\x19\x63\x43\xae\x4f\xe8\xd9\xe3\x4d\x9b\xed\x61\xea\x89\x59\xc5\x21\x9d\xf8\xa2\xf2\xf5\x43\xdc\x35\x6b\xda\x37\xdf\x1c\xef\xe1\xe0\xb6\xa7\xba\xb2\x77\x5a\xbf\xbf\xf9\xac\xdb\xa4\x3d\xca\x2b\x44\x5b\x44\xb3\x5d\x5d\x74\xb4\xc8\x29\x7c\xc2\xde\x11\xc2\xb6\xeb\x68\xfa\x12\x7e\xbb\xbc\x38\x87\x8c\x2b\xa5\x1d\x5c\xd1\x98\x58\x57\xdc\xd0\x78\xb0\x52\xad\x20\x3e\x8e\x81\x2b\x01\x67\x6a\xb3\x86\x82\x5b\xe0\xe0\x08\xd5\xa0\x68\x11\x80\xa1\xde\xf9\xc6\x81\x22\xdc\xbc\xec\x7d\xd1\x05\xb7\x1f\x28\x2a\xf9\x9e\x6b\x03\x49\xce\x96\xd6\x07\xf4\xbf\xc8\xe9\x62\xe0\x56\x88\xcc\xaf\x4a\xf4\xf4\x35\x30\xa7\x63\x49\xce\xde\x73\xfb\xab\xa6\x5e\x2e\x60\x9e\xe4\xec\x17\x6e\x65\xe6\x5b\x1b\xd7\x71\x7f\xfc\x88\x28\x41\x89\x86\x98\x53\x67\x6d\x1b\x41\xf7\x37\x95\x41\x1d\xf7\xba\x1a\x69\x9d\xe4\xec\xd2\x99\x4d\xe6\x3c\x48\x61\xff\x1e\x3e\xe3\x97\x0d\x2f\xa5\xbb\x85\xac\xc0\xec\xfa\x2e\x97\x9b\x06\xbe\x6c\x34\x35\x2b\x1f\xf8\x16\xc8\x0d\x4b\xf7\x83\xed\xc6\x4d\xc6\x4b\x70\x7a\x1a\xe0\xec\x0f\x16\xcd\x1e\xa3\x7f\x92\x1f\xc4\xed\x1e\x97\x29\x86\x3d\xa3\x6a\x5f\x70\xf0\xb5\x85\xe8\x14\xaf\x11\xb7\xa3\x61\x30\xd4\xd9\x1d\x93\x9e\x81\xc1\xf5\xe3\x8a\x7a\x44\x52\x1e\xfc\x98\x08\xdb\x0b\xe8\x70\x05\xe5\xdd\xd9\x5d\x01\x3d\xa8\xa0\x1d\x09\x91\x86\x66\x1d\xab\xba\xb2\x0e\x16\x14\xcd\x02\x3b\x8c\xdf\xbc\x5f\xf5\xc5\x0e\x49\xb1\x8b\xca\x8e\xe4\x23\xcb\x63\xe2\x15\x2a\x61\xc3\xbf\xf3\x8c\x97\xe5\x8e\x7d\x92\x0f\x52\x99\x4c\xe4\xad\x91\xef\xcf\xee\x8e\xfb\xfa\x90\x69\x5f\x3f\x3a\xec\x77\xb5\xb1\x35\xf3\x7d\x7b\x88\x3f\x41\x43\x44\x25\x32\xa6\x01\x32\xc4\xee\x05\xdf\x05\xf6\xe6\xc7\xe0\x8c\x5c\xf7\x97\x7d\x58\x1b\x2f\xff\xad\x84\xbe\xe1\x5a\xb9\x5f\x8a\xfb\xef\x19\x99\xfb\x81\xe5\x7d\xca\x72\x07\xac\x43\xef\x1f\x17\xb4\x36\xac\x3d\x28\xd4\x5e\xa7\xdb\x2e\x89\x8a\x35\x41\xba\xe6\xd7\x38\xff\xf4\x59\x2a\x87\x26\xe7\x19\x36\xed\x2b\x28\x51\x4d\x86\xc2\x82\x28\x3b\xcb\xb5\x01\x49\x07\x02\x2b\xea\x30\x04\x66\xf5\x27\xf9\x19\x8e\x61\xb4\xfe\x24\x3f\xd3\xc6\x70\x7b\x0c\x2c\x88\xc7\x4f\x0d\x2c\x2d\xf6\x33\x75\xbe\x03\xc7\x62\xdf\x44\x79\x70\xa0\xec\x06\xca\xa6\x91\xfa\xc9\xf1\xad\x57\xf1\x38\x37\x9e\xf7\x56\xf6\x5c\x79\x9e\x8b\x79\xa2\xde\xbd\x23\xe5\x9f\x57\x90\x04\x15\xb1\x33\xb1\x42\x7b\x8f\x16\xe3\xf7\x9c\x92\xc1\x3b\xb7\xd5\x03\x2a\x79\xcf\x2d\xb9\x7c\x48\x1e\x38\x90\x12\xc5\x0a\xf7\xa9\xe3\xf9\x3f\xa5\x28\x27\x2a\xe5\xe9\x6d\xa1\x1c\xd3\x82\x3f\x53\x57\x42\x89\x63\xc8\x17\xf6\x6f\xe9\x8a\x78\x28\xfd\x79\xb1\x0d\x28\x70\x58\xc9\x1a\x15\x64\x5a\x09\xe9\xa4\x56\x16\xe6\xda\x15\x68\x46\x47\x76\xb1\xaf\x0d\xb4\x6d\x81\x31\xb6\x8d\x35\x86\xc9\xdb\x05\xfa\x1e\x7b\x75\x13\x30\x7d\xbe\xcf\xdb\x34\x85\x13\x25\x60\x65\xf4\xa6\xa2\xb7\xad\x75\xf4\x14\x1d\xe1\x1b\x3f\x50\x4f\xce\x4f\x41\x57\x68\xb8\xd3\x06\xae\xd0\xdd\x20\xfa\x1e\xad\xbb\xe7\xde\x89\x12\xf3\xc9\xb9\x3b\xe0\x1e\x02\xeb\x13\x5e\x80\x8f\x00\xc6\xd5\x61\x2f\x40\x36\x79\x01\xa6\x29\x5c\x98\x43\xa0\xb8\xf8\xf3\x41\x24\x2e\xcc\x77\x04\x84\x36\xff\x05\x87\x73\xed\xb6\x04\x4a\x17\xd8\x50\x72\xa7\xcd\xa0\xbd\x31\xc5\x50\xfc\xb9\x76\xf3\xea\x9e\xc4\xff\x9f\x8a\x95\x76\x4f\x2e\x79\x54\xc4\xbf\x01\x00\x00\xff\xff\xf7\x8d\xd8\x59\x32\x12\x00\x00") func templateWhereTmplBytes() ([]byte, error) { return bindataRead( @@ -1121,7 +1121,7 @@ func templateWhereTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/where.tmpl", size: 4655, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/where.tmpl", size: 4658, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/dialect/gremlin/predicate.tmpl b/entc/gen/template/dialect/gremlin/predicate.tmpl index 41fc540de..4af0bbdbc 100644 --- a/entc/gen/template/dialect/gremlin/predicate.tmpl +++ b/entc/gen/template/dialect/gremlin/predicate.tmpl @@ -27,20 +27,22 @@ in the LICENSE file in the root directory of this source tree. {{ define "dialect/gremlin/predicate/field" -}} {{- $f := $.Scope.Field -}} + {{- $arg := $.Scope.Arg -}} func(t *dsl.Traversal) { - t.Has(Label, {{ $f.Constant }}, p.EQ(v)) + t.Has(Label, {{ $f.Constant }}, p.EQ({{ $arg }})) } {{- end }} {{ define "dialect/gremlin/predicate/field/ops" -}} {{- $f := $.Scope.Field -}} {{- $op := $.Scope.Op -}} + {{- $arg := $.Scope.Arg -}} {{- $storage := $.Scope.Storage -}} func(t *dsl.Traversal) { {{- if not $op.Niladic }} - t.Has(Label, {{ $f.Constant }}, p.{{ call $storage.OpCode $op }}(v{{ if $op.Variadic }}...{{ end }})) + t.Has(Label, {{ $f.Constant }}, p.{{ call $storage.OpCode $op }}({{ $arg }}{{ if $op.Variadic }}...{{ end }})) {{- else }} - t.HasLabel(Label).{{ call $storage.OpCode $op }}({{ $f.Constant }}) + t.HasLabel(Label).{{ call $storage.OpCode $op }}({{ $f.Constant }}) {{- end }} } {{- end }} @@ -128,4 +130,4 @@ in the LICENSE file in the root directory of this source tree. p(t) tr.Where(__.Not(t)) } -{{- end }} \ No newline at end of file +{{- end }} diff --git a/entc/gen/template/ent.tmpl b/entc/gen/template/ent.tmpl index d0c5d77d4..a9cf17db6 100644 --- a/entc/gen/template/ent.tmpl +++ b/entc/gen/template/ent.tmpl @@ -121,7 +121,7 @@ func ({{ $receiver }} *{{ $.Name }}) String() string { builder.WriteString(", {{ $f.Name }}=") {{- if $f.IsTime }} builder.WriteString({{ $sf }}.Format(time.ANSIC)) - {{- else if $f.IsString }} + {{- else if and $f.IsString (not $f.HasGoType) }} builder.WriteString({{ $sf }}) {{- else }} builder.WriteString(fmt.Sprintf("%v", {{ $sf }})) diff --git a/entc/gen/template/where.tmpl b/entc/gen/template/where.tmpl index 79370ff41..7c21bd07e 100644 --- a/entc/gen/template/where.tmpl +++ b/entc/gen/template/where.tmpl @@ -45,7 +45,7 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { func {{ $func }}({{ $arg }} {{ $f.Type }}) predicate.{{ $.Name }} { {{- if $f.HasGoType }} vc := {{ $f.BasicType "v" }} - {{ $arg = "vc" }} + {{- $arg = "vc" }} {{- end }} return predicate.{{ $.Name }}( {{- with extend $ "Arg" $arg "Field" $f -}} @@ -73,10 +73,10 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { for i := range v { v[i] = {{ $arg }}[i] } - {{ $arg = "v" }} + {{- $arg = "v" }} {{- else if and (not $op.Niladic) $f.HasGoType }} vc := {{ $f.BasicType "v" }} - {{ $arg = "vc" }} + {{- $arg = "vc" }} {{- end }} return predicate.{{ $.Name }}( {{- with extend $ "Arg" $arg "Field" $f "Op" $op "Storage" $.Storage -}} diff --git a/entc/gen/type.go b/entc/gen/type.go index b5c7db924..34be84d4d 100644 --- a/entc/gen/type.go +++ b/entc/gen/type.go @@ -695,20 +695,21 @@ func (f Field) NullType() string { // NullTypeField extracts the nullable type field (if exists) from the given receiver. // It also does the type conversion if needed. func (f Field) NullTypeField(rec string) string { + expr := rec switch f.Type.Type { case field.TypeEnum: - return fmt.Sprintf("%s(%s.String)", f.Type, rec) + expr = fmt.Sprintf("%s(%s.String)", f.Type, rec) case field.TypeString, field.TypeBool, field.TypeInt64, field.TypeFloat64: - return fmt.Sprintf("%s.%s", rec, strings.Title(f.Type.Type.String())) + expr = fmt.Sprintf("%s.%s", rec, strings.Title(f.Type.Type.String())) case field.TypeTime: - return fmt.Sprintf("%s.Time", rec) + expr = fmt.Sprintf("%s.Time", rec) case field.TypeFloat32: - return fmt.Sprintf("%s(%s.Float64)", f.Type, rec) + expr = fmt.Sprintf("%s(%s.Float64)", f.Type, rec) case field.TypeInt, field.TypeInt8, field.TypeInt16, field.TypeInt32, field.TypeUint, field.TypeUint8, field.TypeUint16, field.TypeUint32, field.TypeUint64: - return fmt.Sprintf("%s(%s.Int64)", f.Type, rec) + expr = fmt.Sprintf("%s(%s.Int64)", f.Type, rec) } - return rec + return f.goType(expr) } // Column returns the table column. It sets it as a primary key (auto_increment) in case of ID field. @@ -816,7 +817,16 @@ func (f Field) BasicType(ident string) (expr string) { expr = fmt.Sprintf("%s.String", ident) } } - return + return expr +} + +// goType returns the Go expression for the given basic-type +// identifier to covert it to the custom Go type. +func (f Field) goType(ident string) string { + if !f.HasGoType() { + return ident + } + return fmt.Sprintf("%s(%s)", f.Type, ident) } // Label returns the Gremlin label name of the edge. diff --git a/entc/integration/customid/ent/blob/where.go b/entc/integration/customid/ent/blob/where.go index dabb424af..006ba20ed 100644 --- a/entc/integration/customid/ent/blob/where.go +++ b/entc/integration/customid/ent/blob/where.go @@ -123,7 +123,6 @@ func UUIDIn(vs ...uuid.UUID) predicate.Blob { for i := range v { v[i] = vs[i] } - return predicate.Blob(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -141,7 +140,6 @@ func UUIDNotIn(vs ...uuid.UUID) predicate.Blob { for i := range v { v[i] = vs[i] } - return predicate.Blob(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/customid/ent/car/where.go b/entc/integration/customid/ent/car/where.go index 73358463d..04da644f0 100644 --- a/entc/integration/customid/ent/car/where.go +++ b/entc/integration/customid/ent/car/where.go @@ -122,7 +122,6 @@ func ModelIn(vs ...string) predicate.Car { for i := range v { v[i] = vs[i] } - return predicate.Car(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func ModelNotIn(vs ...string) predicate.Car { for i := range v { v[i] = vs[i] } - return predicate.Car(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/ent/card/where.go b/entc/integration/ent/card/where.go index 1744a79fc..fdeb7ac4f 100644 --- a/entc/integration/ent/card/where.go +++ b/entc/integration/ent/card/where.go @@ -145,7 +145,6 @@ func CreateTimeIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -163,7 +162,6 @@ func CreateTimeNotIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -223,7 +221,6 @@ func UpdateTimeIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -241,7 +238,6 @@ func UpdateTimeNotIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -301,7 +297,6 @@ func NumberIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -319,7 +314,6 @@ func NumberNotIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -414,7 +408,6 @@ func NameIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -432,7 +425,6 @@ func NameNotIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/ent/comment/where.go b/entc/integration/ent/comment/where.go index f5c56d887..f7660c3d6 100644 --- a/entc/integration/ent/comment/where.go +++ b/entc/integration/ent/comment/where.go @@ -135,7 +135,6 @@ func UniqueIntIn(vs ...int) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -153,7 +152,6 @@ func UniqueIntNotIn(vs ...int) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -213,7 +211,6 @@ func UniqueFloatIn(vs ...float64) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -231,7 +228,6 @@ func UniqueFloatNotIn(vs ...float64) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -291,7 +287,6 @@ func NillableIntIn(vs ...int) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -309,7 +304,6 @@ func NillableIntNotIn(vs ...int) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/ent/fieldtype.go b/entc/integration/ent/fieldtype.go index c4846e85c..58164f0b0 100644 --- a/entc/integration/ent/fieldtype.go +++ b/entc/integration/ent/fieldtype.go @@ -8,6 +8,7 @@ package ent import ( "fmt" + "net/http" "strings" "time" @@ -71,7 +72,9 @@ type FieldType struct { // Datetime holds the value of the "datetime" field. Datetime time.Time `json:"datetime,omitempty"` // Decimal holds the value of the "decimal" field. - Decimal float64 `json:"decimal,omitempty"` + Decimal float64 `json:"decimal,omitempty"` + // Dir holds the value of the "dir" field. + Dir http.Dir `json:"dir,omitempty"` file_field *int } @@ -105,6 +108,7 @@ func (*FieldType) scanValues() []interface{} { &sql.NullFloat64{}, // optional_float32 &sql.NullTime{}, // datetime &sql.NullFloat64{}, // decimal + &sql.NullString{}, // dir } } @@ -262,7 +266,12 @@ func (ft *FieldType) assignValues(values ...interface{}) error { } else if value.Valid { ft.Decimal = value.Float64 } - values = values[26:] + if value, ok := values[26].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field dir", values[26]) + } else if value.Valid { + ft.Dir = http.Dir(value.String) + } + values = values[27:] if len(values) == len(fieldtype.ForeignKeys) { if value, ok := values[0].(*sql.NullInt64); !ok { return fmt.Errorf("unexpected type %T for edge-field file_field", value) @@ -359,6 +368,8 @@ func (ft *FieldType) String() string { builder.WriteString(ft.Datetime.Format(time.ANSIC)) builder.WriteString(", decimal=") builder.WriteString(fmt.Sprintf("%v", ft.Decimal)) + builder.WriteString(", dir=") + builder.WriteString(fmt.Sprintf("%v", ft.Dir)) builder.WriteByte(')') return builder.String() } diff --git a/entc/integration/ent/fieldtype/fieldtype.go b/entc/integration/ent/fieldtype/fieldtype.go index d416dff84..88ed4dab4 100644 --- a/entc/integration/ent/fieldtype/fieldtype.go +++ b/entc/integration/ent/fieldtype/fieldtype.go @@ -40,7 +40,8 @@ const ( FieldOptionalFloat = "optional_float" // FieldOptionalFloat32 holds the string denoting the optional_float32 vertex property in the database. FieldOptionalFloat32 = "optional_float32" // FieldDatetime holds the string denoting the datetime vertex property in the database. FieldDatetime = "datetime" // FieldDecimal holds the string denoting the decimal vertex property in the database. - FieldDecimal = "decimal" + FieldDecimal = "decimal" // FieldDir holds the string denoting the dir vertex property in the database. + FieldDir = "dir" // Table holds the table name of the fieldtype in the database. Table = "field_types" @@ -75,6 +76,7 @@ var Columns = []string{ FieldOptionalFloat32, FieldDatetime, FieldDecimal, + FieldDir, } // ForeignKeys holds the SQL foreign-keys that are owned by the FieldType type. diff --git a/entc/integration/ent/fieldtype/where.go b/entc/integration/ent/fieldtype/where.go index fd0da3573..2092ee4c1 100644 --- a/entc/integration/ent/fieldtype/where.go +++ b/entc/integration/ent/fieldtype/where.go @@ -7,6 +7,7 @@ package fieldtype import ( + "net/http" "time" "github.com/facebookincubator/ent/dialect/sql" @@ -271,6 +272,14 @@ func Decimal(v float64) predicate.FieldType { }) } +// Dir applies equality check predicate on the "dir" field. It's identical to DirEQ. +func Dir(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldDir), vc)) + }) +} + // IntEQ applies the EQ predicate on the "int" field. func IntEQ(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { @@ -291,7 +300,6 @@ func IntIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -309,7 +317,6 @@ func IntNotIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -369,7 +376,6 @@ func Int8In(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -387,7 +393,6 @@ func Int8NotIn(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -447,7 +452,6 @@ func Int16In(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -465,7 +469,6 @@ func Int16NotIn(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -525,7 +528,6 @@ func Int32In(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -543,7 +545,6 @@ func Int32NotIn(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -603,7 +604,6 @@ func Int64In(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -621,7 +621,6 @@ func Int64NotIn(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -681,7 +680,6 @@ func OptionalIntIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -699,7 +697,6 @@ func OptionalIntNotIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -773,7 +770,6 @@ func OptionalInt8In(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -791,7 +787,6 @@ func OptionalInt8NotIn(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -865,7 +860,6 @@ func OptionalInt16In(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -883,7 +877,6 @@ func OptionalInt16NotIn(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -957,7 +950,6 @@ func OptionalInt32In(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -975,7 +967,6 @@ func OptionalInt32NotIn(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1049,7 +1040,6 @@ func OptionalInt64In(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1067,7 +1057,6 @@ func OptionalInt64NotIn(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1141,7 +1130,6 @@ func NillableIntIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1159,7 +1147,6 @@ func NillableIntNotIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1233,7 +1220,6 @@ func NillableInt8In(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1251,7 +1237,6 @@ func NillableInt8NotIn(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1325,7 +1310,6 @@ func NillableInt16In(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1343,7 +1327,6 @@ func NillableInt16NotIn(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1417,7 +1400,6 @@ func NillableInt32In(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1435,7 +1417,6 @@ func NillableInt32NotIn(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1509,7 +1490,6 @@ func NillableInt64In(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1527,7 +1507,6 @@ func NillableInt64NotIn(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1601,7 +1580,6 @@ func ValidateOptionalInt32In(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1619,7 +1597,6 @@ func ValidateOptionalInt32NotIn(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1693,7 +1670,6 @@ func OptionalUintIn(vs ...uint) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1711,7 +1687,6 @@ func OptionalUintNotIn(vs ...uint) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1785,7 +1760,6 @@ func OptionalUint8In(vs ...uint8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1803,7 +1777,6 @@ func OptionalUint8NotIn(vs ...uint8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1877,7 +1850,6 @@ func OptionalUint16In(vs ...uint16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1895,7 +1867,6 @@ func OptionalUint16NotIn(vs ...uint16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1969,7 +1940,6 @@ func OptionalUint32In(vs ...uint32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1987,7 +1957,6 @@ func OptionalUint32NotIn(vs ...uint32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2061,7 +2030,6 @@ func OptionalUint64In(vs ...uint64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2079,7 +2047,6 @@ func OptionalUint64NotIn(vs ...uint64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2153,7 +2120,6 @@ func StateIn(vs ...State) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2171,7 +2137,6 @@ func StateNotIn(vs ...State) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2217,7 +2182,6 @@ func OptionalFloatIn(vs ...float64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2235,7 +2199,6 @@ func OptionalFloatNotIn(vs ...float64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2309,7 +2272,6 @@ func OptionalFloat32In(vs ...float32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2327,7 +2289,6 @@ func OptionalFloat32NotIn(vs ...float32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2401,7 +2362,6 @@ func DatetimeIn(vs ...time.Time) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2419,7 +2379,6 @@ func DatetimeNotIn(vs ...time.Time) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2493,7 +2452,6 @@ func DecimalIn(vs ...float64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2511,7 +2469,6 @@ func DecimalNotIn(vs ...float64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -2565,6 +2522,142 @@ func DecimalNotNil() predicate.FieldType { }) } +// DirEQ applies the EQ predicate on the "dir" field. +func DirEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldDir), vc)) + }) +} + +// DirNEQ applies the NEQ predicate on the "dir" field. +func DirNEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.NEQ(s.C(FieldDir), vc)) + }) +} + +// DirIn applies the In predicate on the "dir" field. +func DirIn(vs ...http.Dir) predicate.FieldType { + v := make([]interface{}, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.FieldType(func(s *sql.Selector) { + // if not arguments were provided, append the FALSE constants, + // since we can't apply "IN ()". This will make this predicate falsy. + if len(v) == 0 { + s.Where(sql.False()) + return + } + s.Where(sql.In(s.C(FieldDir), v...)) + }) +} + +// DirNotIn applies the NotIn predicate on the "dir" field. +func DirNotIn(vs ...http.Dir) predicate.FieldType { + v := make([]interface{}, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.FieldType(func(s *sql.Selector) { + // if not arguments were provided, append the FALSE constants, + // since we can't apply "IN ()". This will make this predicate falsy. + if len(v) == 0 { + s.Where(sql.False()) + return + } + s.Where(sql.NotIn(s.C(FieldDir), v...)) + }) +} + +// DirGT applies the GT predicate on the "dir" field. +func DirGT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.GT(s.C(FieldDir), vc)) + }) +} + +// DirGTE applies the GTE predicate on the "dir" field. +func DirGTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.GTE(s.C(FieldDir), vc)) + }) +} + +// DirLT applies the LT predicate on the "dir" field. +func DirLT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.LT(s.C(FieldDir), vc)) + }) +} + +// DirLTE applies the LTE predicate on the "dir" field. +func DirLTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.LTE(s.C(FieldDir), vc)) + }) +} + +// DirContains applies the Contains predicate on the "dir" field. +func DirContains(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.Contains(s.C(FieldDir), vc)) + }) +} + +// DirHasPrefix applies the HasPrefix predicate on the "dir" field. +func DirHasPrefix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.HasPrefix(s.C(FieldDir), vc)) + }) +} + +// DirHasSuffix applies the HasSuffix predicate on the "dir" field. +func DirHasSuffix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.HasSuffix(s.C(FieldDir), vc)) + }) +} + +// DirIsNil applies the IsNil predicate on the "dir" field. +func DirIsNil() predicate.FieldType { + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.IsNull(s.C(FieldDir))) + }) +} + +// DirNotNil applies the NotNil predicate on the "dir" field. +func DirNotNil() predicate.FieldType { + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.NotNull(s.C(FieldDir))) + }) +} + +// DirEqualFold applies the EqualFold predicate on the "dir" field. +func DirEqualFold(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.EqualFold(s.C(FieldDir), vc)) + }) +} + +// DirContainsFold applies the ContainsFold predicate on the "dir" field. +func DirContainsFold(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(s *sql.Selector) { + s.Where(sql.ContainsFold(s.C(FieldDir), vc)) + }) +} + // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.FieldType) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { diff --git a/entc/integration/ent/fieldtype_create.go b/entc/integration/ent/fieldtype_create.go index d34657152..32f6256e7 100644 --- a/entc/integration/ent/fieldtype_create.go +++ b/entc/integration/ent/fieldtype_create.go @@ -10,6 +10,7 @@ import ( "context" "errors" "fmt" + "net/http" "time" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" @@ -348,6 +349,20 @@ func (ftc *FieldTypeCreate) SetNillableDecimal(f *float64) *FieldTypeCreate { return ftc } +// SetDir sets the dir field. +func (ftc *FieldTypeCreate) SetDir(h http.Dir) *FieldTypeCreate { + ftc.mutation.SetDir(h) + return ftc +} + +// SetNillableDir sets the dir field if the given value is not nil. +func (ftc *FieldTypeCreate) SetNillableDir(h *http.Dir) *FieldTypeCreate { + if h != nil { + ftc.SetDir(*h) + } + return ftc +} + // Save creates the FieldType in the database. func (ftc *FieldTypeCreate) Save(ctx context.Context) (*FieldType, error) { if _, ok := ftc.mutation.Int(); !ok { @@ -630,6 +645,14 @@ func (ftc *FieldTypeCreate) sqlSave(ctx context.Context) (*FieldType, error) { }) ft.Decimal = value } + if value, ok := ftc.mutation.Dir(); ok { + _spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{ + Type: field.TypeString, + Value: value, + Column: fieldtype.FieldDir, + }) + ft.Dir = value + } if err := sqlgraph.CreateNode(ctx, ftc.driver, _spec); err != nil { if cerr, ok := isSQLConstraintError(err); ok { err = cerr diff --git a/entc/integration/ent/fieldtype_update.go b/entc/integration/ent/fieldtype_update.go index 87b2fedd8..428b1c6fe 100644 --- a/entc/integration/ent/fieldtype_update.go +++ b/entc/integration/ent/fieldtype_update.go @@ -9,6 +9,7 @@ package ent import ( "context" "fmt" + "net/http" "time" "github.com/facebookincubator/ent/dialect/sql" @@ -650,6 +651,26 @@ func (ftu *FieldTypeUpdate) ClearDecimal() *FieldTypeUpdate { return ftu } +// SetDir sets the dir field. +func (ftu *FieldTypeUpdate) SetDir(h http.Dir) *FieldTypeUpdate { + ftu.mutation.SetDir(h) + return ftu +} + +// SetNillableDir sets the dir field if the given value is not nil. +func (ftu *FieldTypeUpdate) SetNillableDir(h *http.Dir) *FieldTypeUpdate { + if h != nil { + ftu.SetDir(*h) + } + return ftu +} + +// ClearDir clears the value of dir. +func (ftu *FieldTypeUpdate) ClearDir() *FieldTypeUpdate { + ftu.mutation.ClearDir() + return ftu +} + // Save executes the query and returns the number of rows/vertices matched by this operation. func (ftu *FieldTypeUpdate) Save(ctx context.Context) (int, error) { if v, ok := ftu.mutation.ValidateOptionalInt32(); ok { @@ -1205,6 +1226,19 @@ func (ftu *FieldTypeUpdate) sqlSave(ctx context.Context) (n int, err error) { Column: fieldtype.FieldDecimal, }) } + if value, ok := ftu.mutation.Dir(); ok { + _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ + Type: field.TypeString, + Value: value, + Column: fieldtype.FieldDir, + }) + } + if ftu.mutation.DirCleared() { + _spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: fieldtype.FieldDir, + }) + } if n, err = sqlgraph.UpdateNodes(ctx, ftu.driver, _spec); err != nil { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{fieldtype.Label} @@ -1841,6 +1875,26 @@ func (ftuo *FieldTypeUpdateOne) ClearDecimal() *FieldTypeUpdateOne { return ftuo } +// SetDir sets the dir field. +func (ftuo *FieldTypeUpdateOne) SetDir(h http.Dir) *FieldTypeUpdateOne { + ftuo.mutation.SetDir(h) + return ftuo +} + +// SetNillableDir sets the dir field if the given value is not nil. +func (ftuo *FieldTypeUpdateOne) SetNillableDir(h *http.Dir) *FieldTypeUpdateOne { + if h != nil { + ftuo.SetDir(*h) + } + return ftuo +} + +// ClearDir clears the value of dir. +func (ftuo *FieldTypeUpdateOne) ClearDir() *FieldTypeUpdateOne { + ftuo.mutation.ClearDir() + return ftuo +} + // Save executes the query and returns the updated entity. func (ftuo *FieldTypeUpdateOne) Save(ctx context.Context) (*FieldType, error) { if v, ok := ftuo.mutation.ValidateOptionalInt32(); ok { @@ -2394,6 +2448,19 @@ func (ftuo *FieldTypeUpdateOne) sqlSave(ctx context.Context) (ft *FieldType, err Column: fieldtype.FieldDecimal, }) } + if value, ok := ftuo.mutation.Dir(); ok { + _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ + Type: field.TypeString, + Value: value, + Column: fieldtype.FieldDir, + }) + } + if ftuo.mutation.DirCleared() { + _spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: fieldtype.FieldDir, + }) + } ft = &FieldType{config: ftuo.config} _spec.Assign = ft.assignValues _spec.ScanValues = ft.scanValues() diff --git a/entc/integration/ent/file/where.go b/entc/integration/ent/file/where.go index aedfa1663..8dd51c08e 100644 --- a/entc/integration/ent/file/where.go +++ b/entc/integration/ent/file/where.go @@ -143,7 +143,6 @@ func SizeIn(vs ...int) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -161,7 +160,6 @@ func SizeNotIn(vs ...int) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -221,7 +219,6 @@ func NameIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -239,7 +236,6 @@ func NameNotIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -334,7 +330,6 @@ func UserIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -352,7 +347,6 @@ func UserNotIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -461,7 +455,6 @@ func GroupIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -479,7 +472,6 @@ func GroupNotIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/ent/filetype/where.go b/entc/integration/ent/filetype/where.go index fb9c2be8b..6a0f1e208 100644 --- a/entc/integration/ent/filetype/where.go +++ b/entc/integration/ent/filetype/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.FileType { for i := range v { v[i] = vs[i] } - return predicate.FileType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.FileType { for i := range v { v[i] = vs[i] } - return predicate.FileType(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/ent/group/where.go b/entc/integration/ent/group/where.go index 14ca204c2..347ddcca9 100644 --- a/entc/integration/ent/group/where.go +++ b/entc/integration/ent/group/where.go @@ -166,7 +166,6 @@ func ExpireIn(vs ...time.Time) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -184,7 +183,6 @@ func ExpireNotIn(vs ...time.Time) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -244,7 +242,6 @@ func TypeIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -262,7 +259,6 @@ func TypeNotIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -371,7 +367,6 @@ func MaxUsersIn(vs ...int) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -389,7 +384,6 @@ func MaxUsersNotIn(vs ...int) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -463,7 +457,6 @@ func NameIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -481,7 +474,6 @@ func NameNotIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/ent/groupinfo/where.go b/entc/integration/ent/groupinfo/where.go index 0fb0fd016..8df30afda 100644 --- a/entc/integration/ent/groupinfo/where.go +++ b/entc/integration/ent/groupinfo/where.go @@ -129,7 +129,6 @@ func DescIn(vs ...string) predicate.GroupInfo { for i := range v { v[i] = vs[i] } - return predicate.GroupInfo(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func DescNotIn(vs ...string) predicate.GroupInfo { for i := range v { v[i] = vs[i] } - return predicate.GroupInfo(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -242,7 +240,6 @@ func MaxUsersIn(vs ...int) predicate.GroupInfo { for i := range v { v[i] = vs[i] } - return predicate.GroupInfo(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -260,7 +257,6 @@ func MaxUsersNotIn(vs ...int) predicate.GroupInfo { for i := range v { v[i] = vs[i] } - return predicate.GroupInfo(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/ent/migrate/schema.go b/entc/integration/ent/migrate/schema.go index 7b88bc998..6f5267323 100644 --- a/entc/integration/ent/migrate/schema.go +++ b/entc/integration/ent/migrate/schema.go @@ -79,6 +79,7 @@ var ( {Name: "optional_float32", Type: field.TypeFloat32, Nullable: true}, {Name: "datetime", Type: field.TypeTime, Nullable: true, SchemaType: map[string]string{"mysql": "datetime", "postgres": "date"}}, {Name: "decimal", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(6,2)", "postgres": "numeric"}}, + {Name: "dir", Type: field.TypeString, Nullable: true}, {Name: "file_field", Type: field.TypeInt, Nullable: true}, } // FieldTypesTable holds the schema information for the "field_types" table. @@ -89,7 +90,7 @@ var ( ForeignKeys: []*schema.ForeignKey{ { Symbol: "field_types_files_field", - Columns: []*schema.Column{FieldTypesColumns[27]}, + Columns: []*schema.Column{FieldTypesColumns[28]}, RefColumns: []*schema.Column{FilesColumns[0]}, OnDelete: schema.SetNull, diff --git a/entc/integration/ent/mutation.go b/entc/integration/ent/mutation.go index 9a5e589f3..235d35da4 100644 --- a/entc/integration/ent/mutation.go +++ b/entc/integration/ent/mutation.go @@ -9,6 +9,7 @@ package ent import ( "context" "fmt" + "net/http" "sync" "time" @@ -1249,6 +1250,7 @@ type FieldTypeMutation struct { datetime *time.Time decimal *float64 adddecimal *float64 + dir *http.Dir clearedFields map[string]struct{} done bool oldValue func(context.Context) (*FieldType, error) @@ -3067,6 +3069,56 @@ func (m *FieldTypeMutation) ResetDecimal() { delete(m.clearedFields, fieldtype.FieldDecimal) } +// SetDir sets the dir field. +func (m *FieldTypeMutation) SetDir(h http.Dir) { + m.dir = &h +} + +// Dir returns the dir value in the mutation. +func (m *FieldTypeMutation) Dir() (r http.Dir, exists bool) { + v := m.dir + if v == nil { + return + } + return *v, true +} + +// OldDir returns the old dir value of the FieldType. +// If the FieldType object wasn't provided to the builder, the object is fetched +// from the database. +// An error is returned if the mutation operation is not UpdateOne, or database query fails. +func (m *FieldTypeMutation) OldDir(ctx context.Context) (v http.Dir, err error) { + if !m.op.Is(OpUpdateOne) { + return v, fmt.Errorf("OldDir is allowed only on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, fmt.Errorf("OldDir requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDir: %w", err) + } + return oldValue.Dir, nil +} + +// ClearDir clears the value of dir. +func (m *FieldTypeMutation) ClearDir() { + m.dir = nil + m.clearedFields[fieldtype.FieldDir] = struct{}{} +} + +// DirCleared returns if the field dir was cleared in this mutation. +func (m *FieldTypeMutation) DirCleared() bool { + _, ok := m.clearedFields[fieldtype.FieldDir] + return ok +} + +// ResetDir reset all changes of the "dir" field. +func (m *FieldTypeMutation) ResetDir() { + m.dir = nil + delete(m.clearedFields, fieldtype.FieldDir) +} + // Op returns the operation name. func (m *FieldTypeMutation) Op() Op { return m.op @@ -3081,7 +3133,7 @@ func (m *FieldTypeMutation) Type() string { // this mutation. Note that, in order to get all numeric // fields that were in/decremented, call AddedFields(). func (m *FieldTypeMutation) Fields() []string { - fields := make([]string, 0, 26) + fields := make([]string, 0, 27) if m.int != nil { fields = append(fields, fieldtype.FieldInt) } @@ -3160,6 +3212,9 @@ func (m *FieldTypeMutation) Fields() []string { if m.decimal != nil { fields = append(fields, fieldtype.FieldDecimal) } + if m.dir != nil { + fields = append(fields, fieldtype.FieldDir) + } return fields } @@ -3220,6 +3275,8 @@ func (m *FieldTypeMutation) Field(name string) (ent.Value, bool) { return m.Datetime() case fieldtype.FieldDecimal: return m.Decimal() + case fieldtype.FieldDir: + return m.Dir() } return nil, false } @@ -3281,6 +3338,8 @@ func (m *FieldTypeMutation) OldField(ctx context.Context, name string) (ent.Valu return m.OldDatetime(ctx) case fieldtype.FieldDecimal: return m.OldDecimal(ctx) + case fieldtype.FieldDir: + return m.OldDir(ctx) } return nil, fmt.Errorf("unknown FieldType field %s", name) } @@ -3472,6 +3531,13 @@ func (m *FieldTypeMutation) SetField(name string, value ent.Value) error { } m.SetDecimal(v) return nil + case fieldtype.FieldDir: + v, ok := value.(http.Dir) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDir(v) + return nil } return fmt.Errorf("unknown FieldType field %s", name) } @@ -3856,6 +3922,9 @@ func (m *FieldTypeMutation) ClearedFields() []string { if m.FieldCleared(fieldtype.FieldDecimal) { fields = append(fields, fieldtype.FieldDecimal) } + if m.FieldCleared(fieldtype.FieldDir) { + fields = append(fields, fieldtype.FieldDir) + } return fields } @@ -3933,6 +4002,9 @@ func (m *FieldTypeMutation) ClearField(name string) error { case fieldtype.FieldDecimal: m.ClearDecimal() return nil + case fieldtype.FieldDir: + m.ClearDir() + return nil } return fmt.Errorf("unknown FieldType nullable field %s", name) } @@ -4020,6 +4092,9 @@ func (m *FieldTypeMutation) ResetField(name string) error { case fieldtype.FieldDecimal: m.ResetDecimal() return nil + case fieldtype.FieldDir: + m.ResetDir() + return nil } return fmt.Errorf("unknown FieldType field %s", name) } diff --git a/entc/integration/ent/node/where.go b/entc/integration/ent/node/where.go index 8099c1414..159c5e5e4 100644 --- a/entc/integration/ent/node/where.go +++ b/entc/integration/ent/node/where.go @@ -122,7 +122,6 @@ func ValueIn(vs ...int) predicate.Node { for i := range v { v[i] = vs[i] } - return predicate.Node(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func ValueNotIn(vs ...int) predicate.Node { for i := range v { v[i] = vs[i] } - return predicate.Node(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/ent/pet/where.go b/entc/integration/ent/pet/where.go index d4469a6f8..9caee76ca 100644 --- a/entc/integration/ent/pet/where.go +++ b/entc/integration/ent/pet/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/ent/schema/fieldtype.go b/entc/integration/ent/schema/fieldtype.go index 4441e6ca5..0288bc49b 100644 --- a/entc/integration/ent/schema/fieldtype.go +++ b/entc/integration/ent/schema/fieldtype.go @@ -5,6 +5,8 @@ package schema import ( + "net/http" + "github.com/facebookincubator/ent" "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/schema/field" @@ -59,5 +61,8 @@ func (FieldType) Fields() []ent.Field { dialect.MySQL: "decimal(6,2)", dialect.Postgres: "numeric", }), + field.String("dir"). + Optional(). + GoType(http.Dir("dir")), } } diff --git a/entc/integration/ent/user/where.go b/entc/integration/ent/user/where.go index 1b625ec05..0de684c5d 100644 --- a/entc/integration/ent/user/where.go +++ b/entc/integration/ent/user/where.go @@ -171,7 +171,6 @@ func OptionalIntIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -189,7 +188,6 @@ func OptionalIntNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -263,7 +261,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -281,7 +278,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -341,7 +337,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -359,7 +354,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -454,7 +448,6 @@ func LastIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -472,7 +465,6 @@ func LastNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -567,7 +559,6 @@ func NicknameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -585,7 +576,6 @@ func NicknameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -694,7 +684,6 @@ func PhoneIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -712,7 +701,6 @@ func PhoneNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -821,7 +809,6 @@ func PasswordIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -839,7 +826,6 @@ func PasswordNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -948,7 +934,6 @@ func RoleIn(vs ...Role) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -966,7 +951,6 @@ func RoleNotIn(vs ...Role) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -998,7 +982,6 @@ func SSOCertIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1016,7 +999,6 @@ func SSOCertNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/gremlin/ent/card/where.go b/entc/integration/gremlin/ent/card/where.go index 6ad740200..8cb0e34de 100644 --- a/entc/integration/gremlin/ent/card/where.go +++ b/entc/integration/gremlin/ent/card/where.go @@ -134,7 +134,6 @@ func CreateTimeIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.Within(v...)) }) @@ -146,7 +145,6 @@ func CreateTimeNotIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.Without(v...)) }) @@ -200,7 +198,6 @@ func UpdateTimeIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.Within(v...)) }) @@ -212,7 +209,6 @@ func UpdateTimeNotIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.Without(v...)) }) @@ -266,7 +262,6 @@ func NumberIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.Within(v...)) }) @@ -278,7 +273,6 @@ func NumberNotIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.Without(v...)) }) @@ -353,7 +347,6 @@ func NameIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) }) @@ -365,7 +358,6 @@ func NameNotIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) }) diff --git a/entc/integration/gremlin/ent/comment/where.go b/entc/integration/gremlin/ent/comment/where.go index 1e90a5ca0..94831c17f 100644 --- a/entc/integration/gremlin/ent/comment/where.go +++ b/entc/integration/gremlin/ent/comment/where.go @@ -125,7 +125,6 @@ func UniqueIntIn(vs ...int) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.Within(v...)) }) @@ -137,7 +136,6 @@ func UniqueIntNotIn(vs ...int) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.Without(v...)) }) @@ -191,7 +189,6 @@ func UniqueFloatIn(vs ...float64) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.Within(v...)) }) @@ -203,7 +200,6 @@ func UniqueFloatNotIn(vs ...float64) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.Without(v...)) }) @@ -257,7 +253,6 @@ func NillableIntIn(vs ...int) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.Within(v...)) }) @@ -269,7 +264,6 @@ func NillableIntNotIn(vs ...int) predicate.Comment { for i := range v { v[i] = vs[i] } - return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.Without(v...)) }) diff --git a/entc/integration/gremlin/ent/fieldtype.go b/entc/integration/gremlin/ent/fieldtype.go index 2ee80cfd8..ddbb9a08a 100644 --- a/entc/integration/gremlin/ent/fieldtype.go +++ b/entc/integration/gremlin/ent/fieldtype.go @@ -8,6 +8,7 @@ package ent import ( "fmt" + "net/http" "strings" "time" @@ -72,6 +73,8 @@ type FieldType struct { Datetime time.Time `json:"datetime,omitempty"` // Decimal holds the value of the "decimal" field. Decimal float64 `json:"decimal,omitempty"` + // Dir holds the value of the "dir" field. + Dir http.Dir `json:"dir,omitempty"` } // FromResponse scans the gremlin response data into FieldType. @@ -108,6 +111,7 @@ func (ft *FieldType) FromResponse(res *gremlin.Response) error { OptionalFloat32 float32 `json:"optional_float32,omitempty"` Datetime int64 `json:"datetime,omitempty"` Decimal float64 `json:"decimal,omitempty"` + Dir http.Dir `json:"dir,omitempty"` } if err := vmap.Decode(&scanft); err != nil { return err @@ -139,6 +143,7 @@ func (ft *FieldType) FromResponse(res *gremlin.Response) error { ft.OptionalFloat32 = scanft.OptionalFloat32 ft.Datetime = time.Unix(0, scanft.Datetime) ft.Decimal = scanft.Decimal + ft.Dir = scanft.Dir return nil } @@ -227,6 +232,8 @@ func (ft *FieldType) String() string { builder.WriteString(ft.Datetime.Format(time.ANSIC)) builder.WriteString(", decimal=") builder.WriteString(fmt.Sprintf("%v", ft.Decimal)) + builder.WriteString(", dir=") + builder.WriteString(fmt.Sprintf("%v", ft.Dir)) builder.WriteByte(')') return builder.String() } @@ -268,6 +275,7 @@ func (ft *FieldTypes) FromResponse(res *gremlin.Response) error { OptionalFloat32 float32 `json:"optional_float32,omitempty"` Datetime int64 `json:"datetime,omitempty"` Decimal float64 `json:"decimal,omitempty"` + Dir http.Dir `json:"dir,omitempty"` } if err := vmap.Decode(&scanft); err != nil { return err @@ -301,6 +309,7 @@ func (ft *FieldTypes) FromResponse(res *gremlin.Response) error { OptionalFloat32: v.OptionalFloat32, Datetime: time.Unix(0, v.Datetime), Decimal: v.Decimal, + Dir: v.Dir, }) } return nil diff --git a/entc/integration/gremlin/ent/fieldtype/fieldtype.go b/entc/integration/gremlin/ent/fieldtype/fieldtype.go index 52063c1c7..263a8e11f 100644 --- a/entc/integration/gremlin/ent/fieldtype/fieldtype.go +++ b/entc/integration/gremlin/ent/fieldtype/fieldtype.go @@ -40,7 +40,8 @@ const ( FieldOptionalFloat = "optional_float" // FieldOptionalFloat32 holds the string denoting the optional_float32 vertex property in the database. FieldOptionalFloat32 = "optional_float32" // FieldDatetime holds the string denoting the datetime vertex property in the database. FieldDatetime = "datetime" // FieldDecimal holds the string denoting the decimal vertex property in the database. - FieldDecimal = "decimal" + FieldDecimal = "decimal" // FieldDir holds the string denoting the dir vertex property in the database. + FieldDir = "dir" ) var ( diff --git a/entc/integration/gremlin/ent/fieldtype/where.go b/entc/integration/gremlin/ent/fieldtype/where.go index 40afab55f..e7f356a38 100644 --- a/entc/integration/gremlin/ent/fieldtype/where.go +++ b/entc/integration/gremlin/ent/fieldtype/where.go @@ -7,6 +7,7 @@ package fieldtype import ( + "net/http" "time" "github.com/facebookincubator/ent/dialect/gremlin/graph/dsl" @@ -261,6 +262,14 @@ func Decimal(v float64) predicate.FieldType { }) } +// Dir applies equality check predicate on the "dir" field. It's identical to DirEQ. +func Dir(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.EQ(vc)) + }) +} + // IntEQ applies the EQ predicate on the "int" field. func IntEQ(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { @@ -281,7 +290,6 @@ func IntIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.Within(v...)) }) @@ -293,7 +301,6 @@ func IntNotIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.Without(v...)) }) @@ -347,7 +354,6 @@ func Int8In(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.Within(v...)) }) @@ -359,7 +365,6 @@ func Int8NotIn(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.Without(v...)) }) @@ -413,7 +418,6 @@ func Int16In(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.Within(v...)) }) @@ -425,7 +429,6 @@ func Int16NotIn(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.Without(v...)) }) @@ -479,7 +482,6 @@ func Int32In(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.Within(v...)) }) @@ -491,7 +493,6 @@ func Int32NotIn(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.Without(v...)) }) @@ -545,7 +546,6 @@ func Int64In(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.Within(v...)) }) @@ -557,7 +557,6 @@ func Int64NotIn(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.Without(v...)) }) @@ -611,7 +610,6 @@ func OptionalIntIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.Within(v...)) }) @@ -623,7 +621,6 @@ func OptionalIntNotIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.Without(v...)) }) @@ -691,7 +688,6 @@ func OptionalInt8In(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.Within(v...)) }) @@ -703,7 +699,6 @@ func OptionalInt8NotIn(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.Without(v...)) }) @@ -771,7 +766,6 @@ func OptionalInt16In(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.Within(v...)) }) @@ -783,7 +777,6 @@ func OptionalInt16NotIn(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.Without(v...)) }) @@ -851,7 +844,6 @@ func OptionalInt32In(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.Within(v...)) }) @@ -863,7 +855,6 @@ func OptionalInt32NotIn(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.Without(v...)) }) @@ -931,7 +922,6 @@ func OptionalInt64In(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.Within(v...)) }) @@ -943,7 +933,6 @@ func OptionalInt64NotIn(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.Without(v...)) }) @@ -1011,7 +1000,6 @@ func NillableIntIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.Within(v...)) }) @@ -1023,7 +1011,6 @@ func NillableIntNotIn(vs ...int) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.Without(v...)) }) @@ -1091,7 +1078,6 @@ func NillableInt8In(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.Within(v...)) }) @@ -1103,7 +1089,6 @@ func NillableInt8NotIn(vs ...int8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.Without(v...)) }) @@ -1171,7 +1156,6 @@ func NillableInt16In(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.Within(v...)) }) @@ -1183,7 +1167,6 @@ func NillableInt16NotIn(vs ...int16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.Without(v...)) }) @@ -1251,7 +1234,6 @@ func NillableInt32In(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.Within(v...)) }) @@ -1263,7 +1245,6 @@ func NillableInt32NotIn(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.Without(v...)) }) @@ -1331,7 +1312,6 @@ func NillableInt64In(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.Within(v...)) }) @@ -1343,7 +1323,6 @@ func NillableInt64NotIn(vs ...int64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.Without(v...)) }) @@ -1411,7 +1390,6 @@ func ValidateOptionalInt32In(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.Within(v...)) }) @@ -1423,7 +1401,6 @@ func ValidateOptionalInt32NotIn(vs ...int32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.Without(v...)) }) @@ -1491,7 +1468,6 @@ func OptionalUintIn(vs ...uint) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.Within(v...)) }) @@ -1503,7 +1479,6 @@ func OptionalUintNotIn(vs ...uint) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.Without(v...)) }) @@ -1571,7 +1546,6 @@ func OptionalUint8In(vs ...uint8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.Within(v...)) }) @@ -1583,7 +1557,6 @@ func OptionalUint8NotIn(vs ...uint8) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.Without(v...)) }) @@ -1651,7 +1624,6 @@ func OptionalUint16In(vs ...uint16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.Within(v...)) }) @@ -1663,7 +1635,6 @@ func OptionalUint16NotIn(vs ...uint16) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.Without(v...)) }) @@ -1731,7 +1702,6 @@ func OptionalUint32In(vs ...uint32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.Within(v...)) }) @@ -1743,7 +1713,6 @@ func OptionalUint32NotIn(vs ...uint32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.Without(v...)) }) @@ -1811,7 +1780,6 @@ func OptionalUint64In(vs ...uint64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.Within(v...)) }) @@ -1823,7 +1791,6 @@ func OptionalUint64NotIn(vs ...uint64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.Without(v...)) }) @@ -1891,7 +1858,6 @@ func StateIn(vs ...State) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldState, p.Within(v...)) }) @@ -1903,7 +1869,6 @@ func StateNotIn(vs ...State) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldState, p.Without(v...)) }) @@ -1943,7 +1908,6 @@ func OptionalFloatIn(vs ...float64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalFloat, p.Within(v...)) }) @@ -1955,7 +1919,6 @@ func OptionalFloatNotIn(vs ...float64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalFloat, p.Without(v...)) }) @@ -2023,7 +1986,6 @@ func OptionalFloat32In(vs ...float32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalFloat32, p.Within(v...)) }) @@ -2035,7 +1997,6 @@ func OptionalFloat32NotIn(vs ...float32) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalFloat32, p.Without(v...)) }) @@ -2103,7 +2064,6 @@ func DatetimeIn(vs ...time.Time) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldDatetime, p.Within(v...)) }) @@ -2115,7 +2075,6 @@ func DatetimeNotIn(vs ...time.Time) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldDatetime, p.Without(v...)) }) @@ -2183,7 +2142,6 @@ func DecimalIn(vs ...float64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldDecimal, p.Within(v...)) }) @@ -2195,7 +2153,6 @@ func DecimalNotIn(vs ...float64) predicate.FieldType { for i := range v { v[i] = vs[i] } - return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldDecimal, p.Without(v...)) }) @@ -2243,6 +2200,114 @@ func DecimalNotNil() predicate.FieldType { }) } +// DirEQ applies the EQ predicate on the "dir" field. +func DirEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.EQ(vc)) + }) +} + +// DirNEQ applies the NEQ predicate on the "dir" field. +func DirNEQ(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.NEQ(vc)) + }) +} + +// DirIn applies the In predicate on the "dir" field. +func DirIn(vs ...http.Dir) predicate.FieldType { + v := make([]interface{}, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.Within(v...)) + }) +} + +// DirNotIn applies the NotIn predicate on the "dir" field. +func DirNotIn(vs ...http.Dir) predicate.FieldType { + v := make([]interface{}, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.Without(v...)) + }) +} + +// DirGT applies the GT predicate on the "dir" field. +func DirGT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.GT(vc)) + }) +} + +// DirGTE applies the GTE predicate on the "dir" field. +func DirGTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.GTE(vc)) + }) +} + +// DirLT applies the LT predicate on the "dir" field. +func DirLT(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.LT(vc)) + }) +} + +// DirLTE applies the LTE predicate on the "dir" field. +func DirLTE(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.LTE(vc)) + }) +} + +// DirContains applies the Contains predicate on the "dir" field. +func DirContains(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.Containing(vc)) + }) +} + +// DirHasPrefix applies the HasPrefix predicate on the "dir" field. +func DirHasPrefix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.StartingWith(vc)) + }) +} + +// DirHasSuffix applies the HasSuffix predicate on the "dir" field. +func DirHasSuffix(v http.Dir) predicate.FieldType { + vc := string(v) + return predicate.FieldType(func(t *dsl.Traversal) { + t.Has(Label, FieldDir, p.EndingWith(vc)) + }) +} + +// DirIsNil applies the IsNil predicate on the "dir" field. +func DirIsNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).HasNot(FieldDir) + }) +} + +// DirNotNil applies the NotNil predicate on the "dir" field. +func DirNotNil() predicate.FieldType { + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasLabel(Label).Has(FieldDir) + }) +} + // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.FieldType) predicate.FieldType { return predicate.FieldType(func(tr *dsl.Traversal) { diff --git a/entc/integration/gremlin/ent/fieldtype_create.go b/entc/integration/gremlin/ent/fieldtype_create.go index 1cc539d2a..61d0154d1 100644 --- a/entc/integration/gremlin/ent/fieldtype_create.go +++ b/entc/integration/gremlin/ent/fieldtype_create.go @@ -10,6 +10,7 @@ import ( "context" "errors" "fmt" + "net/http" "time" "github.com/facebookincubator/ent/dialect/gremlin" @@ -349,6 +350,20 @@ func (ftc *FieldTypeCreate) SetNillableDecimal(f *float64) *FieldTypeCreate { return ftc } +// SetDir sets the dir field. +func (ftc *FieldTypeCreate) SetDir(h http.Dir) *FieldTypeCreate { + ftc.mutation.SetDir(h) + return ftc +} + +// SetNillableDir sets the dir field if the given value is not nil. +func (ftc *FieldTypeCreate) SetNillableDir(h *http.Dir) *FieldTypeCreate { + if h != nil { + ftc.SetDir(*h) + } + return ftc +} + // Save creates the FieldType in the database. func (ftc *FieldTypeCreate) Save(ctx context.Context) (*FieldType, error) { if _, ok := ftc.mutation.Int(); !ok { @@ -508,5 +523,8 @@ func (ftc *FieldTypeCreate) gremlin() *dsl.Traversal { if value, ok := ftc.mutation.Decimal(); ok { v.Property(dsl.Single, fieldtype.FieldDecimal, value) } + if value, ok := ftc.mutation.Dir(); ok { + v.Property(dsl.Single, fieldtype.FieldDir, value) + } return v.ValueMap(true) } diff --git a/entc/integration/gremlin/ent/fieldtype_update.go b/entc/integration/gremlin/ent/fieldtype_update.go index a2323bb4c..7d7abb636 100644 --- a/entc/integration/gremlin/ent/fieldtype_update.go +++ b/entc/integration/gremlin/ent/fieldtype_update.go @@ -9,6 +9,7 @@ package ent import ( "context" "fmt" + "net/http" "time" "github.com/facebookincubator/ent/dialect/gremlin" @@ -651,6 +652,26 @@ func (ftu *FieldTypeUpdate) ClearDecimal() *FieldTypeUpdate { return ftu } +// SetDir sets the dir field. +func (ftu *FieldTypeUpdate) SetDir(h http.Dir) *FieldTypeUpdate { + ftu.mutation.SetDir(h) + return ftu +} + +// SetNillableDir sets the dir field if the given value is not nil. +func (ftu *FieldTypeUpdate) SetNillableDir(h *http.Dir) *FieldTypeUpdate { + if h != nil { + ftu.SetDir(*h) + } + return ftu +} + +// ClearDir clears the value of dir. +func (ftu *FieldTypeUpdate) ClearDir() *FieldTypeUpdate { + ftu.mutation.ClearDir() + return ftu +} + // Save executes the query and returns the number of rows/vertices matched by this operation. func (ftu *FieldTypeUpdate) Save(ctx context.Context) (int, error) { if v, ok := ftu.mutation.ValidateOptionalInt32(); ok { @@ -882,6 +903,9 @@ func (ftu *FieldTypeUpdate) gremlin() *dsl.Traversal { if value, ok := ftu.mutation.AddedDecimal(); ok { v.Property(dsl.Single, fieldtype.FieldDecimal, __.Union(__.Values(fieldtype.FieldDecimal), __.Constant(value)).Sum()) } + if value, ok := ftu.mutation.Dir(); ok { + v.Property(dsl.Single, fieldtype.FieldDir, value) + } var properties []interface{} if ftu.mutation.OptionalIntCleared() { properties = append(properties, fieldtype.FieldOptionalInt) @@ -946,6 +970,9 @@ func (ftu *FieldTypeUpdate) gremlin() *dsl.Traversal { if ftu.mutation.DecimalCleared() { properties = append(properties, fieldtype.FieldDecimal) } + if ftu.mutation.DirCleared() { + properties = append(properties, fieldtype.FieldDir) + } if len(properties) > 0 { v.SideEffect(__.Properties(properties...).Drop()) } @@ -1579,6 +1606,26 @@ func (ftuo *FieldTypeUpdateOne) ClearDecimal() *FieldTypeUpdateOne { return ftuo } +// SetDir sets the dir field. +func (ftuo *FieldTypeUpdateOne) SetDir(h http.Dir) *FieldTypeUpdateOne { + ftuo.mutation.SetDir(h) + return ftuo +} + +// SetNillableDir sets the dir field if the given value is not nil. +func (ftuo *FieldTypeUpdateOne) SetNillableDir(h *http.Dir) *FieldTypeUpdateOne { + if h != nil { + ftuo.SetDir(*h) + } + return ftuo +} + +// ClearDir clears the value of dir. +func (ftuo *FieldTypeUpdateOne) ClearDir() *FieldTypeUpdateOne { + ftuo.mutation.ClearDir() + return ftuo +} + // Save executes the query and returns the updated entity. func (ftuo *FieldTypeUpdateOne) Save(ctx context.Context) (*FieldType, error) { if v, ok := ftuo.mutation.ValidateOptionalInt32(); ok { @@ -1815,6 +1862,9 @@ func (ftuo *FieldTypeUpdateOne) gremlin(id string) *dsl.Traversal { if value, ok := ftuo.mutation.AddedDecimal(); ok { v.Property(dsl.Single, fieldtype.FieldDecimal, __.Union(__.Values(fieldtype.FieldDecimal), __.Constant(value)).Sum()) } + if value, ok := ftuo.mutation.Dir(); ok { + v.Property(dsl.Single, fieldtype.FieldDir, value) + } var properties []interface{} if ftuo.mutation.OptionalIntCleared() { properties = append(properties, fieldtype.FieldOptionalInt) @@ -1879,6 +1929,9 @@ func (ftuo *FieldTypeUpdateOne) gremlin(id string) *dsl.Traversal { if ftuo.mutation.DecimalCleared() { properties = append(properties, fieldtype.FieldDecimal) } + if ftuo.mutation.DirCleared() { + properties = append(properties, fieldtype.FieldDir) + } if len(properties) > 0 { v.SideEffect(__.Properties(properties...).Drop()) } diff --git a/entc/integration/gremlin/ent/file/where.go b/entc/integration/gremlin/ent/file/where.go index b9495e5c0..a78d04d6d 100644 --- a/entc/integration/gremlin/ent/file/where.go +++ b/entc/integration/gremlin/ent/file/where.go @@ -132,7 +132,6 @@ func SizeIn(vs ...int) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.Within(v...)) }) @@ -144,7 +143,6 @@ func SizeNotIn(vs ...int) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.Without(v...)) }) @@ -198,7 +196,6 @@ func NameIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) }) @@ -210,7 +207,6 @@ func NameNotIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) }) @@ -285,7 +281,6 @@ func UserIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.Within(v...)) }) @@ -297,7 +292,6 @@ func UserNotIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.Without(v...)) }) @@ -386,7 +380,6 @@ func GroupIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.Within(v...)) }) @@ -398,7 +391,6 @@ func GroupNotIn(vs ...string) predicate.File { for i := range v { v[i] = vs[i] } - return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.Without(v...)) }) diff --git a/entc/integration/gremlin/ent/filetype/where.go b/entc/integration/gremlin/ent/filetype/where.go index 0d1b0b983..56e881702 100644 --- a/entc/integration/gremlin/ent/filetype/where.go +++ b/entc/integration/gremlin/ent/filetype/where.go @@ -111,7 +111,6 @@ func NameIn(vs ...string) predicate.FileType { for i := range v { v[i] = vs[i] } - return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) }) @@ -123,7 +122,6 @@ func NameNotIn(vs ...string) predicate.FileType { for i := range v { v[i] = vs[i] } - return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) }) diff --git a/entc/integration/gremlin/ent/group/where.go b/entc/integration/gremlin/ent/group/where.go index 79f931776..3bc4c819d 100644 --- a/entc/integration/gremlin/ent/group/where.go +++ b/entc/integration/gremlin/ent/group/where.go @@ -155,7 +155,6 @@ func ExpireIn(vs ...time.Time) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.Within(v...)) }) @@ -167,7 +166,6 @@ func ExpireNotIn(vs ...time.Time) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.Without(v...)) }) @@ -221,7 +219,6 @@ func TypeIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.Within(v...)) }) @@ -233,7 +230,6 @@ func TypeNotIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.Without(v...)) }) @@ -322,7 +318,6 @@ func MaxUsersIn(vs ...int) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.Within(v...)) }) @@ -334,7 +329,6 @@ func MaxUsersNotIn(vs ...int) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.Without(v...)) }) @@ -402,7 +396,6 @@ func NameIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) }) @@ -414,7 +407,6 @@ func NameNotIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) }) diff --git a/entc/integration/gremlin/ent/groupinfo/where.go b/entc/integration/gremlin/ent/groupinfo/where.go index 89333a448..77e8f9ae4 100644 --- a/entc/integration/gremlin/ent/groupinfo/where.go +++ b/entc/integration/gremlin/ent/groupinfo/where.go @@ -118,7 +118,6 @@ func DescIn(vs ...string) predicate.GroupInfo { for i := range v { v[i] = vs[i] } - return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.Within(v...)) }) @@ -130,7 +129,6 @@ func DescNotIn(vs ...string) predicate.GroupInfo { for i := range v { v[i] = vs[i] } - return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.Without(v...)) }) @@ -205,7 +203,6 @@ func MaxUsersIn(vs ...int) predicate.GroupInfo { for i := range v { v[i] = vs[i] } - return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.Within(v...)) }) @@ -217,7 +214,6 @@ func MaxUsersNotIn(vs ...int) predicate.GroupInfo { for i := range v { v[i] = vs[i] } - return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.Without(v...)) }) diff --git a/entc/integration/gremlin/ent/mutation.go b/entc/integration/gremlin/ent/mutation.go index fca7ffa9d..5df0e3589 100644 --- a/entc/integration/gremlin/ent/mutation.go +++ b/entc/integration/gremlin/ent/mutation.go @@ -9,6 +9,7 @@ package ent import ( "context" "fmt" + "net/http" "sync" "time" @@ -1249,6 +1250,7 @@ type FieldTypeMutation struct { datetime *time.Time decimal *float64 adddecimal *float64 + dir *http.Dir clearedFields map[string]struct{} done bool oldValue func(context.Context) (*FieldType, error) @@ -3067,6 +3069,56 @@ func (m *FieldTypeMutation) ResetDecimal() { delete(m.clearedFields, fieldtype.FieldDecimal) } +// SetDir sets the dir field. +func (m *FieldTypeMutation) SetDir(h http.Dir) { + m.dir = &h +} + +// Dir returns the dir value in the mutation. +func (m *FieldTypeMutation) Dir() (r http.Dir, exists bool) { + v := m.dir + if v == nil { + return + } + return *v, true +} + +// OldDir returns the old dir value of the FieldType. +// If the FieldType object wasn't provided to the builder, the object is fetched +// from the database. +// An error is returned if the mutation operation is not UpdateOne, or database query fails. +func (m *FieldTypeMutation) OldDir(ctx context.Context) (v http.Dir, err error) { + if !m.op.Is(OpUpdateOne) { + return v, fmt.Errorf("OldDir is allowed only on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, fmt.Errorf("OldDir requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDir: %w", err) + } + return oldValue.Dir, nil +} + +// ClearDir clears the value of dir. +func (m *FieldTypeMutation) ClearDir() { + m.dir = nil + m.clearedFields[fieldtype.FieldDir] = struct{}{} +} + +// DirCleared returns if the field dir was cleared in this mutation. +func (m *FieldTypeMutation) DirCleared() bool { + _, ok := m.clearedFields[fieldtype.FieldDir] + return ok +} + +// ResetDir reset all changes of the "dir" field. +func (m *FieldTypeMutation) ResetDir() { + m.dir = nil + delete(m.clearedFields, fieldtype.FieldDir) +} + // Op returns the operation name. func (m *FieldTypeMutation) Op() Op { return m.op @@ -3081,7 +3133,7 @@ func (m *FieldTypeMutation) Type() string { // this mutation. Note that, in order to get all numeric // fields that were in/decremented, call AddedFields(). func (m *FieldTypeMutation) Fields() []string { - fields := make([]string, 0, 26) + fields := make([]string, 0, 27) if m.int != nil { fields = append(fields, fieldtype.FieldInt) } @@ -3160,6 +3212,9 @@ func (m *FieldTypeMutation) Fields() []string { if m.decimal != nil { fields = append(fields, fieldtype.FieldDecimal) } + if m.dir != nil { + fields = append(fields, fieldtype.FieldDir) + } return fields } @@ -3220,6 +3275,8 @@ func (m *FieldTypeMutation) Field(name string) (ent.Value, bool) { return m.Datetime() case fieldtype.FieldDecimal: return m.Decimal() + case fieldtype.FieldDir: + return m.Dir() } return nil, false } @@ -3281,6 +3338,8 @@ func (m *FieldTypeMutation) OldField(ctx context.Context, name string) (ent.Valu return m.OldDatetime(ctx) case fieldtype.FieldDecimal: return m.OldDecimal(ctx) + case fieldtype.FieldDir: + return m.OldDir(ctx) } return nil, fmt.Errorf("unknown FieldType field %s", name) } @@ -3472,6 +3531,13 @@ func (m *FieldTypeMutation) SetField(name string, value ent.Value) error { } m.SetDecimal(v) return nil + case fieldtype.FieldDir: + v, ok := value.(http.Dir) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDir(v) + return nil } return fmt.Errorf("unknown FieldType field %s", name) } @@ -3856,6 +3922,9 @@ func (m *FieldTypeMutation) ClearedFields() []string { if m.FieldCleared(fieldtype.FieldDecimal) { fields = append(fields, fieldtype.FieldDecimal) } + if m.FieldCleared(fieldtype.FieldDir) { + fields = append(fields, fieldtype.FieldDir) + } return fields } @@ -3933,6 +4002,9 @@ func (m *FieldTypeMutation) ClearField(name string) error { case fieldtype.FieldDecimal: m.ClearDecimal() return nil + case fieldtype.FieldDir: + m.ClearDir() + return nil } return fmt.Errorf("unknown FieldType nullable field %s", name) } @@ -4020,6 +4092,9 @@ func (m *FieldTypeMutation) ResetField(name string) error { case fieldtype.FieldDecimal: m.ResetDecimal() return nil + case fieldtype.FieldDir: + m.ResetDir() + return nil } return fmt.Errorf("unknown FieldType field %s", name) } diff --git a/entc/integration/gremlin/ent/node/where.go b/entc/integration/gremlin/ent/node/where.go index 97078ac8c..b409b5366 100644 --- a/entc/integration/gremlin/ent/node/where.go +++ b/entc/integration/gremlin/ent/node/where.go @@ -111,7 +111,6 @@ func ValueIn(vs ...int) predicate.Node { for i := range v { v[i] = vs[i] } - return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.Within(v...)) }) @@ -123,7 +122,6 @@ func ValueNotIn(vs ...int) predicate.Node { for i := range v { v[i] = vs[i] } - return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.Without(v...)) }) diff --git a/entc/integration/gremlin/ent/pet/where.go b/entc/integration/gremlin/ent/pet/where.go index 681752a87..a996ef643 100644 --- a/entc/integration/gremlin/ent/pet/where.go +++ b/entc/integration/gremlin/ent/pet/where.go @@ -111,7 +111,6 @@ func NameIn(vs ...string) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) }) @@ -123,7 +122,6 @@ func NameNotIn(vs ...string) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) }) diff --git a/entc/integration/gremlin/ent/user/where.go b/entc/integration/gremlin/ent/user/where.go index b09129b03..67ec66144 100644 --- a/entc/integration/gremlin/ent/user/where.go +++ b/entc/integration/gremlin/ent/user/where.go @@ -160,7 +160,6 @@ func OptionalIntIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.Within(v...)) }) @@ -172,7 +171,6 @@ func OptionalIntNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.Without(v...)) }) @@ -240,7 +238,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.Within(v...)) }) @@ -252,7 +249,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.Without(v...)) }) @@ -306,7 +302,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) }) @@ -318,7 +313,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) }) @@ -393,7 +387,6 @@ func LastIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.Within(v...)) }) @@ -405,7 +398,6 @@ func LastNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.Without(v...)) }) @@ -480,7 +472,6 @@ func NicknameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.Within(v...)) }) @@ -492,7 +483,6 @@ func NicknameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.Without(v...)) }) @@ -581,7 +571,6 @@ func PhoneIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.Within(v...)) }) @@ -593,7 +582,6 @@ func PhoneNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.Without(v...)) }) @@ -682,7 +670,6 @@ func PasswordIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.Within(v...)) }) @@ -694,7 +681,6 @@ func PasswordNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.Without(v...)) }) @@ -783,7 +769,6 @@ func RoleIn(vs ...Role) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldRole, p.Within(v...)) }) @@ -795,7 +780,6 @@ func RoleNotIn(vs ...Role) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldRole, p.Without(v...)) }) @@ -821,7 +805,6 @@ func SSOCertIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldSSOCert, p.Within(v...)) }) @@ -833,7 +816,6 @@ func SSOCertNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldSSOCert, p.Without(v...)) }) diff --git a/entc/integration/hooks/ent/card/where.go b/entc/integration/hooks/ent/card/where.go index 81f118ffb..1befc1d76 100644 --- a/entc/integration/hooks/ent/card/where.go +++ b/entc/integration/hooks/ent/card/where.go @@ -138,7 +138,6 @@ func NumberIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -156,7 +155,6 @@ func NumberNotIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -251,7 +249,6 @@ func NameIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -269,7 +266,6 @@ func NameNotIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -378,7 +374,6 @@ func CreatedAtIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -396,7 +391,6 @@ func CreatedAtNotIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/hooks/ent/user/where.go b/entc/integration/hooks/ent/user/where.go index 9c2e08b31..546d700bf 100644 --- a/entc/integration/hooks/ent/user/where.go +++ b/entc/integration/hooks/ent/user/where.go @@ -129,7 +129,6 @@ func VersionIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func VersionNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -207,7 +205,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -225,7 +222,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/idtype/ent/user/where.go b/entc/integration/idtype/ent/user/where.go index 337c72a13..3d785052e 100644 --- a/entc/integration/idtype/ent/user/where.go +++ b/entc/integration/idtype/ent/user/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/migrate/entv1/user/where.go b/entc/integration/migrate/entv1/user/where.go index 06a601bc6..772126090 100644 --- a/entc/integration/migrate/entv1/user/where.go +++ b/entc/integration/migrate/entv1/user/where.go @@ -157,7 +157,6 @@ func AgeIn(vs ...int32) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -175,7 +174,6 @@ func AgeNotIn(vs ...int32) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -235,7 +233,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -253,7 +250,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -348,7 +344,6 @@ func NicknameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -366,7 +361,6 @@ func NicknameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -461,7 +455,6 @@ func AddressIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -479,7 +472,6 @@ func AddressNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -588,7 +580,6 @@ func RenamedIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -606,7 +597,6 @@ func RenamedNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -715,7 +705,6 @@ func BlobIn(vs ...[]byte) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -733,7 +722,6 @@ func BlobNotIn(vs ...[]byte) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -807,7 +795,6 @@ func StateIn(vs ...State) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -825,7 +812,6 @@ func StateNotIn(vs ...State) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/migrate/entv2/user/where.go b/entc/integration/migrate/entv2/user/where.go index d94e00fab..243670137 100644 --- a/entc/integration/migrate/entv2/user/where.go +++ b/entc/integration/migrate/entv2/user/where.go @@ -171,7 +171,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -189,7 +188,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -249,7 +247,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -267,7 +264,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -362,7 +358,6 @@ func NicknameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -380,7 +375,6 @@ func NicknameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -475,7 +469,6 @@ func PhoneIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -493,7 +486,6 @@ func PhoneNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -588,7 +580,6 @@ func BufferIn(vs ...[]byte) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -606,7 +597,6 @@ func BufferNotIn(vs ...[]byte) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -680,7 +670,6 @@ func TitleIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -698,7 +687,6 @@ func TitleNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -793,7 +781,6 @@ func NewNameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -811,7 +798,6 @@ func NewNameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -920,7 +906,6 @@ func BlobIn(vs ...[]byte) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -938,7 +923,6 @@ func BlobNotIn(vs ...[]byte) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1012,7 +996,6 @@ func StateIn(vs ...State) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -1030,7 +1013,6 @@ func StateNotIn(vs ...State) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/privacy/ent/galaxy/where.go b/entc/integration/privacy/ent/galaxy/where.go index 4c3ec100f..69634a99a 100644 --- a/entc/integration/privacy/ent/galaxy/where.go +++ b/entc/integration/privacy/ent/galaxy/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.Galaxy { for i := range v { v[i] = vs[i] } - return predicate.Galaxy(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.Galaxy { for i := range v { v[i] = vs[i] } - return predicate.Galaxy(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -235,7 +233,6 @@ func TypeIn(vs ...Type) predicate.Galaxy { for i := range v { v[i] = vs[i] } - return predicate.Galaxy(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -253,7 +250,6 @@ func TypeNotIn(vs ...Type) predicate.Galaxy { for i := range v { v[i] = vs[i] } - return predicate.Galaxy(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/privacy/ent/planet/where.go b/entc/integration/privacy/ent/planet/where.go index d7a3ec0e9..2da09f6b6 100644 --- a/entc/integration/privacy/ent/planet/where.go +++ b/entc/integration/privacy/ent/planet/where.go @@ -129,7 +129,6 @@ func NameIn(vs ...string) predicate.Planet { for i := range v { v[i] = vs[i] } - return predicate.Planet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func NameNotIn(vs ...string) predicate.Planet { for i := range v { v[i] = vs[i] } - return predicate.Planet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -242,7 +240,6 @@ func AgeIn(vs ...uint) predicate.Planet { for i := range v { v[i] = vs[i] } - return predicate.Planet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -260,7 +257,6 @@ func AgeNotIn(vs ...uint) predicate.Planet { for i := range v { v[i] = vs[i] } - return predicate.Planet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/template/ent/group/where.go b/entc/integration/template/ent/group/where.go index 0640eb830..e7efb632d 100644 --- a/entc/integration/template/ent/group/where.go +++ b/entc/integration/template/ent/group/where.go @@ -121,7 +121,6 @@ func MaxUsersIn(vs ...int) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -139,7 +138,6 @@ func MaxUsersNotIn(vs ...int) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/template/ent/pet/where.go b/entc/integration/template/ent/pet/where.go index 3cf2c00cd..81e4c7a5c 100644 --- a/entc/integration/template/ent/pet/where.go +++ b/entc/integration/template/ent/pet/where.go @@ -131,7 +131,6 @@ func AgeIn(vs ...int) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -149,7 +148,6 @@ func AgeNotIn(vs ...int) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -209,7 +207,6 @@ func LicensedAtIn(vs ...time.Time) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -227,7 +224,6 @@ func LicensedAtNotIn(vs ...time.Time) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/template/ent/user/where.go b/entc/integration/template/ent/user/where.go index 3868a2cc1..97cf8a132 100644 --- a/entc/integration/template/ent/user/where.go +++ b/entc/integration/template/ent/user/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/entc/integration/type_test.go b/entc/integration/type_test.go index 0f6e642c4..8a12db9da 100644 --- a/entc/integration/type_test.go +++ b/entc/integration/type_test.go @@ -7,6 +7,7 @@ package integration import ( "context" "math" + "net/http" "testing" "time" @@ -75,6 +76,7 @@ func Types(t *testing.T, client *ent.Client) { SetNillableInt64(math.MaxInt64). SetDatetime(time.Now()). SetDecimal(10.20). + SetDir("dir"). SaveX(ctx) require.Equal(int8(math.MaxInt8), ft.OptionalInt8) @@ -86,5 +88,6 @@ func Types(t *testing.T, client *ent.Client) { require.Equal(int32(math.MaxInt32), *ft.NillableInt32) require.Equal(int64(math.MaxInt64), *ft.NillableInt64) require.Equal(10.20, ft.Decimal) + require.Equal(http.Dir("dir"), ft.Dir) require.False(ft.Datetime.IsZero()) } diff --git a/examples/edgeindex/ent/city/where.go b/examples/edgeindex/ent/city/where.go index 9178eb69d..fa1294259 100644 --- a/examples/edgeindex/ent/city/where.go +++ b/examples/edgeindex/ent/city/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.City { for i := range v { v[i] = vs[i] } - return predicate.City(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.City { for i := range v { v[i] = vs[i] } - return predicate.City(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/edgeindex/ent/street/where.go b/examples/edgeindex/ent/street/where.go index b4edd7583..de2a9a1bc 100644 --- a/examples/edgeindex/ent/street/where.go +++ b/examples/edgeindex/ent/street/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.Street { for i := range v { v[i] = vs[i] } - return predicate.Street(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.Street { for i := range v { v[i] = vs[i] } - return predicate.Street(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/m2m2types/ent/group/where.go b/examples/m2m2types/ent/group/where.go index ca090e37e..195c54200 100644 --- a/examples/m2m2types/ent/group/where.go +++ b/examples/m2m2types/ent/group/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/m2m2types/ent/user/where.go b/examples/m2m2types/ent/user/where.go index 2f29079d6..14775a8b6 100644 --- a/examples/m2m2types/ent/user/where.go +++ b/examples/m2m2types/ent/user/where.go @@ -129,7 +129,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -207,7 +205,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -225,7 +222,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/m2mbidi/ent/user/where.go b/examples/m2mbidi/ent/user/where.go index 543f8c895..3f0eb690c 100644 --- a/examples/m2mbidi/ent/user/where.go +++ b/examples/m2mbidi/ent/user/where.go @@ -129,7 +129,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -207,7 +205,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -225,7 +222,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/m2mrecur/ent/user/where.go b/examples/m2mrecur/ent/user/where.go index a0f2d17db..a0aad5128 100644 --- a/examples/m2mrecur/ent/user/where.go +++ b/examples/m2mrecur/ent/user/where.go @@ -129,7 +129,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -207,7 +205,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -225,7 +222,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/o2m2types/ent/pet/where.go b/examples/o2m2types/ent/pet/where.go index b6be17920..39f499cc6 100644 --- a/examples/o2m2types/ent/pet/where.go +++ b/examples/o2m2types/ent/pet/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/o2m2types/ent/user/where.go b/examples/o2m2types/ent/user/where.go index 06caf41b1..d0edf79f5 100644 --- a/examples/o2m2types/ent/user/where.go +++ b/examples/o2m2types/ent/user/where.go @@ -129,7 +129,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -207,7 +205,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -225,7 +222,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/o2mrecur/ent/node/where.go b/examples/o2mrecur/ent/node/where.go index c93bd90b2..8090ad7e2 100644 --- a/examples/o2mrecur/ent/node/where.go +++ b/examples/o2mrecur/ent/node/where.go @@ -122,7 +122,6 @@ func ValueIn(vs ...int) predicate.Node { for i := range v { v[i] = vs[i] } - return predicate.Node(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func ValueNotIn(vs ...int) predicate.Node { for i := range v { v[i] = vs[i] } - return predicate.Node(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/o2o2types/ent/card/where.go b/examples/o2o2types/ent/card/where.go index 4bd90dfca..e87ea5e64 100644 --- a/examples/o2o2types/ent/card/where.go +++ b/examples/o2o2types/ent/card/where.go @@ -131,7 +131,6 @@ func ExpiredIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -149,7 +148,6 @@ func ExpiredNotIn(vs ...time.Time) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -209,7 +207,6 @@ func NumberIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -227,7 +224,6 @@ func NumberNotIn(vs ...string) predicate.Card { for i := range v { v[i] = vs[i] } - return predicate.Card(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/o2o2types/ent/user/where.go b/examples/o2o2types/ent/user/where.go index a6d40a557..20529611d 100644 --- a/examples/o2o2types/ent/user/where.go +++ b/examples/o2o2types/ent/user/where.go @@ -129,7 +129,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -207,7 +205,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -225,7 +222,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/o2obidi/ent/user/where.go b/examples/o2obidi/ent/user/where.go index cbd330144..85683fb29 100644 --- a/examples/o2obidi/ent/user/where.go +++ b/examples/o2obidi/ent/user/where.go @@ -129,7 +129,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -207,7 +205,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -225,7 +222,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/o2orecur/ent/node/where.go b/examples/o2orecur/ent/node/where.go index d1b245652..e12bc1b40 100644 --- a/examples/o2orecur/ent/node/where.go +++ b/examples/o2orecur/ent/node/where.go @@ -122,7 +122,6 @@ func ValueIn(vs ...int) predicate.Node { for i := range v { v[i] = vs[i] } - return predicate.Node(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func ValueNotIn(vs ...int) predicate.Node { for i := range v { v[i] = vs[i] } - return predicate.Node(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/start/ent/car/where.go b/examples/start/ent/car/where.go index eebc32f9b..8cee619b9 100644 --- a/examples/start/ent/car/where.go +++ b/examples/start/ent/car/where.go @@ -131,7 +131,6 @@ func ModelIn(vs ...string) predicate.Car { for i := range v { v[i] = vs[i] } - return predicate.Car(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -149,7 +148,6 @@ func ModelNotIn(vs ...string) predicate.Car { for i := range v { v[i] = vs[i] } - return predicate.Car(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -244,7 +242,6 @@ func RegisteredAtIn(vs ...time.Time) predicate.Car { for i := range v { v[i] = vs[i] } - return predicate.Car(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -262,7 +259,6 @@ func RegisteredAtNotIn(vs ...time.Time) predicate.Car { for i := range v { v[i] = vs[i] } - return predicate.Car(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/start/ent/group/where.go b/examples/start/ent/group/where.go index dda3e9069..8f8e5fbc4 100644 --- a/examples/start/ent/group/where.go +++ b/examples/start/ent/group/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/start/ent/user/where.go b/examples/start/ent/user/where.go index f8df75803..572235c3a 100644 --- a/examples/start/ent/user/where.go +++ b/examples/start/ent/user/where.go @@ -129,7 +129,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -207,7 +205,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -225,7 +222,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/traversal/ent/group/where.go b/examples/traversal/ent/group/where.go index 952189e55..430dd50d6 100644 --- a/examples/traversal/ent/group/where.go +++ b/examples/traversal/ent/group/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.Group { for i := range v { v[i] = vs[i] } - return predicate.Group(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/traversal/ent/pet/where.go b/examples/traversal/ent/pet/where.go index ce03c2998..e968119f8 100644 --- a/examples/traversal/ent/pet/where.go +++ b/examples/traversal/ent/pet/where.go @@ -122,7 +122,6 @@ func NameIn(vs ...string) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -140,7 +139,6 @@ func NameNotIn(vs ...string) predicate.Pet { for i := range v { v[i] = vs[i] } - return predicate.Pet(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. diff --git a/examples/traversal/ent/user/where.go b/examples/traversal/ent/user/where.go index 782d133d3..7c035e65c 100644 --- a/examples/traversal/ent/user/where.go +++ b/examples/traversal/ent/user/where.go @@ -129,7 +129,6 @@ func AgeIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -147,7 +146,6 @@ func AgeNotIn(vs ...int) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -207,7 +205,6 @@ func NameIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy. @@ -225,7 +222,6 @@ func NameNotIn(vs ...string) predicate.User { for i := range v { v[i] = vs[i] } - return predicate.User(func(s *sql.Selector) { // if not arguments were provided, append the FALSE constants, // since we can't apply "IN ()". This will make this predicate falsy.