entc/gen: fix niladic predicates for id fields (#940)

This commit is contained in:
Ariel Mashraki
2020-11-11 09:40:29 +02:00
committed by GitHub
parent 534dbbe590
commit 4af9a331ae
2 changed files with 3 additions and 3 deletions

View File

@@ -810,7 +810,7 @@ func templateDialectSqlOpenTmpl() (*asset, error) {
return a, nil
}
var _templateDialectSqlPredicateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x56\x4d\x6f\xe3\x36\x10\x3d\x4b\xbf\x62\x60\x04\xa8\x1c\x38\x74\x9c\x5b\x0b\xb8\x40\xe0\xb5\x51\x63\x77\x9d\xb4\x0e\xba\x87\x20\x28\x18\x71\x64\x11\x4b\x93\x0c\x49\xdb\x30\x04\xfd\xf7\x82\x94\x2c\xcb\x71\x9a\x64\x93\xf6\xd4\xdc\x24\xce\xe7\x7b\xf3\x46\x54\x51\xf4\x4f\xe3\x91\xd2\x5b\xc3\x17\xb9\x83\x8b\xf3\xc1\xcf\x67\xda\xa0\x45\xe9\x60\x42\x53\xbc\x57\xea\x3b\x4c\x65\x4a\xe0\x52\x08\x08\x4e\x16\xbc\xdd\xac\x91\x91\xf8\x26\xe7\x16\xac\x5a\x99\x14\x21\x55\x0c\x81\x5b\x10\x3c\x45\x69\x91\xc1\x4a\x32\x34\xe0\x72\x84\x4b\x4d\xd3\x1c\xe1\x82\x9c\xef\xac\x90\xa9\x95\x64\x31\x97\xc1\xfe\x65\x3a\x1a\xcf\xe6\x63\xc8\xb8\x40\xa8\xcf\x8c\x52\x0e\x18\x37\x98\x3a\x65\xb6\xa0\x32\x70\xad\x62\xce\x20\x92\xf8\xb4\x5f\x96\x71\x5c\x14\xc0\x30\xe3\x12\xa1\xc3\x38\x15\x98\xba\xbe\x7d\x10\x7d\x6d\x90\xf1\x94\x3a\xec\x73\xd6\x81\xb3\xb2\x8c\xa3\x6c\x25\xd3\xc4\xc2\xa9\x7d\x10\x64\x8e\x22\xa4\xee\x42\x11\x47\x91\x25\xdf\x72\x34\x98\x78\xcb\xf8\xf7\xc4\x92\x51\x52\x14\x70\x42\xa6\x9f\xc8\x48\x49\xeb\xa8\x74\x50\x96\xdd\x1e\x70\xd6\xed\xc6\x51\x19\x17\xc5\x19\xa0\x64\xf0\xca\x06\xfa\x4a\xdb\xba\x09\x1f\x79\xa2\x34\xfc\x32\x84\x13\x32\x4f\x95\x46\x72\xa5\x5b\x26\x6a\x16\x6d\xdb\xa5\x59\xb4\x8c\xd6\x29\x43\x17\xd8\x76\x98\xd7\x47\x2f\x20\xf4\xe1\x3c\xf3\x95\xc9\x9f\xd4\x70\xca\x78\xea\x9b\x8f\xa2\xa8\xdf\xf7\x06\xa9\x1c\x50\xb3\x58\x2d\x51\x3a\x0b\x1b\x34\x08\xda\xa8\x35\x67\xc8\x7a\x40\xb5\xf6\x60\xfd\x5c\x26\x97\x5f\xe6\x63\x48\x6b\x52\x6c\xaf\xce\x60\xb9\x4c\x11\x36\x08\x29\x95\x3f\x39\x1f\x20\xb6\xd0\x99\xce\x20\xe9\x76\x08\x04\x9d\x6c\xb8\x10\xb0\xa4\xdf\xb1\x9a\x64\x43\x0f\x64\x54\xd8\x2d\xf1\x89\x78\x06\x02\x65\xa0\xde\xd3\x50\x96\x5d\x18\x0e\xe1\x3c\x00\x38\x1c\xd2\x84\x0a\x8b\x89\x9f\x45\x14\x45\x06\xdd\xca\x48\xff\x18\x00\xad\x3d\x3d\xbe\x50\x72\x7b\xc7\xa5\x43\x93\xd1\x14\x8b\xb2\xf7\x38\x77\x08\xce\x94\x01\xee\x03\x0c\x95\x0b\x84\x75\x5d\x6b\x7d\xcb\xef\x60\x08\x7b\xef\x5b\x7e\xb7\x2b\xd0\x9a\xfd\x61\x53\x45\x01\x29\x15\xa2\x19\x13\xb9\xd2\x23\xbf\x15\x7e\xdc\x65\xf9\x8c\xaa\x8a\xe2\x89\xd9\xac\x09\xf1\x19\x51\x58\x84\xb2\xe4\xcc\x3f\x87\xaa\x6f\x50\x60\xc6\x51\xb0\xb6\x00\xb3\xb6\x84\x26\xde\xfa\x0a\x09\xfe\xf0\xfe\x64\xc7\x38\x5b\xe4\xbf\x05\xc3\xe3\x45\x7a\x16\xc7\xc7\x96\xfd\x77\x5b\xf6\xde\x25\x38\x94\x46\xb5\x00\x9e\x1d\x4f\xdd\x8c\x8b\x9a\xb9\xb6\x64\x9e\x5c\x92\x7a\x47\x42\x23\xef\x59\x10\x64\x0b\xec\xe7\xf4\x40\x5b\x07\x02\x18\xb3\xdd\xf4\x83\xcd\x60\xc6\x59\x65\x3f\xdc\xe6\x1a\x09\xc2\x09\x92\x9b\xad\x46\x6f\xae\xc5\xf3\x19\xb7\x95\x7b\xeb\x3d\x04\xd4\xd9\x86\xa0\x0d\x97\xae\x89\x9c\xd1\x25\x42\x27\x88\x7a\xfa\xa9\xb3\x07\xf8\xd2\x2e\x3a\x0c\xba\xb7\x0f\x62\x61\xa8\xce\xc9\x0c\x37\x73\x87\x3a\xf1\xa3\x6b\x0e\x27\x46\x2d\x93\x1b\x7a\x2f\xb0\xe2\xf8\xe8\xa3\x74\xe0\x7d\xa3\xc2\xd0\x90\x84\x88\x96\x5f\x15\x5c\xf5\x7f\x14\xe5\x39\x4b\x9a\xb7\x2a\xc1\x1f\x28\x02\xba\x26\x16\xc9\xd4\x4e\xe5\x1a\x8d\x6d\x9f\x1d\xd5\x09\x12\xdc\xad\x17\x92\xaf\x17\x5f\x2b\x1e\xaa\x63\x7f\x74\xfd\xb9\xe5\x4f\x08\x69\x22\xc2\x17\xf4\x91\xf3\x48\x89\xd5\x52\xb6\x02\xf6\xde\x3b\x86\xa3\x28\xc0\xf1\xe2\x6f\x30\xfc\x46\xed\x0c\xf9\x22\xbf\x57\xc6\x26\xb6\x07\x9e\xeb\xb7\x8b\x6d\xc3\x5d\xfe\x21\xb8\x67\x04\x57\x03\xab\xd4\xd0\xb4\x59\xbd\x55\x40\x90\xd4\xda\x79\x2c\x98\xfd\xcd\x19\x2c\xcd\xb7\xe1\x7f\x2c\xd8\x6f\xdc\xe5\x3b\xd1\xf6\xe0\x9f\xe7\x19\xfe\x89\xfe\xea\x81\xde\xff\x16\x79\xed\xda\xfa\x82\xd0\x89\xed\xee\x6e\x81\xf2\xc7\xc5\x4f\xe5\x2b\x7e\xc7\x07\x41\x4f\x64\x24\x94\xc4\xa4\x4b\xe6\xe8\xae\x13\xc9\x85\xaf\xfb\x74\x73\x21\x77\xdd\xa1\x4e\xec\xc0\x7b\x1e\xdc\x4c\x03\x72\x9d\xbc\xe1\x5e\x50\xe6\xdd\xcd\xf2\x67\x9b\xe5\x19\x70\xf8\x75\x7f\xfb\x0e\xc8\x95\x49\x1a\x7e\xff\x55\x2c\x52\xb9\x17\xc1\xe8\xc4\x92\x99\x72\xc7\xe9\xff\x0e\x00\x00\xff\xff\xea\x12\x8c\xa7\x2a\x0e\x00\x00")
var _templateDialectSqlPredicateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x56\x5d\x6f\xe2\x38\x14\x7d\x4e\x7e\xc5\x15\xaa\xb4\xa1\xa2\xa6\xf4\x6d\x57\x62\xa5\x8a\x01\x2d\x9a\x19\xda\x5d\xaa\x9d\x87\xaa\x5a\xb9\xf1\x0d\xb1\xc6\xd8\xae\x6d\x40\x28\xca\x7f\x5f\xd9\x09\x21\xd0\x99\xb6\xd3\xee\x3e\x4d\xdf\x12\xdf\xcf\x73\xcf\xb9\x71\x8a\xa2\x7f\x1a\x8f\x94\xde\x1a\xbe\xc8\x1d\x5c\x9c\x0f\x7e\x3d\xd3\x06\x2d\x4a\x07\x13\x9a\xe2\xbd\x52\x5f\x61\x2a\x53\x02\x97\x42\x40\x70\xb2\xe0\xed\x66\x8d\x8c\xc4\x37\x39\xb7\x60\xd5\xca\xa4\x08\xa9\x62\x08\xdc\x82\xe0\x29\x4a\x8b\x0c\x56\x92\xa1\x01\x97\x23\x5c\x6a\x9a\xe6\x08\x17\xe4\x7c\x67\x85\x4c\xad\x24\x8b\xb9\x0c\xf6\x4f\xd3\xd1\x78\x36\x1f\x43\xc6\x05\x42\x7d\x66\x94\x72\xc0\xb8\xc1\xd4\x29\xb3\x05\x95\x81\x6b\x15\x73\x06\x91\xc4\xa7\xfd\xb2\x8c\xe3\xa2\x00\x86\x19\x97\x08\x1d\xc6\xa9\xc0\xd4\xf5\xed\x83\xe8\x6b\x83\x8c\xa7\xd4\x61\x9f\xb3\x0e\x9c\x95\x65\x1c\x65\x2b\x99\x26\x16\x4e\xed\x83\x20\x73\x14\x21\x75\x17\x8a\x38\x8a\x2c\xf9\x92\xa3\xc1\xc4\x5b\xc6\x7f\x26\x96\x8c\x92\xa2\x80\x13\x32\xfd\x40\x46\x4a\x5a\x47\xa5\x83\xb2\xec\xf6\x80\xb3\x6e\x37\x8e\xca\xb8\x28\xce\x00\x25\x83\x17\x36\xd0\x57\xda\xd6\x4d\xf8\xc8\x13\xa5\xe1\xb7\x21\x9c\x90\x79\xaa\x34\x92\x2b\xdd\x32\x51\xb3\x68\xdb\x2e\xcd\xa2\x65\xb4\x4e\x19\xba\xc0\xb6\xc3\xbc\x3e\x7a\x06\xa1\x0f\xe7\x99\xaf\x4c\xfe\xa6\x86\x53\xc6\x53\xdf\x7c\x14\x45\xfd\xbe\x37\x48\xe5\x80\x9a\xc5\x6a\x89\xd2\x59\xd8\xa0\x41\xd0\x46\xad\x39\x43\xd6\x03\xaa\xb5\x07\xeb\x79\x99\x5c\x7e\x9a\x8f\x21\xad\x87\x62\x7b\x75\x06\xcb\x65\x8a\xb0\x41\x48\xa9\xfc\xc5\xf9\x00\xb1\x85\xce\x74\x06\x49\xb7\x43\x20\xe8\x64\xc3\x85\x80\x25\xfd\x8a\x15\x93\xcd\x78\x20\xa3\xc2\x6e\x89\x4f\xc4\x33\x10\x28\xc3\xe8\xfd\x18\xca\xb2\x0b\xc3\x21\x9c\x07\x00\x87\x24\x4d\xa8\xb0\x98\x78\x2e\xa2\x28\x32\xe8\x56\x46\xfa\xc7\x00\x68\xed\xc7\xe3\x0b\x25\xb7\x77\x5c\x3a\x34\x19\x4d\xb1\x28\x7b\xc7\xb9\x43\x70\xa6\x0c\x70\x1f\x60\xa8\x5c\x20\xac\xeb\x5a\xeb\x5b\x7e\x07\x43\xd8\x7b\xdf\xf2\xbb\x5d\x81\x16\xf7\x87\x4d\x15\x05\xa4\x54\x88\x86\x26\x72\xa5\x47\x7e\x2b\x3c\xdd\x65\xf9\x5d\x55\x15\xc5\x8e\x00\xcf\xce\x8c\x8b\x9a\x9c\x5e\x65\x38\xa2\x6c\x4d\x88\x2f\x84\xc2\x22\x94\x25\x67\xfe\x39\x34\xd3\x3c\xbc\x42\xa1\x19\x47\xc1\xda\x02\xcd\xda\x12\x9b\x78\xeb\x0b\x24\xfa\xc3\xfb\x95\x1d\x6d\xd7\x21\x39\xaf\xc1\x70\xbc\x68\x4f\xe2\x78\xdf\xc2\xff\x6f\x0b\xdf\xba\x24\xd9\xcb\x56\xa4\x25\x99\x6f\x6e\x4b\xbd\x2c\x6f\x5e\x10\x64\x0b\xec\xe7\xf4\x40\x5b\x07\x02\x18\xb3\x1d\xfb\xc1\x66\x30\xe3\xac\xb2\x1f\x6e\x7b\x8d\x04\xe1\x04\xc9\xcd\x56\xa3\x37\xd7\xe2\xf9\x88\xdb\xca\xbd\xf5\x1e\x02\xea\x6c\x43\xd0\x86\x4b\xd7\x44\xce\xe8\x12\xa1\x13\x44\x3d\xfd\xd0\xd9\x03\x7c\x6e\x17\x1d\x06\xdd\xdb\x07\xb1\x30\x54\xe7\x64\x86\x9b\xb9\x43\x9d\x78\xea\x9a\xc3\x89\x51\xcb\xe4\x86\xde\x0b\xac\x66\xfc\xe8\x2a\x3c\xf0\xbe\x51\x81\x34\x24\x21\xa2\xe5\x57\x05\x57\xfd\x3f\x8a\xf2\x33\x4b\x9a\xb7\x2a\xc1\x5f\x28\x02\xba\x26\x16\xc9\xd4\x4e\xe5\x1a\x8d\x6d\x9f\x3d\xaa\x13\x24\xb8\x5b\x2f\x24\x9f\x2f\x3e\x57\x73\xa8\x8e\xfd\xd1\xf5\xc7\x96\x3f\x21\xa4\x89\x08\x9f\xd2\x23\xe7\x91\x12\xab\xa5\x6c\x05\xec\xbd\x77\x13\x8e\xa2\x00\xc7\x8b\xbf\xc1\xf0\x07\xb5\x33\xe4\x8b\xfc\x5e\x19\x9b\xd8\x1e\xf8\x59\xbf\x5e\x6c\x1b\xee\xf2\x77\xc1\x3d\x21\xb8\x1a\x58\xa5\x86\xa6\xcd\xea\xad\x02\x82\xa4\xd6\xce\xb1\x60\xf6\x57\x68\xb0\x34\xdf\x86\x9f\x58\xb0\x5f\xb8\xcb\x77\xa2\xed\xc1\xf7\xf9\x0c\xff\x4c\xff\xf4\x40\xef\x7f\x9b\xbc\x76\x6d\x7d\x41\xe8\xc4\x76\x77\xb7\x40\xf9\xe3\xe2\xa7\xf2\x05\xbf\xeb\x83\xa0\x27\x32\x12\x4a\x62\xd2\x25\x73\x74\xd7\x89\xe4\xc2\xd7\xfd\x76\x73\x21\x77\xdd\xa1\x4e\xec\xc0\x7b\x1e\xdc\x4c\x03\x72\x9d\xbc\xe2\x5e\x50\xe6\xcd\xcd\xf2\x27\x9b\xe5\x19\x70\xf8\x7d\x7f\xfb\x0e\xc8\x95\x49\x9a\xf9\xfe\xa7\x58\xa4\x72\xcf\x82\xd1\x89\x25\x33\xe5\x1e\xa7\xff\x37\x00\x00\xff\xff\x73\xc9\x25\xad\x4a\x0e\x00\x00")
func templateDialectSqlPredicateTmplBytes() ([]byte, error) {
return bindataRead(
@@ -825,7 +825,7 @@ func templateDialectSqlPredicateTmpl() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "template/dialect/sql/predicate.tmpl", size: 3626, mode: os.FileMode(420), modTime: time.Unix(1, 0)}
info := bindataFileInfo{name: "template/dialect/sql/predicate.tmpl", size: 3658, mode: os.FileMode(420), modTime: time.Unix(1, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}

View File

@@ -27,7 +27,7 @@ in the LICENSE file in the root directory of this source tree.
v[i] = {{ $arg }}[i]
}
{{- end }}
s.Where(sql.{{ call $storage.OpCode $op }}(s.C({{ $.ID.Constant }}), {{ if $op.Variadic }}v...{{ else }}id{{ end }}))
s.Where(sql.{{ call $storage.OpCode $op }}(s.C({{ $.ID.Constant }}){{ if not $op.Niladic }},{{ if $op.Variadic }}v...{{ else }}id{{ end }}{{ end }}))
}
{{- end }}