From 9f9596c1847e59bcecc67f6e85c1f81899a9725b Mon Sep 17 00:00:00 2001 From: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Date: Sun, 9 Feb 2020 11:38:03 +0200 Subject: [PATCH] entc/gen: better formatted codegen for predicates (#336) --- entc/gen/internal/bindata.go | 4 +- entc/gen/template/where.tmpl | 36 +- entc/integration/config/ent/user/where.go | 76 +- entc/integration/customid/ent/blob/where.go | 103 +-- entc/integration/customid/ent/group/where.go | 82 +- entc/integration/customid/ent/user/where.go | 94 +-- entc/integration/ent/card/where.go | 234 ++---- entc/integration/ent/comment/where.go | 165 ++-- entc/integration/ent/fieldtype/where.go | 759 ++++++----------- entc/integration/ent/file/where.go | 255 +++--- entc/integration/ent/filetype/where.go | 126 ++- entc/integration/ent/group/where.go | 261 +++--- entc/integration/ent/groupinfo/where.go | 153 ++-- entc/integration/ent/item/where.go | 78 +- entc/integration/ent/node/where.go | 123 ++- entc/integration/ent/pet/where.go | 132 ++- entc/integration/ent/spec/where.go | 84 +- entc/integration/ent/user/where.go | 444 ++++------ entc/integration/gremlin/ent/card/where.go | 228 ++---- entc/integration/gremlin/ent/comment/where.go | 171 ++-- .../gremlin/ent/fieldtype/where.go | 765 ++++++------------ entc/integration/gremlin/ent/file/where.go | 243 ++---- .../integration/gremlin/ent/filetype/where.go | 126 ++- entc/integration/gremlin/ent/group/where.go | 255 +++--- .../gremlin/ent/groupinfo/where.go | 153 ++-- entc/integration/gremlin/ent/item/where.go | 84 +- entc/integration/gremlin/ent/node/where.go | 129 ++- entc/integration/gremlin/ent/pet/where.go | 132 ++- entc/integration/gremlin/ent/spec/where.go | 90 +-- entc/integration/gremlin/ent/user/where.go | 420 ++++------ entc/integration/idtype/ent/user/where.go | 136 ++-- entc/integration/json/ent/user/where.go | 112 +-- entc/integration/migrate/entv1/car/where.go | 82 +- entc/integration/migrate/entv1/user/where.go | 358 +++----- entc/integration/migrate/entv2/car/where.go | 82 +- entc/integration/migrate/entv2/group/where.go | 76 +- entc/integration/migrate/entv2/pet/where.go | 76 +- entc/integration/migrate/entv2/user/where.go | 415 ++++------ entc/integration/template/ent/group/where.go | 103 +-- entc/integration/template/ent/pet/where.go | 142 ++-- entc/integration/template/ent/user/where.go | 130 ++- examples/edgeindex/ent/city/where.go | 124 ++- examples/edgeindex/ent/street/where.go | 124 ++- examples/entcpkg/ent/user/where.go | 76 +- examples/m2m2types/ent/group/where.go | 124 ++- examples/m2m2types/ent/user/where.go | 151 ++-- examples/m2mbidi/ent/user/where.go | 151 ++-- examples/m2mrecur/ent/user/where.go | 157 ++-- examples/o2m2types/ent/pet/where.go | 124 ++- examples/o2m2types/ent/user/where.go | 151 ++-- examples/o2mrecur/ent/node/where.go | 115 +-- examples/o2o2types/ent/card/where.go | 151 ++-- examples/o2o2types/ent/user/where.go | 151 ++-- examples/o2obidi/ent/user/where.go | 151 ++-- examples/o2orecur/ent/node/where.go | 115 +-- examples/start/ent/car/where.go | 151 ++-- examples/start/ent/group/where.go | 124 ++- examples/start/ent/user/where.go | 157 ++-- examples/traversal/ent/group/where.go | 130 ++- examples/traversal/ent/pet/where.go | 130 ++- examples/traversal/ent/user/where.go | 169 ++-- 61 files changed, 3783 insertions(+), 6660 deletions(-) diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index 7b7509b33..83906812e 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -1001,7 +1001,7 @@ func templateTxTmpl() (*asset, error) { return a, nil } -var _templateWhereTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x57\x4d\x6f\xe3\x36\x13\x3e\x4b\xbf\x62\x20\x68\xf1\xda\x41\x42\xed\xbb\xb7\x16\xc8\xc1\xd8\x64\xb1\x2e\x0a\xbb\x6d\x16\xed\x21\x08\x0a\x46\x1c\x59\x44\x64\x52\x4b\xd2\xce\x06\x82\xff\x7b\x31\xa4\x2c\x39\xfe\x48\x9c\xae\xb1\xe8\xcd\x26\x87\xf3\xf1\x3c\xcf\x0c\xc5\xa6\xc9\xce\xe2\x8f\xba\x7e\x32\x72\x56\x3a\xf8\xf0\xfe\xff\x3f\x5d\xd4\x06\x2d\x2a\x07\x9f\x78\x8e\xf7\x5a\x3f\xc0\x58\xe5\x0c\x46\x55\x05\xde\xc8\x02\xed\x9b\x25\x0a\x16\x7f\x29\xa5\x05\xab\x17\x26\x47\xc8\xb5\x40\x90\x16\x2a\x99\xa3\xb2\x28\x60\xa1\x04\x1a\x70\x25\xc2\xa8\xe6\x79\x89\xf0\x81\xbd\x5f\xef\x42\xa1\x17\x4a\xc4\x52\xf9\xfd\x5f\xc7\x1f\xaf\x27\x37\xd7\x50\xc8\x0a\xa1\x5d\x33\x5a\x3b\x10\xd2\x60\xee\xb4\x79\x02\x5d\x80\xdb\x08\xe6\x0c\x22\x8b\xcf\xb2\xd5\x2a\x8e\x9b\x06\x04\x16\x52\x21\x24\x8f\x25\x1a\x4c\x20\xac\x5e\xc0\xa3\x74\x25\xe0\x37\x87\x4a\x40\x0a\xc9\x6f\x3c\x7f\xe0\x33\x4c\x20\x65\xed\x4f\xb8\x58\xad\xe2\xa8\x69\xc0\xe1\xbc\xae\xb8\x43\x48\x4a\xe4\x02\x4d\x02\x8c\xbc\x34\x0d\xd0\xd9\x36\x4a\x6f\x24\xe7\xb5\x36\x2e\x81\xd4\x6f\x65\x19\x8c\xaf\x28\x79\x87\xc6\xc2\x12\x8d\x93\x39\x5a\xb8\xe7\x84\x82\xf6\xe5\x48\x03\x52\xa0\x72\xb2\x90\x68\x58\x5c\x2c\x54\x0e\xe3\xab\x81\x14\xd0\x34\x90\xb2\xf1\x15\xfb\xf2\x54\x23\xac\x56\x43\xa8\x0d\x0a\x99\x73\x87\xcc\x6f\x4d\xf8\x9c\xd6\xa1\x89\x23\x83\x6e\x61\xd4\x01\x83\x41\x1c\x51\x21\xa9\x9b\xd7\x15\xfc\x7c\x09\xb5\x91\xca\x15\x90\x08\xc9\x2b\xcc\x5d\xf6\xce\x66\xdd\xc1\x4c\x0a\x02\xe1\xc6\x69\x43\x20\x10\x06\x11\xe1\xf5\xad\xab\x30\xb8\xa1\xf2\xce\xe3\x68\x18\x87\xfa\x0d\x57\x33\x84\xf4\xef\x73\x48\x75\x4d\x31\x74\x6d\x7d\xf2\xd0\xa2\x98\x72\x33\xa3\xf5\x84\xfc\xaf\x56\x4d\x03\xb2\x20\x5b\xf6\x27\x37\x92\x0b\x99\x87\x45\x6f\xe6\xad\x6c\x6b\xd6\x82\xec\x7d\x78\x6c\x36\x0a\x18\x5f\xbd\xb3\x89\xf7\xd2\x56\x1a\x47\x59\x06\x9d\xe5\x6a\x05\xbc\xae\x2b\x89\xd6\xcb\x86\xd6\x7b\xd3\x1e\xab\x96\x87\x40\x14\x56\x82\xc5\x91\x3f\xbe\xe1\x67\xb0\x4e\x8d\xd0\xde\x97\x3a\x63\xac\xcb\xf5\x0d\xb4\xbd\xce\x5b\xb4\x47\xac\x23\x33\x4b\x42\x3a\xc9\xb4\xf6\xf5\x43\xd2\x12\xb6\xc9\x9d\x17\x70\xf4\x26\xea\x33\x5d\xdb\x1d\xfa\xf7\x0b\x80\x05\x01\x78\xf7\x94\x57\x88\x36\x8c\xa3\xed\xd6\xd8\x90\x46\x41\x29\xa4\xec\x13\xa1\x6c\x5b\x56\xb3\x33\xf8\xe5\x66\x3a\x81\x9c\x2b\xa5\x1d\xdc\xd3\xb4\x98\xd7\xdc\xd0\x94\xb0\x52\xcd\x20\xb9\x4c\x80\x2b\x01\xd7\x6a\x31\x87\x92\x5b\xe0\xe0\x08\xd9\xd0\xd8\x22\x80\x43\xfc\x79\xf2\x40\x11\x76\xbe\xfb\x7d\xda\xb2\x00\x72\x3b\xd0\x06\xd2\x82\x8d\xad\x8f\xe5\x7f\x91\xbf\xe1\x5a\xe0\xbd\xb6\xd2\x82\xdd\x38\xb3\xc8\x9d\xcf\x32\xec\x1f\x10\x15\x7e\x5d\xf0\x4a\xba\x27\xc8\x4b\xcc\x1f\x76\x05\xd5\x34\xf0\x75\xa1\x09\xb1\xa2\x23\x3d\x28\x0c\xc6\xee\x7f\xb6\x6d\xfb\x9c\x57\xe0\xf4\x66\x80\xeb\xdf\x59\x1c\xed\x6a\x70\x19\xfe\x1d\xa5\xab\x23\x84\xb5\x4f\x59\xbe\xe6\x84\x88\x5a\x8b\xe7\x78\xf5\x14\xed\xd9\x6d\xf1\xbc\xac\x9e\xe7\xf2\x21\xfd\x44\x2d\x73\xad\x84\xde\x24\x26\xea\x05\xdb\x8d\x9f\x62\xbd\xea\xab\xec\x12\x63\xd3\xda\xf6\xbc\x93\xe5\x25\x51\x8a\x4a\xd8\xf0\x77\x90\xf3\xaa\xda\xb2\x4f\x8b\xe1\xda\xdb\xc6\x44\xda\x19\x7b\xfe\xfc\xf6\xc8\x5b\x1e\x33\xf1\x96\xaf\x0e\xbc\x6d\x69\x3e\x9b\x7b\x9e\x26\x12\x46\x90\x30\x69\x84\x8c\xa9\x81\xba\xd8\x6b\xd5\xb7\x81\xbd\xf9\x25\x38\x23\xe7\xeb\x3b\x2f\xac\xf5\x77\xe0\xb3\x84\xbe\x63\xb4\x1e\xee\x84\xfd\xb3\xb6\xed\x5a\xef\x53\x56\x5b\x60\x1d\x3b\x83\x5d\xe8\x93\x6e\xed\xc5\x86\x69\x67\xc5\x96\x4b\x92\xe4\x92\x20\x9d\xf3\x07\x1c\xdc\xde\x49\xe5\xd0\x14\x3c\xc7\x66\x75\x0e\x15\xaa\x8d\x7b\x61\x48\xd2\x8d\x0a\x6d\x40\xd2\x81\xa0\x8c\x65\x68\xc6\x68\x79\x2b\xef\xe0\x12\x7a\xeb\x5b\x79\x47\x1b\xeb\xdb\x75\x0d\xf1\x77\xdf\x07\x7d\x03\x9f\xf6\x6a\xf0\x64\x9d\xe6\x76\xd8\x68\xa1\x83\xbd\x1d\x64\xcc\xae\xc5\x0c\xed\x81\x66\x48\x3e\x73\x4a\x06\x77\xa6\xf5\x0b\x32\xfd\xcc\x2d\xb9\x7c\x49\x9f\xd8\xa9\x02\xc5\x0c\xf7\xc9\xf3\xf4\xf7\x39\xe5\x44\xa5\xbc\x9d\x16\xca\x31\x2b\xf9\x89\x58\x09\x25\xf6\x21\xdf\xd9\xbf\xa4\x2b\x93\xae\xf4\xd3\x62\x1b\x50\xe0\x30\x93\x4b\x54\x90\x6b\x25\xa4\x93\x5a\x59\x18\x68\x57\xa2\xe9\x1d\xd9\xe1\x3e\x1a\x68\xdb\x02\x63\xec\x39\xd6\x18\x46\x5f\x1b\xe8\xbf\xc8\xd5\x63\xc0\xf4\x74\xdf\x58\x59\x06\x23\x25\x60\x66\xf4\xa2\xa6\x37\x96\x75\xf4\x24\xea\xe1\xeb\xbf\x90\x46\x93\x2b\xd0\x35\x1a\xee\xb4\x81\x7b\x74\x8f\x88\x9e\xa3\x79\xfb\xec\x18\x29\x31\xd8\x38\xb7\x03\xee\x31\xb0\x9e\xee\x25\xc2\xd5\x71\x4f\x11\xb6\xf1\x14\xc9\x32\x98\x9a\x63\xa0\x98\xfe\xf1\x22\x12\x53\xf3\x03\x81\x78\x05\x07\x6d\xfe\x0d\x0c\x13\xed\x9e\xf5\x27\xdd\xa7\x5d\xc5\x6d\x6b\x86\xd6\xeb\x33\x0c\xb5\x4f\xb4\x1b\xd4\x07\xf2\xfe\x21\x05\x2b\xed\xde\x5c\x71\xdf\x0f\xff\x04\x00\x00\xff\xff\xcb\x55\x65\x97\xb8\x10\x00\x00") +var _templateWhereTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x57\x4d\x6f\xe3\x36\x13\x3e\x4b\xbf\x62\x20\x28\x78\xed\x60\x43\xed\xbb\xb7\x16\xc8\xc1\xd8\x64\xb1\x2e\x0a\xbb\x6d\x16\xed\x21\x08\x0a\x46\x1c\x59\x44\x64\x52\x4b\xd2\xce\x06\x82\xff\x7b\x31\xa4\x2c\x39\xfe\x48\x9c\xae\x51\xec\xcd\x26\x87\xf3\xf1\x3c\xcf\x0c\xc5\xa6\xc9\xce\xe3\x8f\xba\x7e\x32\x72\x56\x3a\xf8\xf0\xfe\xff\x3f\x5d\xd4\x06\x2d\x2a\x07\x9f\x78\x8e\xf7\x5a\x3f\xc0\x58\xe5\x0c\x46\x55\x05\xde\xc8\x02\xed\x9b\x25\x0a\x16\x7f\x29\xa5\x05\xab\x17\x26\x47\xc8\xb5\x40\x90\x16\x2a\x99\xa3\xb2\x28\x60\xa1\x04\x1a\x70\x25\xc2\xa8\xe6\x79\x89\xf0\x81\xbd\x5f\xef\x42\xa1\x17\x4a\xc4\x52\xf9\xfd\x5f\xc7\x1f\xaf\x27\x37\xd7\x50\xc8\x0a\xa1\x5d\x33\x5a\x3b\x10\xd2\x60\xee\xb4\x79\x02\x5d\x80\xdb\x08\xe6\x0c\x22\x8b\xcf\xb3\xd5\x2a\x8e\x9b\x06\x04\x16\x52\x21\x24\x8f\x25\x1a\x4c\x20\xac\x5e\xc0\xa3\x74\x25\xe0\x37\x87\x4a\x40\x0a\xc9\x6f\x3c\x7f\xe0\x33\x4c\x20\x65\xed\x4f\xb8\x58\xad\xe2\xa8\x69\xc0\xe1\xbc\xae\xb8\x43\x48\x4a\xe4\x02\x4d\x02\x8c\xbc\x34\x0d\xd0\xd9\x36\x4a\x6f\x24\xe7\xb5\x36\x2e\x81\xd4\x6f\x65\x19\x8c\xaf\x28\x79\x87\xc6\xc2\x12\x8d\x93\x39\x5a\xb8\xe7\x84\x82\xf6\xe5\x48\x03\x52\xa0\x72\xb2\x90\x68\x58\x5c\x2c\x54\x0e\xe3\xab\x81\x14\xd0\x34\x90\xb2\xf1\x15\xfb\xf2\x54\x23\xac\x56\x43\xa8\x0d\x0a\x99\x73\x87\xcc\x6f\x4d\xf8\x9c\xd6\xa1\x89\x23\x83\x6e\x61\xd4\x01\x83\x41\x1c\x45\x54\x73\xea\xe6\x75\x05\x3f\x5f\x42\x6d\xa4\x72\x05\x24\x42\xf2\x0a\x73\x97\x9d\xd9\xac\x3b\x99\x49\x41\x28\xdc\x38\x6d\x08\x05\x02\xc1\x1f\xfe\xd6\x95\x18\xdc\xa4\x01\xa0\x61\x1c\x00\x30\x5c\xcd\x10\xd2\xbf\xdf\x41\xaa\x6b\x8a\xa1\x6b\xeb\xb3\x87\x16\xc6\x94\x9b\x19\xad\x27\xe4\x7f\xb5\x6a\x1a\x90\x05\xd9\xb2\x3f\xb9\x91\x5c\xc8\x3c\x2c\x7a\x33\x6f\x65\x5b\xb3\x16\x65\xef\xc3\x83\xb3\x51\xc0\xf8\xea\xcc\x26\xde\x4b\x5b\x6a\x1c\x65\x19\x74\x96\xab\x15\xf0\xba\xae\x24\x5a\xaf\x1b\x5a\xef\x4d\x7b\xb0\x5a\x22\x02\x53\x58\x09\x16\x47\xfe\xf8\x86\x9f\xc1\x3a\x35\x82\x7b\x5f\xea\x8c\xb1\x2e\xd7\x37\xf0\xf6\x3a\x71\xd1\x1e\xb5\x8e\xcc\x2c\x09\xe9\x24\xd3\xda\xd7\x0f\x49\x4b\xd8\x26\x77\x9e\x20\xef\xe1\x68\xea\x33\x5d\xdb\x1d\xfa\xf7\x0b\x80\xb5\x9b\xb4\x47\x79\x85\x68\xc3\x38\xda\xee\x8d\x0d\x69\x14\x94\x42\xca\x3e\x11\xca\xb6\x65\x35\x3b\x87\x5f\x6e\xa6\x13\xc8\xb9\x52\xda\xc1\x3d\x8d\x8b\x79\xcd\x0d\x8d\x09\x2b\xd5\x0c\x92\xcb\x04\xb8\x12\x70\xad\x16\x73\x28\xb9\x05\x0e\x8e\x90\x0d\x9d\x2d\x02\x38\xc4\x9f\x27\x0f\x14\x61\xe7\xdb\xdf\xa7\x26\x0b\x20\xb7\x03\x6d\x20\x2d\xd8\xd8\xfa\x58\xfe\x17\xf9\x1b\xae\x05\xde\x6b\x2b\x2d\xd8\x8d\x33\x8b\xdc\xf9\x2c\xc3\xfe\x01\x51\xe1\xd7\x05\xaf\xa4\x7b\x82\xbc\xc4\xfc\x61\x57\x50\x4d\x03\x5f\x17\x9a\x10\x2b\x3a\xd2\x83\xc2\x60\xec\xfe\x67\xdb\xbe\xcf\x79\x05\x4e\x6f\x06\xb8\xfe\x9d\xc5\xd1\xae\x06\x97\xe1\xdf\x51\xba\x3a\x42\x58\xfb\x94\xe5\x6b\x4e\x88\xa8\xb5\x78\x8e\x57\x4f\xd1\x9e\xdd\x16\xcf\x8b\xea\xd9\x92\x0f\xe9\x27\x6a\x99\x6b\x25\xf4\x26\x31\x51\x2f\xd8\x6e\xfc\x14\xeb\x55\x5f\x65\x97\x18\x9b\xd6\xb6\xe7\x9d\x2c\x2f\x89\x52\x54\xc2\x86\xbf\x83\x9c\x57\xd5\x96\x7d\x5a\x0c\xd7\xde\x36\x26\xd2\xce\xd8\xf3\xe7\xb7\x47\xde\xf2\x98\x89\xb7\x7c\x75\xe0\x6d\x4b\xf3\xd9\xdc\xf3\x34\x91\x30\x82\x84\x49\x23\x64\x4c\x0d\xd4\xc5\x5e\xab\xbe\x0d\xec\xcd\x2f\xc1\x19\x39\x5f\x5f\x7a\x61\xad\xbf\x04\x9f\x25\xf4\x1d\xa3\xf5\x70\x27\xec\x9f\xb5\x6d\xd7\x7a\x9f\xb2\xda\x02\xeb\xd8\x19\xec\x42\x9f\x74\x6b\x2f\x36\x4c\x3b\x2b\xb6\x5c\x92\x24\x97\x04\xe9\x9c\x3f\xe0\xe0\xf6\x4e\x2a\x87\xa6\xe0\x39\x36\xab\x77\x50\xa1\xda\xb8\x17\x86\x24\xdd\xa8\xd0\x06\x24\x1d\x08\xca\x58\x86\x66\x8c\x96\xb7\xf2\x0e\x2e\xa1\xb7\xbe\x95\x77\xb4\xb1\xbe\x5d\xd7\x10\x7f\xf7\x7d\xd0\x37\xf0\x69\xaf\x06\x4f\xd6\x69\x6e\x87\x8d\x16\x3a\xd8\xdb\x41\xc6\xec\x5a\xcc\xd0\x1e\x68\x86\xe4\x33\xa7\x64\x70\x67\x5a\xbf\x20\xd3\xcf\xdc\x92\xcb\x97\xf4\x89\x9d\x2a\x50\xcc\x70\x9f\x3c\x4f\x7f\x9f\x53\x4e\x54\xca\xdb\x69\xa1\x1c\xb3\x92\x9f\x88\x95\x50\x62\x1f\xf2\xcc\xfe\x25\x5d\x99\x74\xa5\x9f\x16\xdb\x80\x02\x87\x99\x5c\xa2\x82\x5c\x2b\x21\x9d\xd4\xca\xc2\x40\xbb\x12\x4d\xef\xc8\x0e\xf7\xd1\x40\xdb\x16\x18\x63\xcf\xb1\xc6\x30\xfa\xda\x40\x3f\x22\x57\x8f\x01\xd3\xd3\x7d\x63\x65\x19\x8c\x94\x80\x99\xd1\x8b\x9a\x1e\x59\xd6\xd1\x9b\xa8\x87\xaf\xff\x42\x1a\x4d\xae\x40\xd7\x68\xb8\xd3\x06\xee\xd1\x3d\x22\x7a\x8e\xe6\xed\xbb\x63\xa4\xc4\x60\xe3\xdc\x0e\xb8\xc7\xc0\xfa\x86\xa7\xc8\x2b\x80\x71\x75\xdc\x53\x84\x6d\x3c\x45\xb2\x0c\xa6\xe6\x18\x28\xa6\x7f\xbc\x88\xc4\xd4\xfc\x40\x40\x68\xf3\x6f\x70\x98\x68\xf7\xac\x41\xe9\x42\xed\x4a\x6e\x7b\x33\xf4\x5e\x9f\x62\x28\x7e\xa2\xdd\xa0\x3e\x90\xf8\x7f\x53\xb1\xd2\xee\xcd\x25\xf7\x1d\xf1\x4f\x00\x00\x00\xff\xff\x47\x00\x3c\x5d\xbb\x10\x00\x00") func templateWhereTmplBytes() ([]byte, error) { return bindataRead( @@ -1016,7 +1016,7 @@ func templateWhereTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/where.tmpl", size: 4280, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/where.tmpl", size: 4283, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/where.tmpl b/entc/gen/template/where.tmpl index 9a8dbfb78..ed4c36869 100644 --- a/entc/gen/template/where.tmpl +++ b/entc/gen/template/where.tmpl @@ -15,8 +15,8 @@ in the LICENSE file in the root directory of this source tree. // ID filters vertices based on their identifier. func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { return predicate.{{ $.Name }}( - {{ $tmpl := printf "dialect/%s/predicate/id" $.Storage }} - {{- xtemplate $tmpl $ }}, + {{- $tmpl := printf "dialect/%s/predicate/id" $.Storage }} + {{- xtemplate $tmpl $ -}} ) } @@ -28,8 +28,8 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { return predicate.{{ $.Name }}( {{- with extend $ "Arg" $arg "Op" $op "Storage" $.Storage -}} {{ $tmpl := printf "dialect/%s/predicate/id/ops" $.Storage }} - {{- xtemplate $tmpl . }}, - {{ end -}} + {{- xtemplate $tmpl . }} + {{- end -}} ) } {{ end }} @@ -43,8 +43,8 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { return predicate.{{ $.Name }}( {{- with extend $ "Field" $f -}} {{ $tmpl := printf "dialect/%s/predicate/field" $.Storage }} - {{- xtemplate $tmpl . }}, - {{ end -}} + {{- xtemplate $tmpl . }} + {{- end -}} ) } {{- end }} @@ -70,8 +70,8 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { return predicate.{{ $.Name }}( {{- with extend $ "Arg" $arg "Field" $f "Op" $op "Storage" $.Storage -}} {{ $tmpl := printf "dialect/%s/predicate/field/ops" $.Storage }} - {{- xtemplate $tmpl . }}, - {{ end -}} + {{- xtemplate $tmpl . }} + {{- end -}} ) } {{ end }} @@ -84,8 +84,8 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { return predicate.{{ $.Name }}( {{- with extend $ "Edge" $e -}} {{ $tmpl := printf "dialect/%s/predicate/edge/has" $.Storage }} - {{- xtemplate $tmpl . }}, - {{ end -}} + {{- xtemplate $tmpl . }} + {{- end -}} ) } {{ $func = printf "%sWith" $func }} @@ -94,8 +94,8 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { return predicate.{{ $.Name }}( {{- with extend $ "Edge" $e -}} {{ $tmpl := printf "dialect/%s/predicate/edge/haswith" $.Storage }} - {{- xtemplate $tmpl . }}, - {{ end -}} + {{- xtemplate $tmpl . }} + {{- end -}} ) } {{ end }} @@ -103,24 +103,24 @@ func ID(id {{ $.ID.Type }}) predicate.{{ $.Name }} { // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.{{ $.Name }}) predicate.{{ $.Name }} { return predicate.{{ $.Name }}( - {{ $tmpl := printf "dialect/%s/predicate/and" $.Storage }} - {{- xtemplate $tmpl . }}, + {{- $tmpl = printf "dialect/%s/predicate/and" $.Storage }} + {{- xtemplate $tmpl . -}} ) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.{{ $.Name }}) predicate.{{ $.Name }} { return predicate.{{ $.Name }}( - {{ $tmpl = printf "dialect/%s/predicate/or" $.Storage }} - {{- xtemplate $tmpl . }}, + {{- $tmpl = printf "dialect/%s/predicate/or" $.Storage }} + {{- xtemplate $tmpl . -}} ) } // Not applies the not operator on the given predicate. func Not(p predicate.{{ $.Name }}) predicate.{{ $.Name }} { return predicate.{{ $.Name }}( - {{ $tmpl = printf "dialect/%s/predicate/not" $.Storage }} - {{- xtemplate $tmpl . }}, + {{- $tmpl = printf "dialect/%s/predicate/not" $.Storage }} + {{- xtemplate $tmpl . -}} ) } diff --git a/entc/integration/config/ent/user/where.go b/entc/integration/config/ent/user/where.go index 10a4afc74..6093c5595 100644 --- a/entc/integration/config/ent/user/where.go +++ b/entc/integration/config/ent/user/where.go @@ -13,27 +13,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -50,8 +46,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -68,76 +63,65 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/customid/ent/blob/where.go b/entc/integration/customid/ent/blob/where.go index 38f6483b2..31f74ec9f 100644 --- a/entc/integration/customid/ent/blob/where.go +++ b/entc/integration/customid/ent/blob/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id uuid.UUID) predicate.Blob { - return predicate.Blob( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Blob(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...uuid.UUID) predicate.Blob { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...uuid.UUID) predicate.Blob { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // UUID applies equality check predicate on the "uuid" field. It's identical to UUIDEQ. func UUID(v uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldUUID), v)) - }, - ) + }) } // UUIDEQ applies the EQ predicate on the "uuid" field. func UUIDEQ(v uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldUUID), v)) - }, - ) + }) } // UUIDNEQ applies the NEQ predicate on the "uuid" field. func UUIDNEQ(v uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldUUID), v)) - }, - ) + }) } // UUIDIn applies the In predicate on the "uuid" field. @@ -143,8 +130,7 @@ func UUIDIn(vs ...uuid.UUID) predicate.Blob { return } s.Where(sql.In(s.C(FieldUUID), v...)) - }, - ) + }) } // UUIDNotIn applies the NotIn predicate on the "uuid" field. @@ -161,76 +147,65 @@ func UUIDNotIn(vs ...uuid.UUID) predicate.Blob { return } s.Where(sql.NotIn(s.C(FieldUUID), v...)) - }, - ) + }) } // UUIDGT applies the GT predicate on the "uuid" field. func UUIDGT(v uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldUUID), v)) - }, - ) + }) } // UUIDGTE applies the GTE predicate on the "uuid" field. func UUIDGTE(v uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldUUID), v)) - }, - ) + }) } // UUIDLT applies the LT predicate on the "uuid" field. func UUIDLT(v uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldUUID), v)) - }, - ) + }) } // UUIDLTE applies the LTE predicate on the "uuid" field. func UUIDLTE(v uuid.UUID) predicate.Blob { return predicate.Blob(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldUUID), v)) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Blob) predicate.Blob { - return predicate.Blob( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Blob(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Blob) predicate.Blob { - return predicate.Blob( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Blob(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Blob) predicate.Blob { - return predicate.Blob( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Blob(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/customid/ent/group/where.go b/entc/integration/customid/ent/group/where.go index 67f1b7235..3ef9a8a1f 100644 --- a/entc/integration/customid/ent/group/where.go +++ b/entc/integration/customid/ent/group/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,40 +64,35 @@ func IDNotIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // HasUsers applies the HasEdge predicate on the "users" edge. @@ -114,8 +104,7 @@ func HasUsers() predicate.Group { sqlgraph.Edge(sqlgraph.M2M, false, UsersTable, UsersPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates). @@ -131,44 +120,37 @@ func HasUsersWith(preds ...predicate.User) predicate.Group { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/customid/ent/user/where.go b/entc/integration/customid/ent/user/where.go index a5e8c3565..75d72c562 100644 --- a/entc/integration/customid/ent/user/where.go +++ b/entc/integration/customid/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,40 +64,35 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // HasGroups applies the HasEdge predicate on the "groups" edge. @@ -114,8 +104,7 @@ func HasGroups() predicate.User { sqlgraph.Edge(sqlgraph.M2M, true, GroupsTable, GroupsPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates). @@ -131,8 +120,7 @@ func HasGroupsWith(preds ...predicate.Group) predicate.User { p(s) } }) - }, - ) + }) } // HasParent applies the HasEdge predicate on the "parent" edge. @@ -144,8 +132,7 @@ func HasParent() predicate.User { sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). @@ -161,8 +148,7 @@ func HasParentWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasChildren applies the HasEdge predicate on the "children" edge. @@ -174,8 +160,7 @@ func HasChildren() predicate.User { sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). @@ -191,44 +176,37 @@ func HasChildrenWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/card/where.go b/entc/integration/ent/card/where.go index 822c0c229..a716c36c7 100644 --- a/entc/integration/ent/card/where.go +++ b/entc/integration/ent/card/where.go @@ -17,12 +17,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Card { - return predicate.Card( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Card(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -30,8 +28,7 @@ func IDEQ(id string) predicate.Card { return predicate.Card(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -39,8 +36,7 @@ func IDNEQ(id string) predicate.Card { return predicate.Card(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -57,8 +53,7 @@ func IDIn(ids ...string) predicate.Card { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -75,8 +70,7 @@ func IDNotIn(ids ...string) predicate.Card { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -84,8 +78,7 @@ func IDGT(id string) predicate.Card { return predicate.Card(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -93,8 +86,7 @@ func IDGTE(id string) predicate.Card { return predicate.Card(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -102,8 +94,7 @@ func IDLT(id string) predicate.Card { return predicate.Card(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -111,56 +102,49 @@ func IDLTE(id string) predicate.Card { return predicate.Card(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ. func CreateTime(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldCreateTime), v)) - }, - ) + }) } // UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ. func UpdateTime(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldUpdateTime), v)) - }, - ) + }) } // Number applies equality check predicate on the "number" field. It's identical to NumberEQ. func Number(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNumber), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // CreateTimeEQ applies the EQ predicate on the "create_time" field. func CreateTimeEQ(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldCreateTime), v)) - }, - ) + }) } // CreateTimeNEQ applies the NEQ predicate on the "create_time" field. func CreateTimeNEQ(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldCreateTime), v)) - }, - ) + }) } // CreateTimeIn applies the In predicate on the "create_time" field. @@ -177,8 +161,7 @@ func CreateTimeIn(vs ...time.Time) predicate.Card { return } s.Where(sql.In(s.C(FieldCreateTime), v...)) - }, - ) + }) } // CreateTimeNotIn applies the NotIn predicate on the "create_time" field. @@ -195,56 +178,49 @@ func CreateTimeNotIn(vs ...time.Time) predicate.Card { return } s.Where(sql.NotIn(s.C(FieldCreateTime), v...)) - }, - ) + }) } // CreateTimeGT applies the GT predicate on the "create_time" field. func CreateTimeGT(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldCreateTime), v)) - }, - ) + }) } // CreateTimeGTE applies the GTE predicate on the "create_time" field. func CreateTimeGTE(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldCreateTime), v)) - }, - ) + }) } // CreateTimeLT applies the LT predicate on the "create_time" field. func CreateTimeLT(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldCreateTime), v)) - }, - ) + }) } // CreateTimeLTE applies the LTE predicate on the "create_time" field. func CreateTimeLTE(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldCreateTime), v)) - }, - ) + }) } // UpdateTimeEQ applies the EQ predicate on the "update_time" field. func UpdateTimeEQ(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldUpdateTime), v)) - }, - ) + }) } // UpdateTimeNEQ applies the NEQ predicate on the "update_time" field. func UpdateTimeNEQ(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldUpdateTime), v)) - }, - ) + }) } // UpdateTimeIn applies the In predicate on the "update_time" field. @@ -261,8 +237,7 @@ func UpdateTimeIn(vs ...time.Time) predicate.Card { return } s.Where(sql.In(s.C(FieldUpdateTime), v...)) - }, - ) + }) } // UpdateTimeNotIn applies the NotIn predicate on the "update_time" field. @@ -279,56 +254,49 @@ func UpdateTimeNotIn(vs ...time.Time) predicate.Card { return } s.Where(sql.NotIn(s.C(FieldUpdateTime), v...)) - }, - ) + }) } // UpdateTimeGT applies the GT predicate on the "update_time" field. func UpdateTimeGT(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldUpdateTime), v)) - }, - ) + }) } // UpdateTimeGTE applies the GTE predicate on the "update_time" field. func UpdateTimeGTE(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldUpdateTime), v)) - }, - ) + }) } // UpdateTimeLT applies the LT predicate on the "update_time" field. func UpdateTimeLT(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldUpdateTime), v)) - }, - ) + }) } // UpdateTimeLTE applies the LTE predicate on the "update_time" field. func UpdateTimeLTE(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldUpdateTime), v)) - }, - ) + }) } // NumberEQ applies the EQ predicate on the "number" field. func NumberEQ(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNumber), v)) - }, - ) + }) } // NumberNEQ applies the NEQ predicate on the "number" field. func NumberNEQ(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNumber), v)) - }, - ) + }) } // NumberIn applies the In predicate on the "number" field. @@ -345,8 +313,7 @@ func NumberIn(vs ...string) predicate.Card { return } s.Where(sql.In(s.C(FieldNumber), v...)) - }, - ) + }) } // NumberNotIn applies the NotIn predicate on the "number" field. @@ -363,96 +330,84 @@ func NumberNotIn(vs ...string) predicate.Card { return } s.Where(sql.NotIn(s.C(FieldNumber), v...)) - }, - ) + }) } // NumberGT applies the GT predicate on the "number" field. func NumberGT(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNumber), v)) - }, - ) + }) } // NumberGTE applies the GTE predicate on the "number" field. func NumberGTE(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNumber), v)) - }, - ) + }) } // NumberLT applies the LT predicate on the "number" field. func NumberLT(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNumber), v)) - }, - ) + }) } // NumberLTE applies the LTE predicate on the "number" field. func NumberLTE(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNumber), v)) - }, - ) + }) } // NumberContains applies the Contains predicate on the "number" field. func NumberContains(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldNumber), v)) - }, - ) + }) } // NumberHasPrefix applies the HasPrefix predicate on the "number" field. func NumberHasPrefix(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldNumber), v)) - }, - ) + }) } // NumberHasSuffix applies the HasSuffix predicate on the "number" field. func NumberHasSuffix(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldNumber), v)) - }, - ) + }) } // NumberEqualFold applies the EqualFold predicate on the "number" field. func NumberEqualFold(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldNumber), v)) - }, - ) + }) } // NumberContainsFold applies the ContainsFold predicate on the "number" field. func NumberContainsFold(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldNumber), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -469,8 +424,7 @@ func NameIn(vs ...string) predicate.Card { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -487,96 +441,84 @@ func NameNotIn(vs ...string) predicate.Card { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameIsNil applies the IsNil predicate on the "name" field. func NameIsNil() predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldName))) - }, - ) + }) } // NameNotNil applies the NotNil predicate on the "name" field. func NameNotNil() predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldName))) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. @@ -588,8 +530,7 @@ func HasOwner() predicate.Card { sqlgraph.Edge(sqlgraph.O2O, true, OwnerTable, OwnerColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -605,8 +546,7 @@ func HasOwnerWith(preds ...predicate.User) predicate.Card { p(s) } }) - }, - ) + }) } // HasSpec applies the HasEdge predicate on the "spec" edge. @@ -618,8 +558,7 @@ func HasSpec() predicate.Card { sqlgraph.Edge(sqlgraph.M2M, true, SpecTable, SpecPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasSpecWith applies the HasEdge predicate on the "spec" edge with a given conditions (other predicates). @@ -635,44 +574,37 @@ func HasSpecWith(preds ...predicate.Spec) predicate.Card { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Card) predicate.Card { - return predicate.Card( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Card(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Card) predicate.Card { - return predicate.Card( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Card(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Card) predicate.Card { - return predicate.Card( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Card(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/comment/where.go b/entc/integration/ent/comment/where.go index b0ff7177d..fb4a54449 100644 --- a/entc/integration/ent/comment/where.go +++ b/entc/integration/ent/comment/where.go @@ -15,12 +15,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Comment { - return predicate.Comment( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Comment(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -28,8 +26,7 @@ func IDEQ(id string) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -37,8 +34,7 @@ func IDNEQ(id string) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -55,8 +51,7 @@ func IDIn(ids ...string) predicate.Comment { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -73,8 +68,7 @@ func IDNotIn(ids ...string) predicate.Comment { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -82,8 +76,7 @@ func IDGT(id string) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -91,8 +84,7 @@ func IDGTE(id string) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -100,8 +92,7 @@ func IDLT(id string) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -109,48 +100,42 @@ func IDLTE(id string) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // UniqueInt applies equality check predicate on the "unique_int" field. It's identical to UniqueIntEQ. func UniqueInt(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldUniqueInt), v)) - }, - ) + }) } // UniqueFloat applies equality check predicate on the "unique_float" field. It's identical to UniqueFloatEQ. func UniqueFloat(v float64) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldUniqueFloat), v)) - }, - ) + }) } // NillableInt applies equality check predicate on the "nillable_int" field. It's identical to NillableIntEQ. func NillableInt(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt), v)) - }, - ) + }) } // UniqueIntEQ applies the EQ predicate on the "unique_int" field. func UniqueIntEQ(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldUniqueInt), v)) - }, - ) + }) } // UniqueIntNEQ applies the NEQ predicate on the "unique_int" field. func UniqueIntNEQ(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldUniqueInt), v)) - }, - ) + }) } // UniqueIntIn applies the In predicate on the "unique_int" field. @@ -167,8 +152,7 @@ func UniqueIntIn(vs ...int) predicate.Comment { return } s.Where(sql.In(s.C(FieldUniqueInt), v...)) - }, - ) + }) } // UniqueIntNotIn applies the NotIn predicate on the "unique_int" field. @@ -185,56 +169,49 @@ func UniqueIntNotIn(vs ...int) predicate.Comment { return } s.Where(sql.NotIn(s.C(FieldUniqueInt), v...)) - }, - ) + }) } // UniqueIntGT applies the GT predicate on the "unique_int" field. func UniqueIntGT(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldUniqueInt), v)) - }, - ) + }) } // UniqueIntGTE applies the GTE predicate on the "unique_int" field. func UniqueIntGTE(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldUniqueInt), v)) - }, - ) + }) } // UniqueIntLT applies the LT predicate on the "unique_int" field. func UniqueIntLT(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldUniqueInt), v)) - }, - ) + }) } // UniqueIntLTE applies the LTE predicate on the "unique_int" field. func UniqueIntLTE(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldUniqueInt), v)) - }, - ) + }) } // UniqueFloatEQ applies the EQ predicate on the "unique_float" field. func UniqueFloatEQ(v float64) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldUniqueFloat), v)) - }, - ) + }) } // UniqueFloatNEQ applies the NEQ predicate on the "unique_float" field. func UniqueFloatNEQ(v float64) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldUniqueFloat), v)) - }, - ) + }) } // UniqueFloatIn applies the In predicate on the "unique_float" field. @@ -251,8 +228,7 @@ func UniqueFloatIn(vs ...float64) predicate.Comment { return } s.Where(sql.In(s.C(FieldUniqueFloat), v...)) - }, - ) + }) } // UniqueFloatNotIn applies the NotIn predicate on the "unique_float" field. @@ -269,56 +245,49 @@ func UniqueFloatNotIn(vs ...float64) predicate.Comment { return } s.Where(sql.NotIn(s.C(FieldUniqueFloat), v...)) - }, - ) + }) } // UniqueFloatGT applies the GT predicate on the "unique_float" field. func UniqueFloatGT(v float64) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldUniqueFloat), v)) - }, - ) + }) } // UniqueFloatGTE applies the GTE predicate on the "unique_float" field. func UniqueFloatGTE(v float64) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldUniqueFloat), v)) - }, - ) + }) } // UniqueFloatLT applies the LT predicate on the "unique_float" field. func UniqueFloatLT(v float64) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldUniqueFloat), v)) - }, - ) + }) } // UniqueFloatLTE applies the LTE predicate on the "unique_float" field. func UniqueFloatLTE(v float64) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldUniqueFloat), v)) - }, - ) + }) } // NillableIntEQ applies the EQ predicate on the "nillable_int" field. func NillableIntEQ(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntNEQ applies the NEQ predicate on the "nillable_int" field. func NillableIntNEQ(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntIn applies the In predicate on the "nillable_int" field. @@ -335,8 +304,7 @@ func NillableIntIn(vs ...int) predicate.Comment { return } s.Where(sql.In(s.C(FieldNillableInt), v...)) - }, - ) + }) } // NillableIntNotIn applies the NotIn predicate on the "nillable_int" field. @@ -353,92 +321,79 @@ func NillableIntNotIn(vs ...int) predicate.Comment { return } s.Where(sql.NotIn(s.C(FieldNillableInt), v...)) - }, - ) + }) } // NillableIntGT applies the GT predicate on the "nillable_int" field. func NillableIntGT(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntGTE applies the GTE predicate on the "nillable_int" field. func NillableIntGTE(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntLT applies the LT predicate on the "nillable_int" field. func NillableIntLT(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntLTE applies the LTE predicate on the "nillable_int" field. func NillableIntLTE(v int) predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntIsNil applies the IsNil predicate on the "nillable_int" field. func NillableIntIsNil() predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldNillableInt))) - }, - ) + }) } // NillableIntNotNil applies the NotNil predicate on the "nillable_int" field. func NillableIntNotNil() predicate.Comment { return predicate.Comment(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldNillableInt))) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Comment) predicate.Comment { - return predicate.Comment( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Comment(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Comment) predicate.Comment { - return predicate.Comment( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Comment(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Comment) predicate.Comment { - return predicate.Comment( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Comment(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/fieldtype/where.go b/entc/integration/ent/fieldtype/where.go index ebef90c50..3234674c1 100644 --- a/entc/integration/ent/fieldtype/where.go +++ b/entc/integration/ent/fieldtype/where.go @@ -15,12 +15,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.FieldType { - return predicate.FieldType( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.FieldType(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -28,8 +26,7 @@ func IDEQ(id string) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -37,8 +34,7 @@ func IDNEQ(id string) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -55,8 +51,7 @@ func IDIn(ids ...string) predicate.FieldType { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -73,8 +68,7 @@ func IDNotIn(ids ...string) predicate.FieldType { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -82,8 +76,7 @@ func IDGT(id string) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -91,8 +84,7 @@ func IDGTE(id string) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -100,8 +92,7 @@ func IDLT(id string) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -109,192 +100,168 @@ func IDLTE(id string) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Int applies equality check predicate on the "int" field. It's identical to IntEQ. func Int(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldInt), v)) - }, - ) + }) } // Int8 applies equality check predicate on the "int8" field. It's identical to Int8EQ. func Int8(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldInt8), v)) - }, - ) + }) } // Int16 applies equality check predicate on the "int16" field. It's identical to Int16EQ. func Int16(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldInt16), v)) - }, - ) + }) } // Int32 applies equality check predicate on the "int32" field. It's identical to Int32EQ. func Int32(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldInt32), v)) - }, - ) + }) } // Int64 applies equality check predicate on the "int64" field. It's identical to Int64EQ. func Int64(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldInt64), v)) - }, - ) + }) } // OptionalInt applies equality check predicate on the "optional_int" field. It's identical to OptionalIntEQ. func OptionalInt(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalInt8 applies equality check predicate on the "optional_int8" field. It's identical to OptionalInt8EQ. func OptionalInt8(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt8), v)) - }, - ) + }) } // OptionalInt16 applies equality check predicate on the "optional_int16" field. It's identical to OptionalInt16EQ. func OptionalInt16(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt16), v)) - }, - ) + }) } // OptionalInt32 applies equality check predicate on the "optional_int32" field. It's identical to OptionalInt32EQ. func OptionalInt32(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt32), v)) - }, - ) + }) } // OptionalInt64 applies equality check predicate on the "optional_int64" field. It's identical to OptionalInt64EQ. func OptionalInt64(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt64), v)) - }, - ) + }) } // NillableInt applies equality check predicate on the "nillable_int" field. It's identical to NillableIntEQ. func NillableInt(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableInt8 applies equality check predicate on the "nillable_int8" field. It's identical to NillableInt8EQ. func NillableInt8(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt8), v)) - }, - ) + }) } // NillableInt16 applies equality check predicate on the "nillable_int16" field. It's identical to NillableInt16EQ. func NillableInt16(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt16), v)) - }, - ) + }) } // NillableInt32 applies equality check predicate on the "nillable_int32" field. It's identical to NillableInt32EQ. func NillableInt32(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt32), v)) - }, - ) + }) } // NillableInt64 applies equality check predicate on the "nillable_int64" field. It's identical to NillableInt64EQ. func NillableInt64(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt64), v)) - }, - ) + }) } // ValidateOptionalInt32 applies equality check predicate on the "validate_optional_int32" field. It's identical to ValidateOptionalInt32EQ. func ValidateOptionalInt32(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldValidateOptionalInt32), v)) - }, - ) + }) } // OptionalUint applies equality check predicate on the "optional_uint" field. It's identical to OptionalUintEQ. func OptionalUint(v uint) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalUint), v)) - }, - ) + }) } // OptionalUint8 applies equality check predicate on the "optional_uint8" field. It's identical to OptionalUint8EQ. func OptionalUint8(v uint8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalUint8), v)) - }, - ) + }) } // OptionalUint16 applies equality check predicate on the "optional_uint16" field. It's identical to OptionalUint16EQ. func OptionalUint16(v uint16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalUint16), v)) - }, - ) + }) } // OptionalUint32 applies equality check predicate on the "optional_uint32" field. It's identical to OptionalUint32EQ. func OptionalUint32(v uint32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalUint32), v)) - }, - ) + }) } // OptionalUint64 applies equality check predicate on the "optional_uint64" field. It's identical to OptionalUint64EQ. func OptionalUint64(v uint64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalUint64), v)) - }, - ) + }) } // IntEQ applies the EQ predicate on the "int" field. func IntEQ(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldInt), v)) - }, - ) + }) } // IntNEQ applies the NEQ predicate on the "int" field. func IntNEQ(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldInt), v)) - }, - ) + }) } // IntIn applies the In predicate on the "int" field. @@ -311,8 +278,7 @@ func IntIn(vs ...int) predicate.FieldType { return } s.Where(sql.In(s.C(FieldInt), v...)) - }, - ) + }) } // IntNotIn applies the NotIn predicate on the "int" field. @@ -329,56 +295,49 @@ func IntNotIn(vs ...int) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldInt), v...)) - }, - ) + }) } // IntGT applies the GT predicate on the "int" field. func IntGT(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldInt), v)) - }, - ) + }) } // IntGTE applies the GTE predicate on the "int" field. func IntGTE(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldInt), v)) - }, - ) + }) } // IntLT applies the LT predicate on the "int" field. func IntLT(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldInt), v)) - }, - ) + }) } // IntLTE applies the LTE predicate on the "int" field. func IntLTE(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldInt), v)) - }, - ) + }) } // Int8EQ applies the EQ predicate on the "int8" field. func Int8EQ(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldInt8), v)) - }, - ) + }) } // Int8NEQ applies the NEQ predicate on the "int8" field. func Int8NEQ(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldInt8), v)) - }, - ) + }) } // Int8In applies the In predicate on the "int8" field. @@ -395,8 +354,7 @@ func Int8In(vs ...int8) predicate.FieldType { return } s.Where(sql.In(s.C(FieldInt8), v...)) - }, - ) + }) } // Int8NotIn applies the NotIn predicate on the "int8" field. @@ -413,56 +371,49 @@ func Int8NotIn(vs ...int8) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldInt8), v...)) - }, - ) + }) } // Int8GT applies the GT predicate on the "int8" field. func Int8GT(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldInt8), v)) - }, - ) + }) } // Int8GTE applies the GTE predicate on the "int8" field. func Int8GTE(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldInt8), v)) - }, - ) + }) } // Int8LT applies the LT predicate on the "int8" field. func Int8LT(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldInt8), v)) - }, - ) + }) } // Int8LTE applies the LTE predicate on the "int8" field. func Int8LTE(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldInt8), v)) - }, - ) + }) } // Int16EQ applies the EQ predicate on the "int16" field. func Int16EQ(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldInt16), v)) - }, - ) + }) } // Int16NEQ applies the NEQ predicate on the "int16" field. func Int16NEQ(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldInt16), v)) - }, - ) + }) } // Int16In applies the In predicate on the "int16" field. @@ -479,8 +430,7 @@ func Int16In(vs ...int16) predicate.FieldType { return } s.Where(sql.In(s.C(FieldInt16), v...)) - }, - ) + }) } // Int16NotIn applies the NotIn predicate on the "int16" field. @@ -497,56 +447,49 @@ func Int16NotIn(vs ...int16) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldInt16), v...)) - }, - ) + }) } // Int16GT applies the GT predicate on the "int16" field. func Int16GT(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldInt16), v)) - }, - ) + }) } // Int16GTE applies the GTE predicate on the "int16" field. func Int16GTE(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldInt16), v)) - }, - ) + }) } // Int16LT applies the LT predicate on the "int16" field. func Int16LT(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldInt16), v)) - }, - ) + }) } // Int16LTE applies the LTE predicate on the "int16" field. func Int16LTE(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldInt16), v)) - }, - ) + }) } // Int32EQ applies the EQ predicate on the "int32" field. func Int32EQ(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldInt32), v)) - }, - ) + }) } // Int32NEQ applies the NEQ predicate on the "int32" field. func Int32NEQ(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldInt32), v)) - }, - ) + }) } // Int32In applies the In predicate on the "int32" field. @@ -563,8 +506,7 @@ func Int32In(vs ...int32) predicate.FieldType { return } s.Where(sql.In(s.C(FieldInt32), v...)) - }, - ) + }) } // Int32NotIn applies the NotIn predicate on the "int32" field. @@ -581,56 +523,49 @@ func Int32NotIn(vs ...int32) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldInt32), v...)) - }, - ) + }) } // Int32GT applies the GT predicate on the "int32" field. func Int32GT(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldInt32), v)) - }, - ) + }) } // Int32GTE applies the GTE predicate on the "int32" field. func Int32GTE(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldInt32), v)) - }, - ) + }) } // Int32LT applies the LT predicate on the "int32" field. func Int32LT(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldInt32), v)) - }, - ) + }) } // Int32LTE applies the LTE predicate on the "int32" field. func Int32LTE(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldInt32), v)) - }, - ) + }) } // Int64EQ applies the EQ predicate on the "int64" field. func Int64EQ(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldInt64), v)) - }, - ) + }) } // Int64NEQ applies the NEQ predicate on the "int64" field. func Int64NEQ(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldInt64), v)) - }, - ) + }) } // Int64In applies the In predicate on the "int64" field. @@ -647,8 +582,7 @@ func Int64In(vs ...int64) predicate.FieldType { return } s.Where(sql.In(s.C(FieldInt64), v...)) - }, - ) + }) } // Int64NotIn applies the NotIn predicate on the "int64" field. @@ -665,56 +599,49 @@ func Int64NotIn(vs ...int64) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldInt64), v...)) - }, - ) + }) } // Int64GT applies the GT predicate on the "int64" field. func Int64GT(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldInt64), v)) - }, - ) + }) } // Int64GTE applies the GTE predicate on the "int64" field. func Int64GTE(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldInt64), v)) - }, - ) + }) } // Int64LT applies the LT predicate on the "int64" field. func Int64LT(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldInt64), v)) - }, - ) + }) } // Int64LTE applies the LTE predicate on the "int64" field. func Int64LTE(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldInt64), v)) - }, - ) + }) } // OptionalIntEQ applies the EQ predicate on the "optional_int" field. func OptionalIntEQ(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntNEQ applies the NEQ predicate on the "optional_int" field. func OptionalIntNEQ(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntIn applies the In predicate on the "optional_int" field. @@ -731,8 +658,7 @@ func OptionalIntIn(vs ...int) predicate.FieldType { return } s.Where(sql.In(s.C(FieldOptionalInt), v...)) - }, - ) + }) } // OptionalIntNotIn applies the NotIn predicate on the "optional_int" field. @@ -749,72 +675,63 @@ func OptionalIntNotIn(vs ...int) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldOptionalInt), v...)) - }, - ) + }) } // OptionalIntGT applies the GT predicate on the "optional_int" field. func OptionalIntGT(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntGTE applies the GTE predicate on the "optional_int" field. func OptionalIntGTE(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntLT applies the LT predicate on the "optional_int" field. func OptionalIntLT(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntLTE applies the LTE predicate on the "optional_int" field. func OptionalIntLTE(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntIsNil applies the IsNil predicate on the "optional_int" field. func OptionalIntIsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalInt))) - }, - ) + }) } // OptionalIntNotNil applies the NotNil predicate on the "optional_int" field. func OptionalIntNotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalInt))) - }, - ) + }) } // OptionalInt8EQ applies the EQ predicate on the "optional_int8" field. func OptionalInt8EQ(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt8), v)) - }, - ) + }) } // OptionalInt8NEQ applies the NEQ predicate on the "optional_int8" field. func OptionalInt8NEQ(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalInt8), v)) - }, - ) + }) } // OptionalInt8In applies the In predicate on the "optional_int8" field. @@ -831,8 +748,7 @@ func OptionalInt8In(vs ...int8) predicate.FieldType { return } s.Where(sql.In(s.C(FieldOptionalInt8), v...)) - }, - ) + }) } // OptionalInt8NotIn applies the NotIn predicate on the "optional_int8" field. @@ -849,72 +765,63 @@ func OptionalInt8NotIn(vs ...int8) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldOptionalInt8), v...)) - }, - ) + }) } // OptionalInt8GT applies the GT predicate on the "optional_int8" field. func OptionalInt8GT(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalInt8), v)) - }, - ) + }) } // OptionalInt8GTE applies the GTE predicate on the "optional_int8" field. func OptionalInt8GTE(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalInt8), v)) - }, - ) + }) } // OptionalInt8LT applies the LT predicate on the "optional_int8" field. func OptionalInt8LT(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalInt8), v)) - }, - ) + }) } // OptionalInt8LTE applies the LTE predicate on the "optional_int8" field. func OptionalInt8LTE(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalInt8), v)) - }, - ) + }) } // OptionalInt8IsNil applies the IsNil predicate on the "optional_int8" field. func OptionalInt8IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalInt8))) - }, - ) + }) } // OptionalInt8NotNil applies the NotNil predicate on the "optional_int8" field. func OptionalInt8NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalInt8))) - }, - ) + }) } // OptionalInt16EQ applies the EQ predicate on the "optional_int16" field. func OptionalInt16EQ(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt16), v)) - }, - ) + }) } // OptionalInt16NEQ applies the NEQ predicate on the "optional_int16" field. func OptionalInt16NEQ(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalInt16), v)) - }, - ) + }) } // OptionalInt16In applies the In predicate on the "optional_int16" field. @@ -931,8 +838,7 @@ func OptionalInt16In(vs ...int16) predicate.FieldType { return } s.Where(sql.In(s.C(FieldOptionalInt16), v...)) - }, - ) + }) } // OptionalInt16NotIn applies the NotIn predicate on the "optional_int16" field. @@ -949,72 +855,63 @@ func OptionalInt16NotIn(vs ...int16) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldOptionalInt16), v...)) - }, - ) + }) } // OptionalInt16GT applies the GT predicate on the "optional_int16" field. func OptionalInt16GT(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalInt16), v)) - }, - ) + }) } // OptionalInt16GTE applies the GTE predicate on the "optional_int16" field. func OptionalInt16GTE(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalInt16), v)) - }, - ) + }) } // OptionalInt16LT applies the LT predicate on the "optional_int16" field. func OptionalInt16LT(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalInt16), v)) - }, - ) + }) } // OptionalInt16LTE applies the LTE predicate on the "optional_int16" field. func OptionalInt16LTE(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalInt16), v)) - }, - ) + }) } // OptionalInt16IsNil applies the IsNil predicate on the "optional_int16" field. func OptionalInt16IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalInt16))) - }, - ) + }) } // OptionalInt16NotNil applies the NotNil predicate on the "optional_int16" field. func OptionalInt16NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalInt16))) - }, - ) + }) } // OptionalInt32EQ applies the EQ predicate on the "optional_int32" field. func OptionalInt32EQ(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt32), v)) - }, - ) + }) } // OptionalInt32NEQ applies the NEQ predicate on the "optional_int32" field. func OptionalInt32NEQ(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalInt32), v)) - }, - ) + }) } // OptionalInt32In applies the In predicate on the "optional_int32" field. @@ -1031,8 +928,7 @@ func OptionalInt32In(vs ...int32) predicate.FieldType { return } s.Where(sql.In(s.C(FieldOptionalInt32), v...)) - }, - ) + }) } // OptionalInt32NotIn applies the NotIn predicate on the "optional_int32" field. @@ -1049,72 +945,63 @@ func OptionalInt32NotIn(vs ...int32) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldOptionalInt32), v...)) - }, - ) + }) } // OptionalInt32GT applies the GT predicate on the "optional_int32" field. func OptionalInt32GT(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalInt32), v)) - }, - ) + }) } // OptionalInt32GTE applies the GTE predicate on the "optional_int32" field. func OptionalInt32GTE(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalInt32), v)) - }, - ) + }) } // OptionalInt32LT applies the LT predicate on the "optional_int32" field. func OptionalInt32LT(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalInt32), v)) - }, - ) + }) } // OptionalInt32LTE applies the LTE predicate on the "optional_int32" field. func OptionalInt32LTE(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalInt32), v)) - }, - ) + }) } // OptionalInt32IsNil applies the IsNil predicate on the "optional_int32" field. func OptionalInt32IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalInt32))) - }, - ) + }) } // OptionalInt32NotNil applies the NotNil predicate on the "optional_int32" field. func OptionalInt32NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalInt32))) - }, - ) + }) } // OptionalInt64EQ applies the EQ predicate on the "optional_int64" field. func OptionalInt64EQ(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt64), v)) - }, - ) + }) } // OptionalInt64NEQ applies the NEQ predicate on the "optional_int64" field. func OptionalInt64NEQ(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalInt64), v)) - }, - ) + }) } // OptionalInt64In applies the In predicate on the "optional_int64" field. @@ -1131,8 +1018,7 @@ func OptionalInt64In(vs ...int64) predicate.FieldType { return } s.Where(sql.In(s.C(FieldOptionalInt64), v...)) - }, - ) + }) } // OptionalInt64NotIn applies the NotIn predicate on the "optional_int64" field. @@ -1149,72 +1035,63 @@ func OptionalInt64NotIn(vs ...int64) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldOptionalInt64), v...)) - }, - ) + }) } // OptionalInt64GT applies the GT predicate on the "optional_int64" field. func OptionalInt64GT(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalInt64), v)) - }, - ) + }) } // OptionalInt64GTE applies the GTE predicate on the "optional_int64" field. func OptionalInt64GTE(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalInt64), v)) - }, - ) + }) } // OptionalInt64LT applies the LT predicate on the "optional_int64" field. func OptionalInt64LT(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalInt64), v)) - }, - ) + }) } // OptionalInt64LTE applies the LTE predicate on the "optional_int64" field. func OptionalInt64LTE(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalInt64), v)) - }, - ) + }) } // OptionalInt64IsNil applies the IsNil predicate on the "optional_int64" field. func OptionalInt64IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalInt64))) - }, - ) + }) } // OptionalInt64NotNil applies the NotNil predicate on the "optional_int64" field. func OptionalInt64NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalInt64))) - }, - ) + }) } // NillableIntEQ applies the EQ predicate on the "nillable_int" field. func NillableIntEQ(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntNEQ applies the NEQ predicate on the "nillable_int" field. func NillableIntNEQ(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntIn applies the In predicate on the "nillable_int" field. @@ -1231,8 +1108,7 @@ func NillableIntIn(vs ...int) predicate.FieldType { return } s.Where(sql.In(s.C(FieldNillableInt), v...)) - }, - ) + }) } // NillableIntNotIn applies the NotIn predicate on the "nillable_int" field. @@ -1249,72 +1125,63 @@ func NillableIntNotIn(vs ...int) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldNillableInt), v...)) - }, - ) + }) } // NillableIntGT applies the GT predicate on the "nillable_int" field. func NillableIntGT(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntGTE applies the GTE predicate on the "nillable_int" field. func NillableIntGTE(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntLT applies the LT predicate on the "nillable_int" field. func NillableIntLT(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntLTE applies the LTE predicate on the "nillable_int" field. func NillableIntLTE(v int) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNillableInt), v)) - }, - ) + }) } // NillableIntIsNil applies the IsNil predicate on the "nillable_int" field. func NillableIntIsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldNillableInt))) - }, - ) + }) } // NillableIntNotNil applies the NotNil predicate on the "nillable_int" field. func NillableIntNotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldNillableInt))) - }, - ) + }) } // NillableInt8EQ applies the EQ predicate on the "nillable_int8" field. func NillableInt8EQ(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt8), v)) - }, - ) + }) } // NillableInt8NEQ applies the NEQ predicate on the "nillable_int8" field. func NillableInt8NEQ(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNillableInt8), v)) - }, - ) + }) } // NillableInt8In applies the In predicate on the "nillable_int8" field. @@ -1331,8 +1198,7 @@ func NillableInt8In(vs ...int8) predicate.FieldType { return } s.Where(sql.In(s.C(FieldNillableInt8), v...)) - }, - ) + }) } // NillableInt8NotIn applies the NotIn predicate on the "nillable_int8" field. @@ -1349,72 +1215,63 @@ func NillableInt8NotIn(vs ...int8) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldNillableInt8), v...)) - }, - ) + }) } // NillableInt8GT applies the GT predicate on the "nillable_int8" field. func NillableInt8GT(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNillableInt8), v)) - }, - ) + }) } // NillableInt8GTE applies the GTE predicate on the "nillable_int8" field. func NillableInt8GTE(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNillableInt8), v)) - }, - ) + }) } // NillableInt8LT applies the LT predicate on the "nillable_int8" field. func NillableInt8LT(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNillableInt8), v)) - }, - ) + }) } // NillableInt8LTE applies the LTE predicate on the "nillable_int8" field. func NillableInt8LTE(v int8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNillableInt8), v)) - }, - ) + }) } // NillableInt8IsNil applies the IsNil predicate on the "nillable_int8" field. func NillableInt8IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldNillableInt8))) - }, - ) + }) } // NillableInt8NotNil applies the NotNil predicate on the "nillable_int8" field. func NillableInt8NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldNillableInt8))) - }, - ) + }) } // NillableInt16EQ applies the EQ predicate on the "nillable_int16" field. func NillableInt16EQ(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt16), v)) - }, - ) + }) } // NillableInt16NEQ applies the NEQ predicate on the "nillable_int16" field. func NillableInt16NEQ(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNillableInt16), v)) - }, - ) + }) } // NillableInt16In applies the In predicate on the "nillable_int16" field. @@ -1431,8 +1288,7 @@ func NillableInt16In(vs ...int16) predicate.FieldType { return } s.Where(sql.In(s.C(FieldNillableInt16), v...)) - }, - ) + }) } // NillableInt16NotIn applies the NotIn predicate on the "nillable_int16" field. @@ -1449,72 +1305,63 @@ func NillableInt16NotIn(vs ...int16) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldNillableInt16), v...)) - }, - ) + }) } // NillableInt16GT applies the GT predicate on the "nillable_int16" field. func NillableInt16GT(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNillableInt16), v)) - }, - ) + }) } // NillableInt16GTE applies the GTE predicate on the "nillable_int16" field. func NillableInt16GTE(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNillableInt16), v)) - }, - ) + }) } // NillableInt16LT applies the LT predicate on the "nillable_int16" field. func NillableInt16LT(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNillableInt16), v)) - }, - ) + }) } // NillableInt16LTE applies the LTE predicate on the "nillable_int16" field. func NillableInt16LTE(v int16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNillableInt16), v)) - }, - ) + }) } // NillableInt16IsNil applies the IsNil predicate on the "nillable_int16" field. func NillableInt16IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldNillableInt16))) - }, - ) + }) } // NillableInt16NotNil applies the NotNil predicate on the "nillable_int16" field. func NillableInt16NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldNillableInt16))) - }, - ) + }) } // NillableInt32EQ applies the EQ predicate on the "nillable_int32" field. func NillableInt32EQ(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt32), v)) - }, - ) + }) } // NillableInt32NEQ applies the NEQ predicate on the "nillable_int32" field. func NillableInt32NEQ(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNillableInt32), v)) - }, - ) + }) } // NillableInt32In applies the In predicate on the "nillable_int32" field. @@ -1531,8 +1378,7 @@ func NillableInt32In(vs ...int32) predicate.FieldType { return } s.Where(sql.In(s.C(FieldNillableInt32), v...)) - }, - ) + }) } // NillableInt32NotIn applies the NotIn predicate on the "nillable_int32" field. @@ -1549,72 +1395,63 @@ func NillableInt32NotIn(vs ...int32) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldNillableInt32), v...)) - }, - ) + }) } // NillableInt32GT applies the GT predicate on the "nillable_int32" field. func NillableInt32GT(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNillableInt32), v)) - }, - ) + }) } // NillableInt32GTE applies the GTE predicate on the "nillable_int32" field. func NillableInt32GTE(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNillableInt32), v)) - }, - ) + }) } // NillableInt32LT applies the LT predicate on the "nillable_int32" field. func NillableInt32LT(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNillableInt32), v)) - }, - ) + }) } // NillableInt32LTE applies the LTE predicate on the "nillable_int32" field. func NillableInt32LTE(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNillableInt32), v)) - }, - ) + }) } // NillableInt32IsNil applies the IsNil predicate on the "nillable_int32" field. func NillableInt32IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldNillableInt32))) - }, - ) + }) } // NillableInt32NotNil applies the NotNil predicate on the "nillable_int32" field. func NillableInt32NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldNillableInt32))) - }, - ) + }) } // NillableInt64EQ applies the EQ predicate on the "nillable_int64" field. func NillableInt64EQ(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNillableInt64), v)) - }, - ) + }) } // NillableInt64NEQ applies the NEQ predicate on the "nillable_int64" field. func NillableInt64NEQ(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNillableInt64), v)) - }, - ) + }) } // NillableInt64In applies the In predicate on the "nillable_int64" field. @@ -1631,8 +1468,7 @@ func NillableInt64In(vs ...int64) predicate.FieldType { return } s.Where(sql.In(s.C(FieldNillableInt64), v...)) - }, - ) + }) } // NillableInt64NotIn applies the NotIn predicate on the "nillable_int64" field. @@ -1649,72 +1485,63 @@ func NillableInt64NotIn(vs ...int64) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldNillableInt64), v...)) - }, - ) + }) } // NillableInt64GT applies the GT predicate on the "nillable_int64" field. func NillableInt64GT(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNillableInt64), v)) - }, - ) + }) } // NillableInt64GTE applies the GTE predicate on the "nillable_int64" field. func NillableInt64GTE(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNillableInt64), v)) - }, - ) + }) } // NillableInt64LT applies the LT predicate on the "nillable_int64" field. func NillableInt64LT(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNillableInt64), v)) - }, - ) + }) } // NillableInt64LTE applies the LTE predicate on the "nillable_int64" field. func NillableInt64LTE(v int64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNillableInt64), v)) - }, - ) + }) } // NillableInt64IsNil applies the IsNil predicate on the "nillable_int64" field. func NillableInt64IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldNillableInt64))) - }, - ) + }) } // NillableInt64NotNil applies the NotNil predicate on the "nillable_int64" field. func NillableInt64NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldNillableInt64))) - }, - ) + }) } // ValidateOptionalInt32EQ applies the EQ predicate on the "validate_optional_int32" field. func ValidateOptionalInt32EQ(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldValidateOptionalInt32), v)) - }, - ) + }) } // ValidateOptionalInt32NEQ applies the NEQ predicate on the "validate_optional_int32" field. func ValidateOptionalInt32NEQ(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldValidateOptionalInt32), v)) - }, - ) + }) } // ValidateOptionalInt32In applies the In predicate on the "validate_optional_int32" field. @@ -1731,8 +1558,7 @@ func ValidateOptionalInt32In(vs ...int32) predicate.FieldType { return } s.Where(sql.In(s.C(FieldValidateOptionalInt32), v...)) - }, - ) + }) } // ValidateOptionalInt32NotIn applies the NotIn predicate on the "validate_optional_int32" field. @@ -1749,72 +1575,63 @@ func ValidateOptionalInt32NotIn(vs ...int32) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldValidateOptionalInt32), v...)) - }, - ) + }) } // ValidateOptionalInt32GT applies the GT predicate on the "validate_optional_int32" field. func ValidateOptionalInt32GT(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldValidateOptionalInt32), v)) - }, - ) + }) } // ValidateOptionalInt32GTE applies the GTE predicate on the "validate_optional_int32" field. func ValidateOptionalInt32GTE(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldValidateOptionalInt32), v)) - }, - ) + }) } // ValidateOptionalInt32LT applies the LT predicate on the "validate_optional_int32" field. func ValidateOptionalInt32LT(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldValidateOptionalInt32), v)) - }, - ) + }) } // ValidateOptionalInt32LTE applies the LTE predicate on the "validate_optional_int32" field. func ValidateOptionalInt32LTE(v int32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldValidateOptionalInt32), v)) - }, - ) + }) } // ValidateOptionalInt32IsNil applies the IsNil predicate on the "validate_optional_int32" field. func ValidateOptionalInt32IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldValidateOptionalInt32))) - }, - ) + }) } // ValidateOptionalInt32NotNil applies the NotNil predicate on the "validate_optional_int32" field. func ValidateOptionalInt32NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldValidateOptionalInt32))) - }, - ) + }) } // OptionalUintEQ applies the EQ predicate on the "optional_uint" field. func OptionalUintEQ(v uint) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalUint), v)) - }, - ) + }) } // OptionalUintNEQ applies the NEQ predicate on the "optional_uint" field. func OptionalUintNEQ(v uint) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalUint), v)) - }, - ) + }) } // OptionalUintIn applies the In predicate on the "optional_uint" field. @@ -1831,8 +1648,7 @@ func OptionalUintIn(vs ...uint) predicate.FieldType { return } s.Where(sql.In(s.C(FieldOptionalUint), v...)) - }, - ) + }) } // OptionalUintNotIn applies the NotIn predicate on the "optional_uint" field. @@ -1849,72 +1665,63 @@ func OptionalUintNotIn(vs ...uint) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldOptionalUint), v...)) - }, - ) + }) } // OptionalUintGT applies the GT predicate on the "optional_uint" field. func OptionalUintGT(v uint) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalUint), v)) - }, - ) + }) } // OptionalUintGTE applies the GTE predicate on the "optional_uint" field. func OptionalUintGTE(v uint) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalUint), v)) - }, - ) + }) } // OptionalUintLT applies the LT predicate on the "optional_uint" field. func OptionalUintLT(v uint) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalUint), v)) - }, - ) + }) } // OptionalUintLTE applies the LTE predicate on the "optional_uint" field. func OptionalUintLTE(v uint) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalUint), v)) - }, - ) + }) } // OptionalUintIsNil applies the IsNil predicate on the "optional_uint" field. func OptionalUintIsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalUint))) - }, - ) + }) } // OptionalUintNotNil applies the NotNil predicate on the "optional_uint" field. func OptionalUintNotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalUint))) - }, - ) + }) } // OptionalUint8EQ applies the EQ predicate on the "optional_uint8" field. func OptionalUint8EQ(v uint8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalUint8), v)) - }, - ) + }) } // OptionalUint8NEQ applies the NEQ predicate on the "optional_uint8" field. func OptionalUint8NEQ(v uint8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalUint8), v)) - }, - ) + }) } // OptionalUint8In applies the In predicate on the "optional_uint8" field. @@ -1931,8 +1738,7 @@ func OptionalUint8In(vs ...uint8) predicate.FieldType { return } s.Where(sql.In(s.C(FieldOptionalUint8), v...)) - }, - ) + }) } // OptionalUint8NotIn applies the NotIn predicate on the "optional_uint8" field. @@ -1949,72 +1755,63 @@ func OptionalUint8NotIn(vs ...uint8) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldOptionalUint8), v...)) - }, - ) + }) } // OptionalUint8GT applies the GT predicate on the "optional_uint8" field. func OptionalUint8GT(v uint8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalUint8), v)) - }, - ) + }) } // OptionalUint8GTE applies the GTE predicate on the "optional_uint8" field. func OptionalUint8GTE(v uint8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalUint8), v)) - }, - ) + }) } // OptionalUint8LT applies the LT predicate on the "optional_uint8" field. func OptionalUint8LT(v uint8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalUint8), v)) - }, - ) + }) } // OptionalUint8LTE applies the LTE predicate on the "optional_uint8" field. func OptionalUint8LTE(v uint8) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalUint8), v)) - }, - ) + }) } // OptionalUint8IsNil applies the IsNil predicate on the "optional_uint8" field. func OptionalUint8IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalUint8))) - }, - ) + }) } // OptionalUint8NotNil applies the NotNil predicate on the "optional_uint8" field. func OptionalUint8NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalUint8))) - }, - ) + }) } // OptionalUint16EQ applies the EQ predicate on the "optional_uint16" field. func OptionalUint16EQ(v uint16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalUint16), v)) - }, - ) + }) } // OptionalUint16NEQ applies the NEQ predicate on the "optional_uint16" field. func OptionalUint16NEQ(v uint16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalUint16), v)) - }, - ) + }) } // OptionalUint16In applies the In predicate on the "optional_uint16" field. @@ -2031,8 +1828,7 @@ func OptionalUint16In(vs ...uint16) predicate.FieldType { return } s.Where(sql.In(s.C(FieldOptionalUint16), v...)) - }, - ) + }) } // OptionalUint16NotIn applies the NotIn predicate on the "optional_uint16" field. @@ -2049,72 +1845,63 @@ func OptionalUint16NotIn(vs ...uint16) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldOptionalUint16), v...)) - }, - ) + }) } // OptionalUint16GT applies the GT predicate on the "optional_uint16" field. func OptionalUint16GT(v uint16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalUint16), v)) - }, - ) + }) } // OptionalUint16GTE applies the GTE predicate on the "optional_uint16" field. func OptionalUint16GTE(v uint16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalUint16), v)) - }, - ) + }) } // OptionalUint16LT applies the LT predicate on the "optional_uint16" field. func OptionalUint16LT(v uint16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalUint16), v)) - }, - ) + }) } // OptionalUint16LTE applies the LTE predicate on the "optional_uint16" field. func OptionalUint16LTE(v uint16) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalUint16), v)) - }, - ) + }) } // OptionalUint16IsNil applies the IsNil predicate on the "optional_uint16" field. func OptionalUint16IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalUint16))) - }, - ) + }) } // OptionalUint16NotNil applies the NotNil predicate on the "optional_uint16" field. func OptionalUint16NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalUint16))) - }, - ) + }) } // OptionalUint32EQ applies the EQ predicate on the "optional_uint32" field. func OptionalUint32EQ(v uint32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalUint32), v)) - }, - ) + }) } // OptionalUint32NEQ applies the NEQ predicate on the "optional_uint32" field. func OptionalUint32NEQ(v uint32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalUint32), v)) - }, - ) + }) } // OptionalUint32In applies the In predicate on the "optional_uint32" field. @@ -2131,8 +1918,7 @@ func OptionalUint32In(vs ...uint32) predicate.FieldType { return } s.Where(sql.In(s.C(FieldOptionalUint32), v...)) - }, - ) + }) } // OptionalUint32NotIn applies the NotIn predicate on the "optional_uint32" field. @@ -2149,72 +1935,63 @@ func OptionalUint32NotIn(vs ...uint32) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldOptionalUint32), v...)) - }, - ) + }) } // OptionalUint32GT applies the GT predicate on the "optional_uint32" field. func OptionalUint32GT(v uint32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalUint32), v)) - }, - ) + }) } // OptionalUint32GTE applies the GTE predicate on the "optional_uint32" field. func OptionalUint32GTE(v uint32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalUint32), v)) - }, - ) + }) } // OptionalUint32LT applies the LT predicate on the "optional_uint32" field. func OptionalUint32LT(v uint32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalUint32), v)) - }, - ) + }) } // OptionalUint32LTE applies the LTE predicate on the "optional_uint32" field. func OptionalUint32LTE(v uint32) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalUint32), v)) - }, - ) + }) } // OptionalUint32IsNil applies the IsNil predicate on the "optional_uint32" field. func OptionalUint32IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalUint32))) - }, - ) + }) } // OptionalUint32NotNil applies the NotNil predicate on the "optional_uint32" field. func OptionalUint32NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalUint32))) - }, - ) + }) } // OptionalUint64EQ applies the EQ predicate on the "optional_uint64" field. func OptionalUint64EQ(v uint64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalUint64), v)) - }, - ) + }) } // OptionalUint64NEQ applies the NEQ predicate on the "optional_uint64" field. func OptionalUint64NEQ(v uint64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalUint64), v)) - }, - ) + }) } // OptionalUint64In applies the In predicate on the "optional_uint64" field. @@ -2231,8 +2008,7 @@ func OptionalUint64In(vs ...uint64) predicate.FieldType { return } s.Where(sql.In(s.C(FieldOptionalUint64), v...)) - }, - ) + }) } // OptionalUint64NotIn applies the NotIn predicate on the "optional_uint64" field. @@ -2249,72 +2025,63 @@ func OptionalUint64NotIn(vs ...uint64) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldOptionalUint64), v...)) - }, - ) + }) } // OptionalUint64GT applies the GT predicate on the "optional_uint64" field. func OptionalUint64GT(v uint64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalUint64), v)) - }, - ) + }) } // OptionalUint64GTE applies the GTE predicate on the "optional_uint64" field. func OptionalUint64GTE(v uint64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalUint64), v)) - }, - ) + }) } // OptionalUint64LT applies the LT predicate on the "optional_uint64" field. func OptionalUint64LT(v uint64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalUint64), v)) - }, - ) + }) } // OptionalUint64LTE applies the LTE predicate on the "optional_uint64" field. func OptionalUint64LTE(v uint64) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalUint64), v)) - }, - ) + }) } // OptionalUint64IsNil applies the IsNil predicate on the "optional_uint64" field. func OptionalUint64IsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalUint64))) - }, - ) + }) } // OptionalUint64NotNil applies the NotNil predicate on the "optional_uint64" field. func OptionalUint64NotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalUint64))) - }, - ) + }) } // StateEQ applies the EQ predicate on the "state" field. func StateEQ(v State) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldState), v)) - }, - ) + }) } // StateNEQ applies the NEQ predicate on the "state" field. func StateNEQ(v State) predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldState), v)) - }, - ) + }) } // StateIn applies the In predicate on the "state" field. @@ -2331,8 +2098,7 @@ func StateIn(vs ...State) predicate.FieldType { return } s.Where(sql.In(s.C(FieldState), v...)) - }, - ) + }) } // StateNotIn applies the NotIn predicate on the "state" field. @@ -2349,60 +2115,51 @@ func StateNotIn(vs ...State) predicate.FieldType { return } s.Where(sql.NotIn(s.C(FieldState), v...)) - }, - ) + }) } // StateIsNil applies the IsNil predicate on the "state" field. func StateIsNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldState))) - }, - ) + }) } // StateNotNil applies the NotNil predicate on the "state" field. func StateNotNil() predicate.FieldType { return predicate.FieldType(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldState))) - }, - ) + }) } // 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) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.FieldType(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.FieldType) predicate.FieldType { - return predicate.FieldType( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.FieldType(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.FieldType) predicate.FieldType { - return predicate.FieldType( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.FieldType(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/file/where.go b/entc/integration/ent/file/where.go index a5424de73..4f6aceab5 100644 --- a/entc/integration/ent/file/where.go +++ b/entc/integration/ent/file/where.go @@ -16,12 +16,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.File { - return predicate.File( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.File(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -29,8 +27,7 @@ func IDEQ(id string) predicate.File { return predicate.File(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -38,8 +35,7 @@ func IDNEQ(id string) predicate.File { return predicate.File(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -56,8 +52,7 @@ func IDIn(ids ...string) predicate.File { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -74,8 +69,7 @@ func IDNotIn(ids ...string) predicate.File { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -83,8 +77,7 @@ func IDGT(id string) predicate.File { return predicate.File(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -92,8 +85,7 @@ func IDGTE(id string) predicate.File { return predicate.File(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -101,8 +93,7 @@ func IDLT(id string) predicate.File { return predicate.File(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -110,56 +101,49 @@ func IDLTE(id string) predicate.File { return predicate.File(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Size applies equality check predicate on the "size" field. It's identical to SizeEQ. func Size(v int) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldSize), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // User applies equality check predicate on the "user" field. It's identical to UserEQ. func User(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldUser), v)) - }, - ) + }) } // Group applies equality check predicate on the "group" field. It's identical to GroupEQ. func Group(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldGroup), v)) - }, - ) + }) } // SizeEQ applies the EQ predicate on the "size" field. func SizeEQ(v int) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldSize), v)) - }, - ) + }) } // SizeNEQ applies the NEQ predicate on the "size" field. func SizeNEQ(v int) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldSize), v)) - }, - ) + }) } // SizeIn applies the In predicate on the "size" field. @@ -176,8 +160,7 @@ func SizeIn(vs ...int) predicate.File { return } s.Where(sql.In(s.C(FieldSize), v...)) - }, - ) + }) } // SizeNotIn applies the NotIn predicate on the "size" field. @@ -194,56 +177,49 @@ func SizeNotIn(vs ...int) predicate.File { return } s.Where(sql.NotIn(s.C(FieldSize), v...)) - }, - ) + }) } // SizeGT applies the GT predicate on the "size" field. func SizeGT(v int) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldSize), v)) - }, - ) + }) } // SizeGTE applies the GTE predicate on the "size" field. func SizeGTE(v int) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldSize), v)) - }, - ) + }) } // SizeLT applies the LT predicate on the "size" field. func SizeLT(v int) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldSize), v)) - }, - ) + }) } // SizeLTE applies the LTE predicate on the "size" field. func SizeLTE(v int) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldSize), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -260,8 +236,7 @@ func NameIn(vs ...string) predicate.File { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -278,96 +253,84 @@ func NameNotIn(vs ...string) predicate.File { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // UserEQ applies the EQ predicate on the "user" field. func UserEQ(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldUser), v)) - }, - ) + }) } // UserNEQ applies the NEQ predicate on the "user" field. func UserNEQ(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldUser), v)) - }, - ) + }) } // UserIn applies the In predicate on the "user" field. @@ -384,8 +347,7 @@ func UserIn(vs ...string) predicate.File { return } s.Where(sql.In(s.C(FieldUser), v...)) - }, - ) + }) } // UserNotIn applies the NotIn predicate on the "user" field. @@ -402,112 +364,98 @@ func UserNotIn(vs ...string) predicate.File { return } s.Where(sql.NotIn(s.C(FieldUser), v...)) - }, - ) + }) } // UserGT applies the GT predicate on the "user" field. func UserGT(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldUser), v)) - }, - ) + }) } // UserGTE applies the GTE predicate on the "user" field. func UserGTE(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldUser), v)) - }, - ) + }) } // UserLT applies the LT predicate on the "user" field. func UserLT(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldUser), v)) - }, - ) + }) } // UserLTE applies the LTE predicate on the "user" field. func UserLTE(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldUser), v)) - }, - ) + }) } // UserContains applies the Contains predicate on the "user" field. func UserContains(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldUser), v)) - }, - ) + }) } // UserHasPrefix applies the HasPrefix predicate on the "user" field. func UserHasPrefix(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldUser), v)) - }, - ) + }) } // UserHasSuffix applies the HasSuffix predicate on the "user" field. func UserHasSuffix(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldUser), v)) - }, - ) + }) } // UserIsNil applies the IsNil predicate on the "user" field. func UserIsNil() predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldUser))) - }, - ) + }) } // UserNotNil applies the NotNil predicate on the "user" field. func UserNotNil() predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldUser))) - }, - ) + }) } // UserEqualFold applies the EqualFold predicate on the "user" field. func UserEqualFold(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldUser), v)) - }, - ) + }) } // UserContainsFold applies the ContainsFold predicate on the "user" field. func UserContainsFold(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldUser), v)) - }, - ) + }) } // GroupEQ applies the EQ predicate on the "group" field. func GroupEQ(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldGroup), v)) - }, - ) + }) } // GroupNEQ applies the NEQ predicate on the "group" field. func GroupNEQ(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldGroup), v)) - }, - ) + }) } // GroupIn applies the In predicate on the "group" field. @@ -524,8 +472,7 @@ func GroupIn(vs ...string) predicate.File { return } s.Where(sql.In(s.C(FieldGroup), v...)) - }, - ) + }) } // GroupNotIn applies the NotIn predicate on the "group" field. @@ -542,96 +489,84 @@ func GroupNotIn(vs ...string) predicate.File { return } s.Where(sql.NotIn(s.C(FieldGroup), v...)) - }, - ) + }) } // GroupGT applies the GT predicate on the "group" field. func GroupGT(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldGroup), v)) - }, - ) + }) } // GroupGTE applies the GTE predicate on the "group" field. func GroupGTE(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldGroup), v)) - }, - ) + }) } // GroupLT applies the LT predicate on the "group" field. func GroupLT(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldGroup), v)) - }, - ) + }) } // GroupLTE applies the LTE predicate on the "group" field. func GroupLTE(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldGroup), v)) - }, - ) + }) } // GroupContains applies the Contains predicate on the "group" field. func GroupContains(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldGroup), v)) - }, - ) + }) } // GroupHasPrefix applies the HasPrefix predicate on the "group" field. func GroupHasPrefix(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldGroup), v)) - }, - ) + }) } // GroupHasSuffix applies the HasSuffix predicate on the "group" field. func GroupHasSuffix(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldGroup), v)) - }, - ) + }) } // GroupIsNil applies the IsNil predicate on the "group" field. func GroupIsNil() predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldGroup))) - }, - ) + }) } // GroupNotNil applies the NotNil predicate on the "group" field. func GroupNotNil() predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldGroup))) - }, - ) + }) } // GroupEqualFold applies the EqualFold predicate on the "group" field. func GroupEqualFold(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldGroup), v)) - }, - ) + }) } // GroupContainsFold applies the ContainsFold predicate on the "group" field. func GroupContainsFold(v string) predicate.File { return predicate.File(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldGroup), v)) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. @@ -643,8 +578,7 @@ func HasOwner() predicate.File { sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -660,8 +594,7 @@ func HasOwnerWith(preds ...predicate.User) predicate.File { p(s) } }) - }, - ) + }) } // HasType applies the HasEdge predicate on the "type" edge. @@ -673,8 +606,7 @@ func HasType() predicate.File { sqlgraph.Edge(sqlgraph.M2O, true, TypeTable, TypeColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasTypeWith applies the HasEdge predicate on the "type" edge with a given conditions (other predicates). @@ -690,44 +622,37 @@ func HasTypeWith(preds ...predicate.FileType) predicate.File { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.File) predicate.File { - return predicate.File( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.File(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.File) predicate.File { - return predicate.File( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.File(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.File) predicate.File { - return predicate.File( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.File(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/filetype/where.go b/entc/integration/ent/filetype/where.go index 4080c5607..688f8aaf1 100644 --- a/entc/integration/ent/filetype/where.go +++ b/entc/integration/ent/filetype/where.go @@ -16,12 +16,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.FileType { - return predicate.FileType( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.FileType(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -29,8 +27,7 @@ func IDEQ(id string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -38,8 +35,7 @@ func IDNEQ(id string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -56,8 +52,7 @@ func IDIn(ids ...string) predicate.FileType { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -74,8 +69,7 @@ func IDNotIn(ids ...string) predicate.FileType { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -83,8 +77,7 @@ func IDGT(id string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -92,8 +85,7 @@ func IDGTE(id string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -101,8 +93,7 @@ func IDLT(id string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -110,32 +101,28 @@ func IDLTE(id string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -152,8 +139,7 @@ func NameIn(vs ...string) predicate.FileType { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -170,80 +156,70 @@ func NameNotIn(vs ...string) predicate.FileType { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.FileType { return predicate.FileType(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasFiles applies the HasEdge predicate on the "files" edge. @@ -255,8 +231,7 @@ func HasFiles() predicate.FileType { sqlgraph.Edge(sqlgraph.O2M, false, FilesTable, FilesColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFilesWith applies the HasEdge predicate on the "files" edge with a given conditions (other predicates). @@ -272,44 +247,37 @@ func HasFilesWith(preds ...predicate.File) predicate.FileType { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.FileType) predicate.FileType { - return predicate.FileType( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.FileType(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.FileType) predicate.FileType { - return predicate.FileType( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.FileType(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.FileType) predicate.FileType { - return predicate.FileType( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.FileType(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/group/where.go b/entc/integration/ent/group/where.go index 252833ab8..01f1b3994 100644 --- a/entc/integration/ent/group/where.go +++ b/entc/integration/ent/group/where.go @@ -17,12 +17,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Group(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -30,8 +28,7 @@ func IDEQ(id string) predicate.Group { return predicate.Group(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -39,8 +36,7 @@ func IDNEQ(id string) predicate.Group { return predicate.Group(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -57,8 +53,7 @@ func IDIn(ids ...string) predicate.Group { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -75,8 +70,7 @@ func IDNotIn(ids ...string) predicate.Group { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -84,8 +78,7 @@ func IDGT(id string) predicate.Group { return predicate.Group(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -93,8 +86,7 @@ func IDGTE(id string) predicate.Group { return predicate.Group(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -102,8 +94,7 @@ func IDLT(id string) predicate.Group { return predicate.Group(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -111,80 +102,70 @@ func IDLTE(id string) predicate.Group { return predicate.Group(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Active applies equality check predicate on the "active" field. It's identical to ActiveEQ. func Active(v bool) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldActive), v)) - }, - ) + }) } // Expire applies equality check predicate on the "expire" field. It's identical to ExpireEQ. func Expire(v time.Time) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldExpire), v)) - }, - ) + }) } // Type applies equality check predicate on the "type" field. It's identical to TypeEQ. func Type(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldType), v)) - }, - ) + }) } // MaxUsers applies equality check predicate on the "max_users" field. It's identical to MaxUsersEQ. func MaxUsers(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldMaxUsers), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // ActiveEQ applies the EQ predicate on the "active" field. func ActiveEQ(v bool) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldActive), v)) - }, - ) + }) } // ActiveNEQ applies the NEQ predicate on the "active" field. func ActiveNEQ(v bool) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldActive), v)) - }, - ) + }) } // ExpireEQ applies the EQ predicate on the "expire" field. func ExpireEQ(v time.Time) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldExpire), v)) - }, - ) + }) } // ExpireNEQ applies the NEQ predicate on the "expire" field. func ExpireNEQ(v time.Time) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldExpire), v)) - }, - ) + }) } // ExpireIn applies the In predicate on the "expire" field. @@ -201,8 +182,7 @@ func ExpireIn(vs ...time.Time) predicate.Group { return } s.Where(sql.In(s.C(FieldExpire), v...)) - }, - ) + }) } // ExpireNotIn applies the NotIn predicate on the "expire" field. @@ -219,56 +199,49 @@ func ExpireNotIn(vs ...time.Time) predicate.Group { return } s.Where(sql.NotIn(s.C(FieldExpire), v...)) - }, - ) + }) } // ExpireGT applies the GT predicate on the "expire" field. func ExpireGT(v time.Time) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldExpire), v)) - }, - ) + }) } // ExpireGTE applies the GTE predicate on the "expire" field. func ExpireGTE(v time.Time) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldExpire), v)) - }, - ) + }) } // ExpireLT applies the LT predicate on the "expire" field. func ExpireLT(v time.Time) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldExpire), v)) - }, - ) + }) } // ExpireLTE applies the LTE predicate on the "expire" field. func ExpireLTE(v time.Time) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldExpire), v)) - }, - ) + }) } // TypeEQ applies the EQ predicate on the "type" field. func TypeEQ(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldType), v)) - }, - ) + }) } // TypeNEQ applies the NEQ predicate on the "type" field. func TypeNEQ(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldType), v)) - }, - ) + }) } // TypeIn applies the In predicate on the "type" field. @@ -285,8 +258,7 @@ func TypeIn(vs ...string) predicate.Group { return } s.Where(sql.In(s.C(FieldType), v...)) - }, - ) + }) } // TypeNotIn applies the NotIn predicate on the "type" field. @@ -303,112 +275,98 @@ func TypeNotIn(vs ...string) predicate.Group { return } s.Where(sql.NotIn(s.C(FieldType), v...)) - }, - ) + }) } // TypeGT applies the GT predicate on the "type" field. func TypeGT(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldType), v)) - }, - ) + }) } // TypeGTE applies the GTE predicate on the "type" field. func TypeGTE(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldType), v)) - }, - ) + }) } // TypeLT applies the LT predicate on the "type" field. func TypeLT(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldType), v)) - }, - ) + }) } // TypeLTE applies the LTE predicate on the "type" field. func TypeLTE(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldType), v)) - }, - ) + }) } // TypeContains applies the Contains predicate on the "type" field. func TypeContains(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldType), v)) - }, - ) + }) } // TypeHasPrefix applies the HasPrefix predicate on the "type" field. func TypeHasPrefix(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldType), v)) - }, - ) + }) } // TypeHasSuffix applies the HasSuffix predicate on the "type" field. func TypeHasSuffix(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldType), v)) - }, - ) + }) } // TypeIsNil applies the IsNil predicate on the "type" field. func TypeIsNil() predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldType))) - }, - ) + }) } // TypeNotNil applies the NotNil predicate on the "type" field. func TypeNotNil() predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldType))) - }, - ) + }) } // TypeEqualFold applies the EqualFold predicate on the "type" field. func TypeEqualFold(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldType), v)) - }, - ) + }) } // TypeContainsFold applies the ContainsFold predicate on the "type" field. func TypeContainsFold(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldType), v)) - }, - ) + }) } // MaxUsersEQ applies the EQ predicate on the "max_users" field. func MaxUsersEQ(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersNEQ applies the NEQ predicate on the "max_users" field. func MaxUsersNEQ(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersIn applies the In predicate on the "max_users" field. @@ -425,8 +383,7 @@ func MaxUsersIn(vs ...int) predicate.Group { return } s.Where(sql.In(s.C(FieldMaxUsers), v...)) - }, - ) + }) } // MaxUsersNotIn applies the NotIn predicate on the "max_users" field. @@ -443,72 +400,63 @@ func MaxUsersNotIn(vs ...int) predicate.Group { return } s.Where(sql.NotIn(s.C(FieldMaxUsers), v...)) - }, - ) + }) } // MaxUsersGT applies the GT predicate on the "max_users" field. func MaxUsersGT(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersGTE applies the GTE predicate on the "max_users" field. func MaxUsersGTE(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersLT applies the LT predicate on the "max_users" field. func MaxUsersLT(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersLTE applies the LTE predicate on the "max_users" field. func MaxUsersLTE(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersIsNil applies the IsNil predicate on the "max_users" field. func MaxUsersIsNil() predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldMaxUsers))) - }, - ) + }) } // MaxUsersNotNil applies the NotNil predicate on the "max_users" field. func MaxUsersNotNil() predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldMaxUsers))) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -525,8 +473,7 @@ func NameIn(vs ...string) predicate.Group { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -543,80 +490,70 @@ func NameNotIn(vs ...string) predicate.Group { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasFiles applies the HasEdge predicate on the "files" edge. @@ -628,8 +565,7 @@ func HasFiles() predicate.Group { sqlgraph.Edge(sqlgraph.O2M, false, FilesTable, FilesColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFilesWith applies the HasEdge predicate on the "files" edge with a given conditions (other predicates). @@ -645,8 +581,7 @@ func HasFilesWith(preds ...predicate.File) predicate.Group { p(s) } }) - }, - ) + }) } // HasBlocked applies the HasEdge predicate on the "blocked" edge. @@ -658,8 +593,7 @@ func HasBlocked() predicate.Group { sqlgraph.Edge(sqlgraph.O2M, false, BlockedTable, BlockedColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasBlockedWith applies the HasEdge predicate on the "blocked" edge with a given conditions (other predicates). @@ -675,8 +609,7 @@ func HasBlockedWith(preds ...predicate.User) predicate.Group { p(s) } }) - }, - ) + }) } // HasUsers applies the HasEdge predicate on the "users" edge. @@ -688,8 +621,7 @@ func HasUsers() predicate.Group { sqlgraph.Edge(sqlgraph.M2M, true, UsersTable, UsersPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates). @@ -705,8 +637,7 @@ func HasUsersWith(preds ...predicate.User) predicate.Group { p(s) } }) - }, - ) + }) } // HasInfo applies the HasEdge predicate on the "info" edge. @@ -718,8 +649,7 @@ func HasInfo() predicate.Group { sqlgraph.Edge(sqlgraph.M2O, false, InfoTable, InfoColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasInfoWith applies the HasEdge predicate on the "info" edge with a given conditions (other predicates). @@ -735,44 +665,37 @@ func HasInfoWith(preds ...predicate.GroupInfo) predicate.Group { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/groupinfo/where.go b/entc/integration/ent/groupinfo/where.go index bd8229f24..8e07529f8 100644 --- a/entc/integration/ent/groupinfo/where.go +++ b/entc/integration/ent/groupinfo/where.go @@ -16,12 +16,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.GroupInfo { - return predicate.GroupInfo( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.GroupInfo(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -29,8 +27,7 @@ func IDEQ(id string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -38,8 +35,7 @@ func IDNEQ(id string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -56,8 +52,7 @@ func IDIn(ids ...string) predicate.GroupInfo { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -74,8 +69,7 @@ func IDNotIn(ids ...string) predicate.GroupInfo { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -83,8 +77,7 @@ func IDGT(id string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -92,8 +85,7 @@ func IDGTE(id string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -101,8 +93,7 @@ func IDLT(id string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -110,40 +101,35 @@ func IDLTE(id string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Desc applies equality check predicate on the "desc" field. It's identical to DescEQ. func Desc(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldDesc), v)) - }, - ) + }) } // MaxUsers applies equality check predicate on the "max_users" field. It's identical to MaxUsersEQ. func MaxUsers(v int) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldMaxUsers), v)) - }, - ) + }) } // DescEQ applies the EQ predicate on the "desc" field. func DescEQ(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldDesc), v)) - }, - ) + }) } // DescNEQ applies the NEQ predicate on the "desc" field. func DescNEQ(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldDesc), v)) - }, - ) + }) } // DescIn applies the In predicate on the "desc" field. @@ -160,8 +146,7 @@ func DescIn(vs ...string) predicate.GroupInfo { return } s.Where(sql.In(s.C(FieldDesc), v...)) - }, - ) + }) } // DescNotIn applies the NotIn predicate on the "desc" field. @@ -178,96 +163,84 @@ func DescNotIn(vs ...string) predicate.GroupInfo { return } s.Where(sql.NotIn(s.C(FieldDesc), v...)) - }, - ) + }) } // DescGT applies the GT predicate on the "desc" field. func DescGT(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldDesc), v)) - }, - ) + }) } // DescGTE applies the GTE predicate on the "desc" field. func DescGTE(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldDesc), v)) - }, - ) + }) } // DescLT applies the LT predicate on the "desc" field. func DescLT(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldDesc), v)) - }, - ) + }) } // DescLTE applies the LTE predicate on the "desc" field. func DescLTE(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldDesc), v)) - }, - ) + }) } // DescContains applies the Contains predicate on the "desc" field. func DescContains(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldDesc), v)) - }, - ) + }) } // DescHasPrefix applies the HasPrefix predicate on the "desc" field. func DescHasPrefix(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldDesc), v)) - }, - ) + }) } // DescHasSuffix applies the HasSuffix predicate on the "desc" field. func DescHasSuffix(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldDesc), v)) - }, - ) + }) } // DescEqualFold applies the EqualFold predicate on the "desc" field. func DescEqualFold(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldDesc), v)) - }, - ) + }) } // DescContainsFold applies the ContainsFold predicate on the "desc" field. func DescContainsFold(v string) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldDesc), v)) - }, - ) + }) } // MaxUsersEQ applies the EQ predicate on the "max_users" field. func MaxUsersEQ(v int) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersNEQ applies the NEQ predicate on the "max_users" field. func MaxUsersNEQ(v int) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersIn applies the In predicate on the "max_users" field. @@ -284,8 +257,7 @@ func MaxUsersIn(vs ...int) predicate.GroupInfo { return } s.Where(sql.In(s.C(FieldMaxUsers), v...)) - }, - ) + }) } // MaxUsersNotIn applies the NotIn predicate on the "max_users" field. @@ -302,40 +274,35 @@ func MaxUsersNotIn(vs ...int) predicate.GroupInfo { return } s.Where(sql.NotIn(s.C(FieldMaxUsers), v...)) - }, - ) + }) } // MaxUsersGT applies the GT predicate on the "max_users" field. func MaxUsersGT(v int) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersGTE applies the GTE predicate on the "max_users" field. func MaxUsersGTE(v int) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersLT applies the LT predicate on the "max_users" field. func MaxUsersLT(v int) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersLTE applies the LTE predicate on the "max_users" field. func MaxUsersLTE(v int) predicate.GroupInfo { return predicate.GroupInfo(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldMaxUsers), v)) - }, - ) + }) } // HasGroups applies the HasEdge predicate on the "groups" edge. @@ -347,8 +314,7 @@ func HasGroups() predicate.GroupInfo { sqlgraph.Edge(sqlgraph.O2M, true, GroupsTable, GroupsColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates). @@ -364,44 +330,37 @@ func HasGroupsWith(preds ...predicate.Group) predicate.GroupInfo { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.GroupInfo) predicate.GroupInfo { - return predicate.GroupInfo( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.GroupInfo(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.GroupInfo) predicate.GroupInfo { - return predicate.GroupInfo( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.GroupInfo(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.GroupInfo) predicate.GroupInfo { - return predicate.GroupInfo( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.GroupInfo(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/item/where.go b/entc/integration/ent/item/where.go index d2cd87c73..e3aa5dcd5 100644 --- a/entc/integration/ent/item/where.go +++ b/entc/integration/ent/item/where.go @@ -15,12 +15,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Item { - return predicate.Item( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Item(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -28,8 +26,7 @@ func IDEQ(id string) predicate.Item { return predicate.Item(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -37,8 +34,7 @@ func IDNEQ(id string) predicate.Item { return predicate.Item(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -55,8 +51,7 @@ func IDIn(ids ...string) predicate.Item { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -73,8 +68,7 @@ func IDNotIn(ids ...string) predicate.Item { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -82,8 +76,7 @@ func IDGT(id string) predicate.Item { return predicate.Item(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -91,8 +84,7 @@ func IDGTE(id string) predicate.Item { return predicate.Item(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -100,8 +92,7 @@ func IDLT(id string) predicate.Item { return predicate.Item(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -109,44 +100,37 @@ func IDLTE(id string) predicate.Item { return predicate.Item(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Item) predicate.Item { - return predicate.Item( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Item(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Item) predicate.Item { - return predicate.Item( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Item(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Item) predicate.Item { - return predicate.Item( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Item(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/node/where.go b/entc/integration/ent/node/where.go index 474ad12d6..3df1f17a2 100644 --- a/entc/integration/ent/node/where.go +++ b/entc/integration/ent/node/where.go @@ -16,12 +16,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Node(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -29,8 +27,7 @@ func IDEQ(id string) predicate.Node { return predicate.Node(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -38,8 +35,7 @@ func IDNEQ(id string) predicate.Node { return predicate.Node(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -56,8 +52,7 @@ func IDIn(ids ...string) predicate.Node { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -74,8 +69,7 @@ func IDNotIn(ids ...string) predicate.Node { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -83,8 +77,7 @@ func IDGT(id string) predicate.Node { return predicate.Node(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -92,8 +85,7 @@ func IDGTE(id string) predicate.Node { return predicate.Node(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -101,8 +93,7 @@ func IDLT(id string) predicate.Node { return predicate.Node(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -110,32 +101,28 @@ func IDLTE(id string) predicate.Node { return predicate.Node(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Value applies equality check predicate on the "value" field. It's identical to ValueEQ. func Value(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldValue), v)) - }, - ) + }) } // ValueEQ applies the EQ predicate on the "value" field. func ValueEQ(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldValue), v)) - }, - ) + }) } // ValueNEQ applies the NEQ predicate on the "value" field. func ValueNEQ(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldValue), v)) - }, - ) + }) } // ValueIn applies the In predicate on the "value" field. @@ -152,8 +139,7 @@ func ValueIn(vs ...int) predicate.Node { return } s.Where(sql.In(s.C(FieldValue), v...)) - }, - ) + }) } // ValueNotIn applies the NotIn predicate on the "value" field. @@ -170,56 +156,49 @@ func ValueNotIn(vs ...int) predicate.Node { return } s.Where(sql.NotIn(s.C(FieldValue), v...)) - }, - ) + }) } // ValueGT applies the GT predicate on the "value" field. func ValueGT(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldValue), v)) - }, - ) + }) } // ValueGTE applies the GTE predicate on the "value" field. func ValueGTE(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldValue), v)) - }, - ) + }) } // ValueLT applies the LT predicate on the "value" field. func ValueLT(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldValue), v)) - }, - ) + }) } // ValueLTE applies the LTE predicate on the "value" field. func ValueLTE(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldValue), v)) - }, - ) + }) } // ValueIsNil applies the IsNil predicate on the "value" field. func ValueIsNil() predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldValue))) - }, - ) + }) } // ValueNotNil applies the NotNil predicate on the "value" field. func ValueNotNil() predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldValue))) - }, - ) + }) } // HasPrev applies the HasEdge predicate on the "prev" edge. @@ -231,8 +210,7 @@ func HasPrev() predicate.Node { sqlgraph.Edge(sqlgraph.O2O, true, PrevTable, PrevColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasPrevWith applies the HasEdge predicate on the "prev" edge with a given conditions (other predicates). @@ -248,8 +226,7 @@ func HasPrevWith(preds ...predicate.Node) predicate.Node { p(s) } }) - }, - ) + }) } // HasNext applies the HasEdge predicate on the "next" edge. @@ -261,8 +238,7 @@ func HasNext() predicate.Node { sqlgraph.Edge(sqlgraph.O2O, false, NextTable, NextColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasNextWith applies the HasEdge predicate on the "next" edge with a given conditions (other predicates). @@ -278,44 +254,37 @@ func HasNextWith(preds ...predicate.Node) predicate.Node { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Node) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Node(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Node) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Node(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Node) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Node(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/pet/where.go b/entc/integration/ent/pet/where.go index 9042ee028..495940928 100644 --- a/entc/integration/ent/pet/where.go +++ b/entc/integration/ent/pet/where.go @@ -16,12 +16,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -29,8 +27,7 @@ func IDEQ(id string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -38,8 +35,7 @@ func IDNEQ(id string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -56,8 +52,7 @@ func IDIn(ids ...string) predicate.Pet { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -74,8 +69,7 @@ func IDNotIn(ids ...string) predicate.Pet { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -83,8 +77,7 @@ func IDGT(id string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -92,8 +85,7 @@ func IDGTE(id string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -101,8 +93,7 @@ func IDLT(id string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -110,32 +101,28 @@ func IDLTE(id string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -152,8 +139,7 @@ func NameIn(vs ...string) predicate.Pet { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -170,80 +156,70 @@ func NameNotIn(vs ...string) predicate.Pet { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasTeam applies the HasEdge predicate on the "team" edge. @@ -255,8 +231,7 @@ func HasTeam() predicate.Pet { sqlgraph.Edge(sqlgraph.O2O, true, TeamTable, TeamColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasTeamWith applies the HasEdge predicate on the "team" edge with a given conditions (other predicates). @@ -272,8 +247,7 @@ func HasTeamWith(preds ...predicate.User) predicate.Pet { p(s) } }) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. @@ -285,8 +259,7 @@ func HasOwner() predicate.Pet { sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -302,44 +275,37 @@ func HasOwnerWith(preds ...predicate.User) predicate.Pet { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Pet(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/spec/where.go b/entc/integration/ent/spec/where.go index 24260de68..4b0ad0501 100644 --- a/entc/integration/ent/spec/where.go +++ b/entc/integration/ent/spec/where.go @@ -16,12 +16,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Spec { - return predicate.Spec( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Spec(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -29,8 +27,7 @@ func IDEQ(id string) predicate.Spec { return predicate.Spec(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -38,8 +35,7 @@ func IDNEQ(id string) predicate.Spec { return predicate.Spec(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -56,8 +52,7 @@ func IDIn(ids ...string) predicate.Spec { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -74,8 +69,7 @@ func IDNotIn(ids ...string) predicate.Spec { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -83,8 +77,7 @@ func IDGT(id string) predicate.Spec { return predicate.Spec(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -92,8 +85,7 @@ func IDGTE(id string) predicate.Spec { return predicate.Spec(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -101,8 +93,7 @@ func IDLT(id string) predicate.Spec { return predicate.Spec(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -110,8 +101,7 @@ func IDLTE(id string) predicate.Spec { return predicate.Spec(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // HasCard applies the HasEdge predicate on the "card" edge. @@ -123,8 +113,7 @@ func HasCard() predicate.Spec { sqlgraph.Edge(sqlgraph.M2M, false, CardTable, CardPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasCardWith applies the HasEdge predicate on the "card" edge with a given conditions (other predicates). @@ -140,44 +129,37 @@ func HasCardWith(preds ...predicate.Card) predicate.Spec { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Spec) predicate.Spec { - return predicate.Spec( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Spec(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Spec) predicate.Spec { - return predicate.Spec( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Spec(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Spec) predicate.Spec { - return predicate.Spec( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Spec(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/ent/user/where.go b/entc/integration/ent/user/where.go index 645e0737b..ad00661a3 100644 --- a/entc/integration/ent/user/where.go +++ b/entc/integration/ent/user/where.go @@ -16,12 +16,10 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.User { - return predicate.User( - func(s *sql.Selector) { - id, _ := strconv.Atoi(id) - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + id, _ := strconv.Atoi(id) + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. @@ -29,8 +27,7 @@ func IDEQ(id string) predicate.User { return predicate.User(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. @@ -38,8 +35,7 @@ func IDNEQ(id string) predicate.User { return predicate.User(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -56,8 +52,7 @@ func IDIn(ids ...string) predicate.User { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -74,8 +69,7 @@ func IDNotIn(ids ...string) predicate.User { v[i], _ = strconv.Atoi(ids[i]) } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. @@ -83,8 +77,7 @@ func IDGT(id string) predicate.User { return predicate.User(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. @@ -92,8 +85,7 @@ func IDGTE(id string) predicate.User { return predicate.User(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. @@ -101,8 +93,7 @@ func IDLT(id string) predicate.User { return predicate.User(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. @@ -110,80 +101,70 @@ func IDLTE(id string) predicate.User { return predicate.User(func(s *sql.Selector) { id, _ := strconv.Atoi(id) s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // OptionalInt applies equality check predicate on the "optional_int" field. It's identical to OptionalIntEQ. func OptionalInt(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt), v)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // Last applies equality check predicate on the "last" field. It's identical to LastEQ. func Last(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldLast), v)) - }, - ) + }) } // Nickname applies equality check predicate on the "nickname" field. It's identical to NicknameEQ. func Nickname(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNickname), v)) - }, - ) + }) } // Phone applies equality check predicate on the "phone" field. It's identical to PhoneEQ. func Phone(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldPhone), v)) - }, - ) + }) } // Password applies equality check predicate on the "password" field. It's identical to PasswordEQ. func Password(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldPassword), v)) - }, - ) + }) } // OptionalIntEQ applies the EQ predicate on the "optional_int" field. func OptionalIntEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntNEQ applies the NEQ predicate on the "optional_int" field. func OptionalIntNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntIn applies the In predicate on the "optional_int" field. @@ -200,8 +181,7 @@ func OptionalIntIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldOptionalInt), v...)) - }, - ) + }) } // OptionalIntNotIn applies the NotIn predicate on the "optional_int" field. @@ -218,72 +198,63 @@ func OptionalIntNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldOptionalInt), v...)) - }, - ) + }) } // OptionalIntGT applies the GT predicate on the "optional_int" field. func OptionalIntGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntGTE applies the GTE predicate on the "optional_int" field. func OptionalIntGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntLT applies the LT predicate on the "optional_int" field. func OptionalIntLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntLTE applies the LTE predicate on the "optional_int" field. func OptionalIntLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldOptionalInt), v)) - }, - ) + }) } // OptionalIntIsNil applies the IsNil predicate on the "optional_int" field. func OptionalIntIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldOptionalInt))) - }, - ) + }) } // OptionalIntNotNil applies the NotNil predicate on the "optional_int" field. func OptionalIntNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldOptionalInt))) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -300,8 +271,7 @@ func AgeIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -318,56 +288,49 @@ func AgeNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -384,8 +347,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -402,96 +364,84 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // LastEQ applies the EQ predicate on the "last" field. func LastEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldLast), v)) - }, - ) + }) } // LastNEQ applies the NEQ predicate on the "last" field. func LastNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldLast), v)) - }, - ) + }) } // LastIn applies the In predicate on the "last" field. @@ -508,8 +458,7 @@ func LastIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldLast), v...)) - }, - ) + }) } // LastNotIn applies the NotIn predicate on the "last" field. @@ -526,96 +475,84 @@ func LastNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldLast), v...)) - }, - ) + }) } // LastGT applies the GT predicate on the "last" field. func LastGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldLast), v)) - }, - ) + }) } // LastGTE applies the GTE predicate on the "last" field. func LastGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldLast), v)) - }, - ) + }) } // LastLT applies the LT predicate on the "last" field. func LastLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldLast), v)) - }, - ) + }) } // LastLTE applies the LTE predicate on the "last" field. func LastLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldLast), v)) - }, - ) + }) } // LastContains applies the Contains predicate on the "last" field. func LastContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldLast), v)) - }, - ) + }) } // LastHasPrefix applies the HasPrefix predicate on the "last" field. func LastHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldLast), v)) - }, - ) + }) } // LastHasSuffix applies the HasSuffix predicate on the "last" field. func LastHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldLast), v)) - }, - ) + }) } // LastEqualFold applies the EqualFold predicate on the "last" field. func LastEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldLast), v)) - }, - ) + }) } // LastContainsFold applies the ContainsFold predicate on the "last" field. func LastContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldLast), v)) - }, - ) + }) } // NicknameEQ applies the EQ predicate on the "nickname" field. func NicknameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameNEQ applies the NEQ predicate on the "nickname" field. func NicknameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameIn applies the In predicate on the "nickname" field. @@ -632,8 +569,7 @@ func NicknameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldNickname), v...)) - }, - ) + }) } // NicknameNotIn applies the NotIn predicate on the "nickname" field. @@ -650,112 +586,98 @@ func NicknameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldNickname), v...)) - }, - ) + }) } // NicknameGT applies the GT predicate on the "nickname" field. func NicknameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameGTE applies the GTE predicate on the "nickname" field. func NicknameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameLT applies the LT predicate on the "nickname" field. func NicknameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameLTE applies the LTE predicate on the "nickname" field. func NicknameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameContains applies the Contains predicate on the "nickname" field. func NicknameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameHasPrefix applies the HasPrefix predicate on the "nickname" field. func NicknameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameHasSuffix applies the HasSuffix predicate on the "nickname" field. func NicknameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameIsNil applies the IsNil predicate on the "nickname" field. func NicknameIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldNickname))) - }, - ) + }) } // NicknameNotNil applies the NotNil predicate on the "nickname" field. func NicknameNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldNickname))) - }, - ) + }) } // NicknameEqualFold applies the EqualFold predicate on the "nickname" field. func NicknameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameContainsFold applies the ContainsFold predicate on the "nickname" field. func NicknameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldNickname), v)) - }, - ) + }) } // PhoneEQ applies the EQ predicate on the "phone" field. func PhoneEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneNEQ applies the NEQ predicate on the "phone" field. func PhoneNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneIn applies the In predicate on the "phone" field. @@ -772,8 +694,7 @@ func PhoneIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldPhone), v...)) - }, - ) + }) } // PhoneNotIn applies the NotIn predicate on the "phone" field. @@ -790,112 +711,98 @@ func PhoneNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldPhone), v...)) - }, - ) + }) } // PhoneGT applies the GT predicate on the "phone" field. func PhoneGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneGTE applies the GTE predicate on the "phone" field. func PhoneGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneLT applies the LT predicate on the "phone" field. func PhoneLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneLTE applies the LTE predicate on the "phone" field. func PhoneLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneContains applies the Contains predicate on the "phone" field. func PhoneContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneHasPrefix applies the HasPrefix predicate on the "phone" field. func PhoneHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneHasSuffix applies the HasSuffix predicate on the "phone" field. func PhoneHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneIsNil applies the IsNil predicate on the "phone" field. func PhoneIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldPhone))) - }, - ) + }) } // PhoneNotNil applies the NotNil predicate on the "phone" field. func PhoneNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldPhone))) - }, - ) + }) } // PhoneEqualFold applies the EqualFold predicate on the "phone" field. func PhoneEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneContainsFold applies the ContainsFold predicate on the "phone" field. func PhoneContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldPhone), v)) - }, - ) + }) } // PasswordEQ applies the EQ predicate on the "password" field. func PasswordEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldPassword), v)) - }, - ) + }) } // PasswordNEQ applies the NEQ predicate on the "password" field. func PasswordNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldPassword), v)) - }, - ) + }) } // PasswordIn applies the In predicate on the "password" field. @@ -912,8 +819,7 @@ func PasswordIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldPassword), v...)) - }, - ) + }) } // PasswordNotIn applies the NotIn predicate on the "password" field. @@ -930,112 +836,98 @@ func PasswordNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldPassword), v...)) - }, - ) + }) } // PasswordGT applies the GT predicate on the "password" field. func PasswordGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldPassword), v)) - }, - ) + }) } // PasswordGTE applies the GTE predicate on the "password" field. func PasswordGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldPassword), v)) - }, - ) + }) } // PasswordLT applies the LT predicate on the "password" field. func PasswordLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldPassword), v)) - }, - ) + }) } // PasswordLTE applies the LTE predicate on the "password" field. func PasswordLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldPassword), v)) - }, - ) + }) } // PasswordContains applies the Contains predicate on the "password" field. func PasswordContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldPassword), v)) - }, - ) + }) } // PasswordHasPrefix applies the HasPrefix predicate on the "password" field. func PasswordHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldPassword), v)) - }, - ) + }) } // PasswordHasSuffix applies the HasSuffix predicate on the "password" field. func PasswordHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldPassword), v)) - }, - ) + }) } // PasswordIsNil applies the IsNil predicate on the "password" field. func PasswordIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldPassword))) - }, - ) + }) } // PasswordNotNil applies the NotNil predicate on the "password" field. func PasswordNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldPassword))) - }, - ) + }) } // PasswordEqualFold applies the EqualFold predicate on the "password" field. func PasswordEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldPassword), v)) - }, - ) + }) } // PasswordContainsFold applies the ContainsFold predicate on the "password" field. func PasswordContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldPassword), v)) - }, - ) + }) } // RoleEQ applies the EQ predicate on the "role" field. func RoleEQ(v Role) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldRole), v)) - }, - ) + }) } // RoleNEQ applies the NEQ predicate on the "role" field. func RoleNEQ(v Role) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldRole), v)) - }, - ) + }) } // RoleIn applies the In predicate on the "role" field. @@ -1052,8 +944,7 @@ func RoleIn(vs ...Role) predicate.User { return } s.Where(sql.In(s.C(FieldRole), v...)) - }, - ) + }) } // RoleNotIn applies the NotIn predicate on the "role" field. @@ -1070,8 +961,7 @@ func RoleNotIn(vs ...Role) predicate.User { return } s.Where(sql.NotIn(s.C(FieldRole), v...)) - }, - ) + }) } // HasCard applies the HasEdge predicate on the "card" edge. @@ -1083,8 +973,7 @@ func HasCard() predicate.User { sqlgraph.Edge(sqlgraph.O2O, false, CardTable, CardColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasCardWith applies the HasEdge predicate on the "card" edge with a given conditions (other predicates). @@ -1100,8 +989,7 @@ func HasCardWith(preds ...predicate.Card) predicate.User { p(s) } }) - }, - ) + }) } // HasPets applies the HasEdge predicate on the "pets" edge. @@ -1113,8 +1001,7 @@ func HasPets() predicate.User { sqlgraph.Edge(sqlgraph.O2M, false, PetsTable, PetsColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasPetsWith applies the HasEdge predicate on the "pets" edge with a given conditions (other predicates). @@ -1130,8 +1017,7 @@ func HasPetsWith(preds ...predicate.Pet) predicate.User { p(s) } }) - }, - ) + }) } // HasFiles applies the HasEdge predicate on the "files" edge. @@ -1143,8 +1029,7 @@ func HasFiles() predicate.User { sqlgraph.Edge(sqlgraph.O2M, false, FilesTable, FilesColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFilesWith applies the HasEdge predicate on the "files" edge with a given conditions (other predicates). @@ -1160,8 +1045,7 @@ func HasFilesWith(preds ...predicate.File) predicate.User { p(s) } }) - }, - ) + }) } // HasGroups applies the HasEdge predicate on the "groups" edge. @@ -1173,8 +1057,7 @@ func HasGroups() predicate.User { sqlgraph.Edge(sqlgraph.M2M, false, GroupsTable, GroupsPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates). @@ -1190,8 +1073,7 @@ func HasGroupsWith(preds ...predicate.Group) predicate.User { p(s) } }) - }, - ) + }) } // HasFriends applies the HasEdge predicate on the "friends" edge. @@ -1203,8 +1085,7 @@ func HasFriends() predicate.User { sqlgraph.Edge(sqlgraph.M2M, false, FriendsTable, FriendsPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFriendsWith applies the HasEdge predicate on the "friends" edge with a given conditions (other predicates). @@ -1220,8 +1101,7 @@ func HasFriendsWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasFollowers applies the HasEdge predicate on the "followers" edge. @@ -1233,8 +1113,7 @@ func HasFollowers() predicate.User { sqlgraph.Edge(sqlgraph.M2M, true, FollowersTable, FollowersPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFollowersWith applies the HasEdge predicate on the "followers" edge with a given conditions (other predicates). @@ -1250,8 +1129,7 @@ func HasFollowersWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasFollowing applies the HasEdge predicate on the "following" edge. @@ -1263,8 +1141,7 @@ func HasFollowing() predicate.User { sqlgraph.Edge(sqlgraph.M2M, false, FollowingTable, FollowingPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFollowingWith applies the HasEdge predicate on the "following" edge with a given conditions (other predicates). @@ -1280,8 +1157,7 @@ func HasFollowingWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasTeam applies the HasEdge predicate on the "team" edge. @@ -1293,8 +1169,7 @@ func HasTeam() predicate.User { sqlgraph.Edge(sqlgraph.O2O, false, TeamTable, TeamColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasTeamWith applies the HasEdge predicate on the "team" edge with a given conditions (other predicates). @@ -1310,8 +1185,7 @@ func HasTeamWith(preds ...predicate.Pet) predicate.User { p(s) } }) - }, - ) + }) } // HasSpouse applies the HasEdge predicate on the "spouse" edge. @@ -1323,8 +1197,7 @@ func HasSpouse() predicate.User { sqlgraph.Edge(sqlgraph.O2O, false, SpouseTable, SpouseColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasSpouseWith applies the HasEdge predicate on the "spouse" edge with a given conditions (other predicates). @@ -1340,8 +1213,7 @@ func HasSpouseWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasChildren applies the HasEdge predicate on the "children" edge. @@ -1353,8 +1225,7 @@ func HasChildren() predicate.User { sqlgraph.Edge(sqlgraph.O2M, true, ChildrenTable, ChildrenColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). @@ -1370,8 +1241,7 @@ func HasChildrenWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasParent applies the HasEdge predicate on the "parent" edge. @@ -1383,8 +1253,7 @@ func HasParent() predicate.User { sqlgraph.Edge(sqlgraph.M2O, false, ParentTable, ParentColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). @@ -1400,44 +1269,37 @@ func HasParentWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/gremlin/ent/card/where.go b/entc/integration/gremlin/ent/card/where.go index 2fb8ee04d..8cb0e34de 100644 --- a/entc/integration/gremlin/ent/card/where.go +++ b/entc/integration/gremlin/ent/card/where.go @@ -17,27 +17,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Card { - return predicate.Card( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.Card(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -48,8 +44,7 @@ func IDIn(ids ...string) predicate.Card { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -60,88 +55,77 @@ func IDNotIn(ids ...string) predicate.Card { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ. func CreateTime(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.EQ(v)) - }, - ) + }) } // UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ. func UpdateTime(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.EQ(v)) - }, - ) + }) } // Number applies equality check predicate on the "number" field. It's identical to NumberEQ. func Number(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.EQ(v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // CreateTimeEQ applies the EQ predicate on the "create_time" field. func CreateTimeEQ(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.EQ(v)) - }, - ) + }) } // CreateTimeNEQ applies the NEQ predicate on the "create_time" field. func CreateTimeNEQ(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.NEQ(v)) - }, - ) + }) } // CreateTimeIn applies the In predicate on the "create_time" field. @@ -152,8 +136,7 @@ func CreateTimeIn(vs ...time.Time) predicate.Card { } return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.Within(v...)) - }, - ) + }) } // CreateTimeNotIn applies the NotIn predicate on the "create_time" field. @@ -164,56 +147,49 @@ func CreateTimeNotIn(vs ...time.Time) predicate.Card { } return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.Without(v...)) - }, - ) + }) } // CreateTimeGT applies the GT predicate on the "create_time" field. func CreateTimeGT(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.GT(v)) - }, - ) + }) } // CreateTimeGTE applies the GTE predicate on the "create_time" field. func CreateTimeGTE(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.GTE(v)) - }, - ) + }) } // CreateTimeLT applies the LT predicate on the "create_time" field. func CreateTimeLT(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.LT(v)) - }, - ) + }) } // CreateTimeLTE applies the LTE predicate on the "create_time" field. func CreateTimeLTE(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldCreateTime, p.LTE(v)) - }, - ) + }) } // UpdateTimeEQ applies the EQ predicate on the "update_time" field. func UpdateTimeEQ(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.EQ(v)) - }, - ) + }) } // UpdateTimeNEQ applies the NEQ predicate on the "update_time" field. func UpdateTimeNEQ(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.NEQ(v)) - }, - ) + }) } // UpdateTimeIn applies the In predicate on the "update_time" field. @@ -224,8 +200,7 @@ func UpdateTimeIn(vs ...time.Time) predicate.Card { } return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.Within(v...)) - }, - ) + }) } // UpdateTimeNotIn applies the NotIn predicate on the "update_time" field. @@ -236,56 +211,49 @@ func UpdateTimeNotIn(vs ...time.Time) predicate.Card { } return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.Without(v...)) - }, - ) + }) } // UpdateTimeGT applies the GT predicate on the "update_time" field. func UpdateTimeGT(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.GT(v)) - }, - ) + }) } // UpdateTimeGTE applies the GTE predicate on the "update_time" field. func UpdateTimeGTE(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.GTE(v)) - }, - ) + }) } // UpdateTimeLT applies the LT predicate on the "update_time" field. func UpdateTimeLT(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.LT(v)) - }, - ) + }) } // UpdateTimeLTE applies the LTE predicate on the "update_time" field. func UpdateTimeLTE(v time.Time) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldUpdateTime, p.LTE(v)) - }, - ) + }) } // NumberEQ applies the EQ predicate on the "number" field. func NumberEQ(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.EQ(v)) - }, - ) + }) } // NumberNEQ applies the NEQ predicate on the "number" field. func NumberNEQ(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.NEQ(v)) - }, - ) + }) } // NumberIn applies the In predicate on the "number" field. @@ -296,8 +264,7 @@ func NumberIn(vs ...string) predicate.Card { } return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.Within(v...)) - }, - ) + }) } // NumberNotIn applies the NotIn predicate on the "number" field. @@ -308,80 +275,70 @@ func NumberNotIn(vs ...string) predicate.Card { } return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.Without(v...)) - }, - ) + }) } // NumberGT applies the GT predicate on the "number" field. func NumberGT(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.GT(v)) - }, - ) + }) } // NumberGTE applies the GTE predicate on the "number" field. func NumberGTE(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.GTE(v)) - }, - ) + }) } // NumberLT applies the LT predicate on the "number" field. func NumberLT(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.LT(v)) - }, - ) + }) } // NumberLTE applies the LTE predicate on the "number" field. func NumberLTE(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.LTE(v)) - }, - ) + }) } // NumberContains applies the Contains predicate on the "number" field. func NumberContains(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.Containing(v)) - }, - ) + }) } // NumberHasPrefix applies the HasPrefix predicate on the "number" field. func NumberHasPrefix(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.StartingWith(v)) - }, - ) + }) } // NumberHasSuffix applies the HasSuffix predicate on the "number" field. func NumberHasSuffix(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldNumber, p.EndingWith(v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.NEQ(v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -392,8 +349,7 @@ func NameIn(vs ...string) predicate.Card { } return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -404,88 +360,77 @@ func NameNotIn(vs ...string) predicate.Card { } return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GT(v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GTE(v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LT(v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LTE(v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Containing(v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.StartingWith(v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EndingWith(v)) - }, - ) + }) } // NameIsNil applies the IsNil predicate on the "name" field. func NameIsNil() predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldName) - }, - ) + }) } // NameNotNil applies the NotNil predicate on the "name" field. func NameNotNil() predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldName) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. func HasOwner() predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.InE(OwnerInverseLabel).InV() - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -496,16 +441,14 @@ func HasOwnerWith(preds ...predicate.User) predicate.Card { p(tr) } t.InE(OwnerInverseLabel).Where(tr).InV() - }, - ) + }) } // HasSpec applies the HasEdge predicate on the "spec" edge. func HasSpec() predicate.Card { return predicate.Card(func(t *dsl.Traversal) { t.InE(SpecInverseLabel).InV() - }, - ) + }) } // HasSpecWith applies the HasEdge predicate on the "spec" edge with a given conditions (other predicates). @@ -516,47 +459,40 @@ func HasSpecWith(preds ...predicate.Spec) predicate.Card { p(tr) } t.InE(SpecInverseLabel).Where(tr).InV() - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Card) predicate.Card { - return predicate.Card( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.Card(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Card) predicate.Card { - return predicate.Card( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.Card(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Card) predicate.Card { - return predicate.Card( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.Card(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/comment/where.go b/entc/integration/gremlin/ent/comment/where.go index f72802b41..94831c17f 100644 --- a/entc/integration/gremlin/ent/comment/where.go +++ b/entc/integration/gremlin/ent/comment/where.go @@ -15,27 +15,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Comment { - return predicate.Comment( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.Comment(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -46,8 +42,7 @@ func IDIn(ids ...string) predicate.Comment { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -58,80 +53,70 @@ func IDNotIn(ids ...string) predicate.Comment { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // UniqueInt applies equality check predicate on the "unique_int" field. It's identical to UniqueIntEQ. func UniqueInt(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.EQ(v)) - }, - ) + }) } // UniqueFloat applies equality check predicate on the "unique_float" field. It's identical to UniqueFloatEQ. func UniqueFloat(v float64) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.EQ(v)) - }, - ) + }) } // NillableInt applies equality check predicate on the "nillable_int" field. It's identical to NillableIntEQ. func NillableInt(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.EQ(v)) - }, - ) + }) } // UniqueIntEQ applies the EQ predicate on the "unique_int" field. func UniqueIntEQ(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.EQ(v)) - }, - ) + }) } // UniqueIntNEQ applies the NEQ predicate on the "unique_int" field. func UniqueIntNEQ(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.NEQ(v)) - }, - ) + }) } // UniqueIntIn applies the In predicate on the "unique_int" field. @@ -142,8 +127,7 @@ func UniqueIntIn(vs ...int) predicate.Comment { } return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.Within(v...)) - }, - ) + }) } // UniqueIntNotIn applies the NotIn predicate on the "unique_int" field. @@ -154,56 +138,49 @@ func UniqueIntNotIn(vs ...int) predicate.Comment { } return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.Without(v...)) - }, - ) + }) } // UniqueIntGT applies the GT predicate on the "unique_int" field. func UniqueIntGT(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.GT(v)) - }, - ) + }) } // UniqueIntGTE applies the GTE predicate on the "unique_int" field. func UniqueIntGTE(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.GTE(v)) - }, - ) + }) } // UniqueIntLT applies the LT predicate on the "unique_int" field. func UniqueIntLT(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.LT(v)) - }, - ) + }) } // UniqueIntLTE applies the LTE predicate on the "unique_int" field. func UniqueIntLTE(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueInt, p.LTE(v)) - }, - ) + }) } // UniqueFloatEQ applies the EQ predicate on the "unique_float" field. func UniqueFloatEQ(v float64) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.EQ(v)) - }, - ) + }) } // UniqueFloatNEQ applies the NEQ predicate on the "unique_float" field. func UniqueFloatNEQ(v float64) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.NEQ(v)) - }, - ) + }) } // UniqueFloatIn applies the In predicate on the "unique_float" field. @@ -214,8 +191,7 @@ func UniqueFloatIn(vs ...float64) predicate.Comment { } return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.Within(v...)) - }, - ) + }) } // UniqueFloatNotIn applies the NotIn predicate on the "unique_float" field. @@ -226,56 +202,49 @@ func UniqueFloatNotIn(vs ...float64) predicate.Comment { } return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.Without(v...)) - }, - ) + }) } // UniqueFloatGT applies the GT predicate on the "unique_float" field. func UniqueFloatGT(v float64) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.GT(v)) - }, - ) + }) } // UniqueFloatGTE applies the GTE predicate on the "unique_float" field. func UniqueFloatGTE(v float64) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.GTE(v)) - }, - ) + }) } // UniqueFloatLT applies the LT predicate on the "unique_float" field. func UniqueFloatLT(v float64) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.LT(v)) - }, - ) + }) } // UniqueFloatLTE applies the LTE predicate on the "unique_float" field. func UniqueFloatLTE(v float64) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldUniqueFloat, p.LTE(v)) - }, - ) + }) } // NillableIntEQ applies the EQ predicate on the "nillable_int" field. func NillableIntEQ(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.EQ(v)) - }, - ) + }) } // NillableIntNEQ applies the NEQ predicate on the "nillable_int" field. func NillableIntNEQ(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.NEQ(v)) - }, - ) + }) } // NillableIntIn applies the In predicate on the "nillable_int" field. @@ -286,8 +255,7 @@ func NillableIntIn(vs ...int) predicate.Comment { } return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.Within(v...)) - }, - ) + }) } // NillableIntNotIn applies the NotIn predicate on the "nillable_int" field. @@ -298,95 +266,82 @@ func NillableIntNotIn(vs ...int) predicate.Comment { } return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.Without(v...)) - }, - ) + }) } // NillableIntGT applies the GT predicate on the "nillable_int" field. func NillableIntGT(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.GT(v)) - }, - ) + }) } // NillableIntGTE applies the GTE predicate on the "nillable_int" field. func NillableIntGTE(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.GTE(v)) - }, - ) + }) } // NillableIntLT applies the LT predicate on the "nillable_int" field. func NillableIntLT(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.LT(v)) - }, - ) + }) } // NillableIntLTE applies the LTE predicate on the "nillable_int" field. func NillableIntLTE(v int) predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.LTE(v)) - }, - ) + }) } // NillableIntIsNil applies the IsNil predicate on the "nillable_int" field. func NillableIntIsNil() predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldNillableInt) - }, - ) + }) } // NillableIntNotNil applies the NotNil predicate on the "nillable_int" field. func NillableIntNotNil() predicate.Comment { return predicate.Comment(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldNillableInt) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Comment) predicate.Comment { - return predicate.Comment( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.Comment(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Comment) predicate.Comment { - return predicate.Comment( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.Comment(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Comment) predicate.Comment { - return predicate.Comment( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.Comment(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/fieldtype/where.go b/entc/integration/gremlin/ent/fieldtype/where.go index b90f65303..c3461970c 100644 --- a/entc/integration/gremlin/ent/fieldtype/where.go +++ b/entc/integration/gremlin/ent/fieldtype/where.go @@ -15,27 +15,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.FieldType { - return predicate.FieldType( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.FieldType(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -46,8 +42,7 @@ func IDIn(ids ...string) predicate.FieldType { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -58,224 +53,196 @@ func IDNotIn(ids ...string) predicate.FieldType { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // Int applies equality check predicate on the "int" field. It's identical to IntEQ. func Int(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.EQ(v)) - }, - ) + }) } // Int8 applies equality check predicate on the "int8" field. It's identical to Int8EQ. func Int8(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.EQ(v)) - }, - ) + }) } // Int16 applies equality check predicate on the "int16" field. It's identical to Int16EQ. func Int16(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.EQ(v)) - }, - ) + }) } // Int32 applies equality check predicate on the "int32" field. It's identical to Int32EQ. func Int32(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.EQ(v)) - }, - ) + }) } // Int64 applies equality check predicate on the "int64" field. It's identical to Int64EQ. func Int64(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.EQ(v)) - }, - ) + }) } // OptionalInt applies equality check predicate on the "optional_int" field. It's identical to OptionalIntEQ. func OptionalInt(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.EQ(v)) - }, - ) + }) } // OptionalInt8 applies equality check predicate on the "optional_int8" field. It's identical to OptionalInt8EQ. func OptionalInt8(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.EQ(v)) - }, - ) + }) } // OptionalInt16 applies equality check predicate on the "optional_int16" field. It's identical to OptionalInt16EQ. func OptionalInt16(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.EQ(v)) - }, - ) + }) } // OptionalInt32 applies equality check predicate on the "optional_int32" field. It's identical to OptionalInt32EQ. func OptionalInt32(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.EQ(v)) - }, - ) + }) } // OptionalInt64 applies equality check predicate on the "optional_int64" field. It's identical to OptionalInt64EQ. func OptionalInt64(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.EQ(v)) - }, - ) + }) } // NillableInt applies equality check predicate on the "nillable_int" field. It's identical to NillableIntEQ. func NillableInt(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.EQ(v)) - }, - ) + }) } // NillableInt8 applies equality check predicate on the "nillable_int8" field. It's identical to NillableInt8EQ. func NillableInt8(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.EQ(v)) - }, - ) + }) } // NillableInt16 applies equality check predicate on the "nillable_int16" field. It's identical to NillableInt16EQ. func NillableInt16(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.EQ(v)) - }, - ) + }) } // NillableInt32 applies equality check predicate on the "nillable_int32" field. It's identical to NillableInt32EQ. func NillableInt32(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.EQ(v)) - }, - ) + }) } // NillableInt64 applies equality check predicate on the "nillable_int64" field. It's identical to NillableInt64EQ. func NillableInt64(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.EQ(v)) - }, - ) + }) } // ValidateOptionalInt32 applies equality check predicate on the "validate_optional_int32" field. It's identical to ValidateOptionalInt32EQ. func ValidateOptionalInt32(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.EQ(v)) - }, - ) + }) } // OptionalUint applies equality check predicate on the "optional_uint" field. It's identical to OptionalUintEQ. func OptionalUint(v uint) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.EQ(v)) - }, - ) + }) } // OptionalUint8 applies equality check predicate on the "optional_uint8" field. It's identical to OptionalUint8EQ. func OptionalUint8(v uint8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.EQ(v)) - }, - ) + }) } // OptionalUint16 applies equality check predicate on the "optional_uint16" field. It's identical to OptionalUint16EQ. func OptionalUint16(v uint16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.EQ(v)) - }, - ) + }) } // OptionalUint32 applies equality check predicate on the "optional_uint32" field. It's identical to OptionalUint32EQ. func OptionalUint32(v uint32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.EQ(v)) - }, - ) + }) } // OptionalUint64 applies equality check predicate on the "optional_uint64" field. It's identical to OptionalUint64EQ. func OptionalUint64(v uint64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.EQ(v)) - }, - ) + }) } // IntEQ applies the EQ predicate on the "int" field. func IntEQ(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.EQ(v)) - }, - ) + }) } // IntNEQ applies the NEQ predicate on the "int" field. func IntNEQ(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.NEQ(v)) - }, - ) + }) } // IntIn applies the In predicate on the "int" field. @@ -286,8 +253,7 @@ func IntIn(vs ...int) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.Within(v...)) - }, - ) + }) } // IntNotIn applies the NotIn predicate on the "int" field. @@ -298,56 +264,49 @@ func IntNotIn(vs ...int) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.Without(v...)) - }, - ) + }) } // IntGT applies the GT predicate on the "int" field. func IntGT(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.GT(v)) - }, - ) + }) } // IntGTE applies the GTE predicate on the "int" field. func IntGTE(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.GTE(v)) - }, - ) + }) } // IntLT applies the LT predicate on the "int" field. func IntLT(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.LT(v)) - }, - ) + }) } // IntLTE applies the LTE predicate on the "int" field. func IntLTE(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt, p.LTE(v)) - }, - ) + }) } // Int8EQ applies the EQ predicate on the "int8" field. func Int8EQ(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.EQ(v)) - }, - ) + }) } // Int8NEQ applies the NEQ predicate on the "int8" field. func Int8NEQ(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.NEQ(v)) - }, - ) + }) } // Int8In applies the In predicate on the "int8" field. @@ -358,8 +317,7 @@ func Int8In(vs ...int8) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.Within(v...)) - }, - ) + }) } // Int8NotIn applies the NotIn predicate on the "int8" field. @@ -370,56 +328,49 @@ func Int8NotIn(vs ...int8) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.Without(v...)) - }, - ) + }) } // Int8GT applies the GT predicate on the "int8" field. func Int8GT(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.GT(v)) - }, - ) + }) } // Int8GTE applies the GTE predicate on the "int8" field. func Int8GTE(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.GTE(v)) - }, - ) + }) } // Int8LT applies the LT predicate on the "int8" field. func Int8LT(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.LT(v)) - }, - ) + }) } // Int8LTE applies the LTE predicate on the "int8" field. func Int8LTE(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt8, p.LTE(v)) - }, - ) + }) } // Int16EQ applies the EQ predicate on the "int16" field. func Int16EQ(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.EQ(v)) - }, - ) + }) } // Int16NEQ applies the NEQ predicate on the "int16" field. func Int16NEQ(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.NEQ(v)) - }, - ) + }) } // Int16In applies the In predicate on the "int16" field. @@ -430,8 +381,7 @@ func Int16In(vs ...int16) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.Within(v...)) - }, - ) + }) } // Int16NotIn applies the NotIn predicate on the "int16" field. @@ -442,56 +392,49 @@ func Int16NotIn(vs ...int16) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.Without(v...)) - }, - ) + }) } // Int16GT applies the GT predicate on the "int16" field. func Int16GT(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.GT(v)) - }, - ) + }) } // Int16GTE applies the GTE predicate on the "int16" field. func Int16GTE(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.GTE(v)) - }, - ) + }) } // Int16LT applies the LT predicate on the "int16" field. func Int16LT(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.LT(v)) - }, - ) + }) } // Int16LTE applies the LTE predicate on the "int16" field. func Int16LTE(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt16, p.LTE(v)) - }, - ) + }) } // Int32EQ applies the EQ predicate on the "int32" field. func Int32EQ(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.EQ(v)) - }, - ) + }) } // Int32NEQ applies the NEQ predicate on the "int32" field. func Int32NEQ(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.NEQ(v)) - }, - ) + }) } // Int32In applies the In predicate on the "int32" field. @@ -502,8 +445,7 @@ func Int32In(vs ...int32) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.Within(v...)) - }, - ) + }) } // Int32NotIn applies the NotIn predicate on the "int32" field. @@ -514,56 +456,49 @@ func Int32NotIn(vs ...int32) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.Without(v...)) - }, - ) + }) } // Int32GT applies the GT predicate on the "int32" field. func Int32GT(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.GT(v)) - }, - ) + }) } // Int32GTE applies the GTE predicate on the "int32" field. func Int32GTE(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.GTE(v)) - }, - ) + }) } // Int32LT applies the LT predicate on the "int32" field. func Int32LT(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.LT(v)) - }, - ) + }) } // Int32LTE applies the LTE predicate on the "int32" field. func Int32LTE(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt32, p.LTE(v)) - }, - ) + }) } // Int64EQ applies the EQ predicate on the "int64" field. func Int64EQ(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.EQ(v)) - }, - ) + }) } // Int64NEQ applies the NEQ predicate on the "int64" field. func Int64NEQ(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.NEQ(v)) - }, - ) + }) } // Int64In applies the In predicate on the "int64" field. @@ -574,8 +509,7 @@ func Int64In(vs ...int64) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.Within(v...)) - }, - ) + }) } // Int64NotIn applies the NotIn predicate on the "int64" field. @@ -586,56 +520,49 @@ func Int64NotIn(vs ...int64) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.Without(v...)) - }, - ) + }) } // Int64GT applies the GT predicate on the "int64" field. func Int64GT(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.GT(v)) - }, - ) + }) } // Int64GTE applies the GTE predicate on the "int64" field. func Int64GTE(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.GTE(v)) - }, - ) + }) } // Int64LT applies the LT predicate on the "int64" field. func Int64LT(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.LT(v)) - }, - ) + }) } // Int64LTE applies the LTE predicate on the "int64" field. func Int64LTE(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldInt64, p.LTE(v)) - }, - ) + }) } // OptionalIntEQ applies the EQ predicate on the "optional_int" field. func OptionalIntEQ(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.EQ(v)) - }, - ) + }) } // OptionalIntNEQ applies the NEQ predicate on the "optional_int" field. func OptionalIntNEQ(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.NEQ(v)) - }, - ) + }) } // OptionalIntIn applies the In predicate on the "optional_int" field. @@ -646,8 +573,7 @@ func OptionalIntIn(vs ...int) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.Within(v...)) - }, - ) + }) } // OptionalIntNotIn applies the NotIn predicate on the "optional_int" field. @@ -658,72 +584,63 @@ func OptionalIntNotIn(vs ...int) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.Without(v...)) - }, - ) + }) } // OptionalIntGT applies the GT predicate on the "optional_int" field. func OptionalIntGT(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.GT(v)) - }, - ) + }) } // OptionalIntGTE applies the GTE predicate on the "optional_int" field. func OptionalIntGTE(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.GTE(v)) - }, - ) + }) } // OptionalIntLT applies the LT predicate on the "optional_int" field. func OptionalIntLT(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.LT(v)) - }, - ) + }) } // OptionalIntLTE applies the LTE predicate on the "optional_int" field. func OptionalIntLTE(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.LTE(v)) - }, - ) + }) } // OptionalIntIsNil applies the IsNil predicate on the "optional_int" field. func OptionalIntIsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalInt) - }, - ) + }) } // OptionalIntNotNil applies the NotNil predicate on the "optional_int" field. func OptionalIntNotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalInt) - }, - ) + }) } // OptionalInt8EQ applies the EQ predicate on the "optional_int8" field. func OptionalInt8EQ(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.EQ(v)) - }, - ) + }) } // OptionalInt8NEQ applies the NEQ predicate on the "optional_int8" field. func OptionalInt8NEQ(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.NEQ(v)) - }, - ) + }) } // OptionalInt8In applies the In predicate on the "optional_int8" field. @@ -734,8 +651,7 @@ func OptionalInt8In(vs ...int8) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.Within(v...)) - }, - ) + }) } // OptionalInt8NotIn applies the NotIn predicate on the "optional_int8" field. @@ -746,72 +662,63 @@ func OptionalInt8NotIn(vs ...int8) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.Without(v...)) - }, - ) + }) } // OptionalInt8GT applies the GT predicate on the "optional_int8" field. func OptionalInt8GT(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.GT(v)) - }, - ) + }) } // OptionalInt8GTE applies the GTE predicate on the "optional_int8" field. func OptionalInt8GTE(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.GTE(v)) - }, - ) + }) } // OptionalInt8LT applies the LT predicate on the "optional_int8" field. func OptionalInt8LT(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.LT(v)) - }, - ) + }) } // OptionalInt8LTE applies the LTE predicate on the "optional_int8" field. func OptionalInt8LTE(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt8, p.LTE(v)) - }, - ) + }) } // OptionalInt8IsNil applies the IsNil predicate on the "optional_int8" field. func OptionalInt8IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalInt8) - }, - ) + }) } // OptionalInt8NotNil applies the NotNil predicate on the "optional_int8" field. func OptionalInt8NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalInt8) - }, - ) + }) } // OptionalInt16EQ applies the EQ predicate on the "optional_int16" field. func OptionalInt16EQ(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.EQ(v)) - }, - ) + }) } // OptionalInt16NEQ applies the NEQ predicate on the "optional_int16" field. func OptionalInt16NEQ(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.NEQ(v)) - }, - ) + }) } // OptionalInt16In applies the In predicate on the "optional_int16" field. @@ -822,8 +729,7 @@ func OptionalInt16In(vs ...int16) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.Within(v...)) - }, - ) + }) } // OptionalInt16NotIn applies the NotIn predicate on the "optional_int16" field. @@ -834,72 +740,63 @@ func OptionalInt16NotIn(vs ...int16) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.Without(v...)) - }, - ) + }) } // OptionalInt16GT applies the GT predicate on the "optional_int16" field. func OptionalInt16GT(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.GT(v)) - }, - ) + }) } // OptionalInt16GTE applies the GTE predicate on the "optional_int16" field. func OptionalInt16GTE(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.GTE(v)) - }, - ) + }) } // OptionalInt16LT applies the LT predicate on the "optional_int16" field. func OptionalInt16LT(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.LT(v)) - }, - ) + }) } // OptionalInt16LTE applies the LTE predicate on the "optional_int16" field. func OptionalInt16LTE(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt16, p.LTE(v)) - }, - ) + }) } // OptionalInt16IsNil applies the IsNil predicate on the "optional_int16" field. func OptionalInt16IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalInt16) - }, - ) + }) } // OptionalInt16NotNil applies the NotNil predicate on the "optional_int16" field. func OptionalInt16NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalInt16) - }, - ) + }) } // OptionalInt32EQ applies the EQ predicate on the "optional_int32" field. func OptionalInt32EQ(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.EQ(v)) - }, - ) + }) } // OptionalInt32NEQ applies the NEQ predicate on the "optional_int32" field. func OptionalInt32NEQ(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.NEQ(v)) - }, - ) + }) } // OptionalInt32In applies the In predicate on the "optional_int32" field. @@ -910,8 +807,7 @@ func OptionalInt32In(vs ...int32) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.Within(v...)) - }, - ) + }) } // OptionalInt32NotIn applies the NotIn predicate on the "optional_int32" field. @@ -922,72 +818,63 @@ func OptionalInt32NotIn(vs ...int32) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.Without(v...)) - }, - ) + }) } // OptionalInt32GT applies the GT predicate on the "optional_int32" field. func OptionalInt32GT(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.GT(v)) - }, - ) + }) } // OptionalInt32GTE applies the GTE predicate on the "optional_int32" field. func OptionalInt32GTE(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.GTE(v)) - }, - ) + }) } // OptionalInt32LT applies the LT predicate on the "optional_int32" field. func OptionalInt32LT(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.LT(v)) - }, - ) + }) } // OptionalInt32LTE applies the LTE predicate on the "optional_int32" field. func OptionalInt32LTE(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt32, p.LTE(v)) - }, - ) + }) } // OptionalInt32IsNil applies the IsNil predicate on the "optional_int32" field. func OptionalInt32IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalInt32) - }, - ) + }) } // OptionalInt32NotNil applies the NotNil predicate on the "optional_int32" field. func OptionalInt32NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalInt32) - }, - ) + }) } // OptionalInt64EQ applies the EQ predicate on the "optional_int64" field. func OptionalInt64EQ(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.EQ(v)) - }, - ) + }) } // OptionalInt64NEQ applies the NEQ predicate on the "optional_int64" field. func OptionalInt64NEQ(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.NEQ(v)) - }, - ) + }) } // OptionalInt64In applies the In predicate on the "optional_int64" field. @@ -998,8 +885,7 @@ func OptionalInt64In(vs ...int64) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.Within(v...)) - }, - ) + }) } // OptionalInt64NotIn applies the NotIn predicate on the "optional_int64" field. @@ -1010,72 +896,63 @@ func OptionalInt64NotIn(vs ...int64) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.Without(v...)) - }, - ) + }) } // OptionalInt64GT applies the GT predicate on the "optional_int64" field. func OptionalInt64GT(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.GT(v)) - }, - ) + }) } // OptionalInt64GTE applies the GTE predicate on the "optional_int64" field. func OptionalInt64GTE(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.GTE(v)) - }, - ) + }) } // OptionalInt64LT applies the LT predicate on the "optional_int64" field. func OptionalInt64LT(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.LT(v)) - }, - ) + }) } // OptionalInt64LTE applies the LTE predicate on the "optional_int64" field. func OptionalInt64LTE(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt64, p.LTE(v)) - }, - ) + }) } // OptionalInt64IsNil applies the IsNil predicate on the "optional_int64" field. func OptionalInt64IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalInt64) - }, - ) + }) } // OptionalInt64NotNil applies the NotNil predicate on the "optional_int64" field. func OptionalInt64NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalInt64) - }, - ) + }) } // NillableIntEQ applies the EQ predicate on the "nillable_int" field. func NillableIntEQ(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.EQ(v)) - }, - ) + }) } // NillableIntNEQ applies the NEQ predicate on the "nillable_int" field. func NillableIntNEQ(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.NEQ(v)) - }, - ) + }) } // NillableIntIn applies the In predicate on the "nillable_int" field. @@ -1086,8 +963,7 @@ func NillableIntIn(vs ...int) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.Within(v...)) - }, - ) + }) } // NillableIntNotIn applies the NotIn predicate on the "nillable_int" field. @@ -1098,72 +974,63 @@ func NillableIntNotIn(vs ...int) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.Without(v...)) - }, - ) + }) } // NillableIntGT applies the GT predicate on the "nillable_int" field. func NillableIntGT(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.GT(v)) - }, - ) + }) } // NillableIntGTE applies the GTE predicate on the "nillable_int" field. func NillableIntGTE(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.GTE(v)) - }, - ) + }) } // NillableIntLT applies the LT predicate on the "nillable_int" field. func NillableIntLT(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.LT(v)) - }, - ) + }) } // NillableIntLTE applies the LTE predicate on the "nillable_int" field. func NillableIntLTE(v int) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt, p.LTE(v)) - }, - ) + }) } // NillableIntIsNil applies the IsNil predicate on the "nillable_int" field. func NillableIntIsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldNillableInt) - }, - ) + }) } // NillableIntNotNil applies the NotNil predicate on the "nillable_int" field. func NillableIntNotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldNillableInt) - }, - ) + }) } // NillableInt8EQ applies the EQ predicate on the "nillable_int8" field. func NillableInt8EQ(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.EQ(v)) - }, - ) + }) } // NillableInt8NEQ applies the NEQ predicate on the "nillable_int8" field. func NillableInt8NEQ(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.NEQ(v)) - }, - ) + }) } // NillableInt8In applies the In predicate on the "nillable_int8" field. @@ -1174,8 +1041,7 @@ func NillableInt8In(vs ...int8) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.Within(v...)) - }, - ) + }) } // NillableInt8NotIn applies the NotIn predicate on the "nillable_int8" field. @@ -1186,72 +1052,63 @@ func NillableInt8NotIn(vs ...int8) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.Without(v...)) - }, - ) + }) } // NillableInt8GT applies the GT predicate on the "nillable_int8" field. func NillableInt8GT(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.GT(v)) - }, - ) + }) } // NillableInt8GTE applies the GTE predicate on the "nillable_int8" field. func NillableInt8GTE(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.GTE(v)) - }, - ) + }) } // NillableInt8LT applies the LT predicate on the "nillable_int8" field. func NillableInt8LT(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.LT(v)) - }, - ) + }) } // NillableInt8LTE applies the LTE predicate on the "nillable_int8" field. func NillableInt8LTE(v int8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt8, p.LTE(v)) - }, - ) + }) } // NillableInt8IsNil applies the IsNil predicate on the "nillable_int8" field. func NillableInt8IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldNillableInt8) - }, - ) + }) } // NillableInt8NotNil applies the NotNil predicate on the "nillable_int8" field. func NillableInt8NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldNillableInt8) - }, - ) + }) } // NillableInt16EQ applies the EQ predicate on the "nillable_int16" field. func NillableInt16EQ(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.EQ(v)) - }, - ) + }) } // NillableInt16NEQ applies the NEQ predicate on the "nillable_int16" field. func NillableInt16NEQ(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.NEQ(v)) - }, - ) + }) } // NillableInt16In applies the In predicate on the "nillable_int16" field. @@ -1262,8 +1119,7 @@ func NillableInt16In(vs ...int16) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.Within(v...)) - }, - ) + }) } // NillableInt16NotIn applies the NotIn predicate on the "nillable_int16" field. @@ -1274,72 +1130,63 @@ func NillableInt16NotIn(vs ...int16) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.Without(v...)) - }, - ) + }) } // NillableInt16GT applies the GT predicate on the "nillable_int16" field. func NillableInt16GT(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.GT(v)) - }, - ) + }) } // NillableInt16GTE applies the GTE predicate on the "nillable_int16" field. func NillableInt16GTE(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.GTE(v)) - }, - ) + }) } // NillableInt16LT applies the LT predicate on the "nillable_int16" field. func NillableInt16LT(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.LT(v)) - }, - ) + }) } // NillableInt16LTE applies the LTE predicate on the "nillable_int16" field. func NillableInt16LTE(v int16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt16, p.LTE(v)) - }, - ) + }) } // NillableInt16IsNil applies the IsNil predicate on the "nillable_int16" field. func NillableInt16IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldNillableInt16) - }, - ) + }) } // NillableInt16NotNil applies the NotNil predicate on the "nillable_int16" field. func NillableInt16NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldNillableInt16) - }, - ) + }) } // NillableInt32EQ applies the EQ predicate on the "nillable_int32" field. func NillableInt32EQ(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.EQ(v)) - }, - ) + }) } // NillableInt32NEQ applies the NEQ predicate on the "nillable_int32" field. func NillableInt32NEQ(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.NEQ(v)) - }, - ) + }) } // NillableInt32In applies the In predicate on the "nillable_int32" field. @@ -1350,8 +1197,7 @@ func NillableInt32In(vs ...int32) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.Within(v...)) - }, - ) + }) } // NillableInt32NotIn applies the NotIn predicate on the "nillable_int32" field. @@ -1362,72 +1208,63 @@ func NillableInt32NotIn(vs ...int32) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.Without(v...)) - }, - ) + }) } // NillableInt32GT applies the GT predicate on the "nillable_int32" field. func NillableInt32GT(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.GT(v)) - }, - ) + }) } // NillableInt32GTE applies the GTE predicate on the "nillable_int32" field. func NillableInt32GTE(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.GTE(v)) - }, - ) + }) } // NillableInt32LT applies the LT predicate on the "nillable_int32" field. func NillableInt32LT(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.LT(v)) - }, - ) + }) } // NillableInt32LTE applies the LTE predicate on the "nillable_int32" field. func NillableInt32LTE(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt32, p.LTE(v)) - }, - ) + }) } // NillableInt32IsNil applies the IsNil predicate on the "nillable_int32" field. func NillableInt32IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldNillableInt32) - }, - ) + }) } // NillableInt32NotNil applies the NotNil predicate on the "nillable_int32" field. func NillableInt32NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldNillableInt32) - }, - ) + }) } // NillableInt64EQ applies the EQ predicate on the "nillable_int64" field. func NillableInt64EQ(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.EQ(v)) - }, - ) + }) } // NillableInt64NEQ applies the NEQ predicate on the "nillable_int64" field. func NillableInt64NEQ(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.NEQ(v)) - }, - ) + }) } // NillableInt64In applies the In predicate on the "nillable_int64" field. @@ -1438,8 +1275,7 @@ func NillableInt64In(vs ...int64) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.Within(v...)) - }, - ) + }) } // NillableInt64NotIn applies the NotIn predicate on the "nillable_int64" field. @@ -1450,72 +1286,63 @@ func NillableInt64NotIn(vs ...int64) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.Without(v...)) - }, - ) + }) } // NillableInt64GT applies the GT predicate on the "nillable_int64" field. func NillableInt64GT(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.GT(v)) - }, - ) + }) } // NillableInt64GTE applies the GTE predicate on the "nillable_int64" field. func NillableInt64GTE(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.GTE(v)) - }, - ) + }) } // NillableInt64LT applies the LT predicate on the "nillable_int64" field. func NillableInt64LT(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.LT(v)) - }, - ) + }) } // NillableInt64LTE applies the LTE predicate on the "nillable_int64" field. func NillableInt64LTE(v int64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldNillableInt64, p.LTE(v)) - }, - ) + }) } // NillableInt64IsNil applies the IsNil predicate on the "nillable_int64" field. func NillableInt64IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldNillableInt64) - }, - ) + }) } // NillableInt64NotNil applies the NotNil predicate on the "nillable_int64" field. func NillableInt64NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldNillableInt64) - }, - ) + }) } // ValidateOptionalInt32EQ applies the EQ predicate on the "validate_optional_int32" field. func ValidateOptionalInt32EQ(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.EQ(v)) - }, - ) + }) } // ValidateOptionalInt32NEQ applies the NEQ predicate on the "validate_optional_int32" field. func ValidateOptionalInt32NEQ(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.NEQ(v)) - }, - ) + }) } // ValidateOptionalInt32In applies the In predicate on the "validate_optional_int32" field. @@ -1526,8 +1353,7 @@ func ValidateOptionalInt32In(vs ...int32) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.Within(v...)) - }, - ) + }) } // ValidateOptionalInt32NotIn applies the NotIn predicate on the "validate_optional_int32" field. @@ -1538,72 +1364,63 @@ func ValidateOptionalInt32NotIn(vs ...int32) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.Without(v...)) - }, - ) + }) } // ValidateOptionalInt32GT applies the GT predicate on the "validate_optional_int32" field. func ValidateOptionalInt32GT(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.GT(v)) - }, - ) + }) } // ValidateOptionalInt32GTE applies the GTE predicate on the "validate_optional_int32" field. func ValidateOptionalInt32GTE(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.GTE(v)) - }, - ) + }) } // ValidateOptionalInt32LT applies the LT predicate on the "validate_optional_int32" field. func ValidateOptionalInt32LT(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.LT(v)) - }, - ) + }) } // ValidateOptionalInt32LTE applies the LTE predicate on the "validate_optional_int32" field. func ValidateOptionalInt32LTE(v int32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldValidateOptionalInt32, p.LTE(v)) - }, - ) + }) } // ValidateOptionalInt32IsNil applies the IsNil predicate on the "validate_optional_int32" field. func ValidateOptionalInt32IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldValidateOptionalInt32) - }, - ) + }) } // ValidateOptionalInt32NotNil applies the NotNil predicate on the "validate_optional_int32" field. func ValidateOptionalInt32NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldValidateOptionalInt32) - }, - ) + }) } // OptionalUintEQ applies the EQ predicate on the "optional_uint" field. func OptionalUintEQ(v uint) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.EQ(v)) - }, - ) + }) } // OptionalUintNEQ applies the NEQ predicate on the "optional_uint" field. func OptionalUintNEQ(v uint) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.NEQ(v)) - }, - ) + }) } // OptionalUintIn applies the In predicate on the "optional_uint" field. @@ -1614,8 +1431,7 @@ func OptionalUintIn(vs ...uint) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.Within(v...)) - }, - ) + }) } // OptionalUintNotIn applies the NotIn predicate on the "optional_uint" field. @@ -1626,72 +1442,63 @@ func OptionalUintNotIn(vs ...uint) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.Without(v...)) - }, - ) + }) } // OptionalUintGT applies the GT predicate on the "optional_uint" field. func OptionalUintGT(v uint) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.GT(v)) - }, - ) + }) } // OptionalUintGTE applies the GTE predicate on the "optional_uint" field. func OptionalUintGTE(v uint) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.GTE(v)) - }, - ) + }) } // OptionalUintLT applies the LT predicate on the "optional_uint" field. func OptionalUintLT(v uint) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.LT(v)) - }, - ) + }) } // OptionalUintLTE applies the LTE predicate on the "optional_uint" field. func OptionalUintLTE(v uint) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint, p.LTE(v)) - }, - ) + }) } // OptionalUintIsNil applies the IsNil predicate on the "optional_uint" field. func OptionalUintIsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalUint) - }, - ) + }) } // OptionalUintNotNil applies the NotNil predicate on the "optional_uint" field. func OptionalUintNotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalUint) - }, - ) + }) } // OptionalUint8EQ applies the EQ predicate on the "optional_uint8" field. func OptionalUint8EQ(v uint8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.EQ(v)) - }, - ) + }) } // OptionalUint8NEQ applies the NEQ predicate on the "optional_uint8" field. func OptionalUint8NEQ(v uint8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.NEQ(v)) - }, - ) + }) } // OptionalUint8In applies the In predicate on the "optional_uint8" field. @@ -1702,8 +1509,7 @@ func OptionalUint8In(vs ...uint8) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.Within(v...)) - }, - ) + }) } // OptionalUint8NotIn applies the NotIn predicate on the "optional_uint8" field. @@ -1714,72 +1520,63 @@ func OptionalUint8NotIn(vs ...uint8) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.Without(v...)) - }, - ) + }) } // OptionalUint8GT applies the GT predicate on the "optional_uint8" field. func OptionalUint8GT(v uint8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.GT(v)) - }, - ) + }) } // OptionalUint8GTE applies the GTE predicate on the "optional_uint8" field. func OptionalUint8GTE(v uint8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.GTE(v)) - }, - ) + }) } // OptionalUint8LT applies the LT predicate on the "optional_uint8" field. func OptionalUint8LT(v uint8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.LT(v)) - }, - ) + }) } // OptionalUint8LTE applies the LTE predicate on the "optional_uint8" field. func OptionalUint8LTE(v uint8) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint8, p.LTE(v)) - }, - ) + }) } // OptionalUint8IsNil applies the IsNil predicate on the "optional_uint8" field. func OptionalUint8IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalUint8) - }, - ) + }) } // OptionalUint8NotNil applies the NotNil predicate on the "optional_uint8" field. func OptionalUint8NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalUint8) - }, - ) + }) } // OptionalUint16EQ applies the EQ predicate on the "optional_uint16" field. func OptionalUint16EQ(v uint16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.EQ(v)) - }, - ) + }) } // OptionalUint16NEQ applies the NEQ predicate on the "optional_uint16" field. func OptionalUint16NEQ(v uint16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.NEQ(v)) - }, - ) + }) } // OptionalUint16In applies the In predicate on the "optional_uint16" field. @@ -1790,8 +1587,7 @@ func OptionalUint16In(vs ...uint16) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.Within(v...)) - }, - ) + }) } // OptionalUint16NotIn applies the NotIn predicate on the "optional_uint16" field. @@ -1802,72 +1598,63 @@ func OptionalUint16NotIn(vs ...uint16) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.Without(v...)) - }, - ) + }) } // OptionalUint16GT applies the GT predicate on the "optional_uint16" field. func OptionalUint16GT(v uint16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.GT(v)) - }, - ) + }) } // OptionalUint16GTE applies the GTE predicate on the "optional_uint16" field. func OptionalUint16GTE(v uint16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.GTE(v)) - }, - ) + }) } // OptionalUint16LT applies the LT predicate on the "optional_uint16" field. func OptionalUint16LT(v uint16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.LT(v)) - }, - ) + }) } // OptionalUint16LTE applies the LTE predicate on the "optional_uint16" field. func OptionalUint16LTE(v uint16) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint16, p.LTE(v)) - }, - ) + }) } // OptionalUint16IsNil applies the IsNil predicate on the "optional_uint16" field. func OptionalUint16IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalUint16) - }, - ) + }) } // OptionalUint16NotNil applies the NotNil predicate on the "optional_uint16" field. func OptionalUint16NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalUint16) - }, - ) + }) } // OptionalUint32EQ applies the EQ predicate on the "optional_uint32" field. func OptionalUint32EQ(v uint32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.EQ(v)) - }, - ) + }) } // OptionalUint32NEQ applies the NEQ predicate on the "optional_uint32" field. func OptionalUint32NEQ(v uint32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.NEQ(v)) - }, - ) + }) } // OptionalUint32In applies the In predicate on the "optional_uint32" field. @@ -1878,8 +1665,7 @@ func OptionalUint32In(vs ...uint32) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.Within(v...)) - }, - ) + }) } // OptionalUint32NotIn applies the NotIn predicate on the "optional_uint32" field. @@ -1890,72 +1676,63 @@ func OptionalUint32NotIn(vs ...uint32) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.Without(v...)) - }, - ) + }) } // OptionalUint32GT applies the GT predicate on the "optional_uint32" field. func OptionalUint32GT(v uint32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.GT(v)) - }, - ) + }) } // OptionalUint32GTE applies the GTE predicate on the "optional_uint32" field. func OptionalUint32GTE(v uint32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.GTE(v)) - }, - ) + }) } // OptionalUint32LT applies the LT predicate on the "optional_uint32" field. func OptionalUint32LT(v uint32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.LT(v)) - }, - ) + }) } // OptionalUint32LTE applies the LTE predicate on the "optional_uint32" field. func OptionalUint32LTE(v uint32) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint32, p.LTE(v)) - }, - ) + }) } // OptionalUint32IsNil applies the IsNil predicate on the "optional_uint32" field. func OptionalUint32IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalUint32) - }, - ) + }) } // OptionalUint32NotNil applies the NotNil predicate on the "optional_uint32" field. func OptionalUint32NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalUint32) - }, - ) + }) } // OptionalUint64EQ applies the EQ predicate on the "optional_uint64" field. func OptionalUint64EQ(v uint64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.EQ(v)) - }, - ) + }) } // OptionalUint64NEQ applies the NEQ predicate on the "optional_uint64" field. func OptionalUint64NEQ(v uint64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.NEQ(v)) - }, - ) + }) } // OptionalUint64In applies the In predicate on the "optional_uint64" field. @@ -1966,8 +1743,7 @@ func OptionalUint64In(vs ...uint64) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.Within(v...)) - }, - ) + }) } // OptionalUint64NotIn applies the NotIn predicate on the "optional_uint64" field. @@ -1978,72 +1754,63 @@ func OptionalUint64NotIn(vs ...uint64) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.Without(v...)) - }, - ) + }) } // OptionalUint64GT applies the GT predicate on the "optional_uint64" field. func OptionalUint64GT(v uint64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.GT(v)) - }, - ) + }) } // OptionalUint64GTE applies the GTE predicate on the "optional_uint64" field. func OptionalUint64GTE(v uint64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.GTE(v)) - }, - ) + }) } // OptionalUint64LT applies the LT predicate on the "optional_uint64" field. func OptionalUint64LT(v uint64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.LT(v)) - }, - ) + }) } // OptionalUint64LTE applies the LTE predicate on the "optional_uint64" field. func OptionalUint64LTE(v uint64) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalUint64, p.LTE(v)) - }, - ) + }) } // OptionalUint64IsNil applies the IsNil predicate on the "optional_uint64" field. func OptionalUint64IsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalUint64) - }, - ) + }) } // OptionalUint64NotNil applies the NotNil predicate on the "optional_uint64" field. func OptionalUint64NotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalUint64) - }, - ) + }) } // StateEQ applies the EQ predicate on the "state" field. func StateEQ(v State) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldState, p.EQ(v)) - }, - ) + }) } // StateNEQ applies the NEQ predicate on the "state" field. func StateNEQ(v State) predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldState, p.NEQ(v)) - }, - ) + }) } // StateIn applies the In predicate on the "state" field. @@ -2054,8 +1821,7 @@ func StateIn(vs ...State) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldState, p.Within(v...)) - }, - ) + }) } // StateNotIn applies the NotIn predicate on the "state" field. @@ -2066,63 +1832,54 @@ func StateNotIn(vs ...State) predicate.FieldType { } return predicate.FieldType(func(t *dsl.Traversal) { t.Has(Label, FieldState, p.Without(v...)) - }, - ) + }) } // StateIsNil applies the IsNil predicate on the "state" field. func StateIsNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldState) - }, - ) + }) } // StateNotNil applies the NotNil predicate on the "state" field. func StateNotNil() predicate.FieldType { return predicate.FieldType(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldState) - }, - ) + }) } // 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) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.FieldType(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.FieldType) predicate.FieldType { - return predicate.FieldType( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.FieldType(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.FieldType) predicate.FieldType { - return predicate.FieldType( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.FieldType(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/file/where.go b/entc/integration/gremlin/ent/file/where.go index a1deb462c..4e54104d7 100644 --- a/entc/integration/gremlin/ent/file/where.go +++ b/entc/integration/gremlin/ent/file/where.go @@ -15,27 +15,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.File { - return predicate.File( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.File(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -46,8 +42,7 @@ func IDIn(ids ...string) predicate.File { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -58,88 +53,77 @@ func IDNotIn(ids ...string) predicate.File { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // Size applies equality check predicate on the "size" field. It's identical to SizeEQ. func Size(v int) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.EQ(v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // User applies equality check predicate on the "user" field. It's identical to UserEQ. func User(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.EQ(v)) - }, - ) + }) } // Group applies equality check predicate on the "group" field. It's identical to GroupEQ. func Group(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.EQ(v)) - }, - ) + }) } // SizeEQ applies the EQ predicate on the "size" field. func SizeEQ(v int) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.EQ(v)) - }, - ) + }) } // SizeNEQ applies the NEQ predicate on the "size" field. func SizeNEQ(v int) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.NEQ(v)) - }, - ) + }) } // SizeIn applies the In predicate on the "size" field. @@ -150,8 +134,7 @@ func SizeIn(vs ...int) predicate.File { } return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.Within(v...)) - }, - ) + }) } // SizeNotIn applies the NotIn predicate on the "size" field. @@ -162,56 +145,49 @@ func SizeNotIn(vs ...int) predicate.File { } return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.Without(v...)) - }, - ) + }) } // SizeGT applies the GT predicate on the "size" field. func SizeGT(v int) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.GT(v)) - }, - ) + }) } // SizeGTE applies the GTE predicate on the "size" field. func SizeGTE(v int) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.GTE(v)) - }, - ) + }) } // SizeLT applies the LT predicate on the "size" field. func SizeLT(v int) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.LT(v)) - }, - ) + }) } // SizeLTE applies the LTE predicate on the "size" field. func SizeLTE(v int) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldSize, p.LTE(v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.NEQ(v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -222,8 +198,7 @@ func NameIn(vs ...string) predicate.File { } return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -234,80 +209,70 @@ func NameNotIn(vs ...string) predicate.File { } return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GT(v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GTE(v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LT(v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LTE(v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Containing(v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.StartingWith(v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EndingWith(v)) - }, - ) + }) } // UserEQ applies the EQ predicate on the "user" field. func UserEQ(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.EQ(v)) - }, - ) + }) } // UserNEQ applies the NEQ predicate on the "user" field. func UserNEQ(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.NEQ(v)) - }, - ) + }) } // UserIn applies the In predicate on the "user" field. @@ -318,8 +283,7 @@ func UserIn(vs ...string) predicate.File { } return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.Within(v...)) - }, - ) + }) } // UserNotIn applies the NotIn predicate on the "user" field. @@ -330,96 +294,84 @@ func UserNotIn(vs ...string) predicate.File { } return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.Without(v...)) - }, - ) + }) } // UserGT applies the GT predicate on the "user" field. func UserGT(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.GT(v)) - }, - ) + }) } // UserGTE applies the GTE predicate on the "user" field. func UserGTE(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.GTE(v)) - }, - ) + }) } // UserLT applies the LT predicate on the "user" field. func UserLT(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.LT(v)) - }, - ) + }) } // UserLTE applies the LTE predicate on the "user" field. func UserLTE(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.LTE(v)) - }, - ) + }) } // UserContains applies the Contains predicate on the "user" field. func UserContains(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.Containing(v)) - }, - ) + }) } // UserHasPrefix applies the HasPrefix predicate on the "user" field. func UserHasPrefix(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.StartingWith(v)) - }, - ) + }) } // UserHasSuffix applies the HasSuffix predicate on the "user" field. func UserHasSuffix(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldUser, p.EndingWith(v)) - }, - ) + }) } // UserIsNil applies the IsNil predicate on the "user" field. func UserIsNil() predicate.File { return predicate.File(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldUser) - }, - ) + }) } // UserNotNil applies the NotNil predicate on the "user" field. func UserNotNil() predicate.File { return predicate.File(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldUser) - }, - ) + }) } // GroupEQ applies the EQ predicate on the "group" field. func GroupEQ(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.EQ(v)) - }, - ) + }) } // GroupNEQ applies the NEQ predicate on the "group" field. func GroupNEQ(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.NEQ(v)) - }, - ) + }) } // GroupIn applies the In predicate on the "group" field. @@ -430,8 +382,7 @@ func GroupIn(vs ...string) predicate.File { } return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.Within(v...)) - }, - ) + }) } // GroupNotIn applies the NotIn predicate on the "group" field. @@ -442,88 +393,77 @@ func GroupNotIn(vs ...string) predicate.File { } return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.Without(v...)) - }, - ) + }) } // GroupGT applies the GT predicate on the "group" field. func GroupGT(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.GT(v)) - }, - ) + }) } // GroupGTE applies the GTE predicate on the "group" field. func GroupGTE(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.GTE(v)) - }, - ) + }) } // GroupLT applies the LT predicate on the "group" field. func GroupLT(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.LT(v)) - }, - ) + }) } // GroupLTE applies the LTE predicate on the "group" field. func GroupLTE(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.LTE(v)) - }, - ) + }) } // GroupContains applies the Contains predicate on the "group" field. func GroupContains(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.Containing(v)) - }, - ) + }) } // GroupHasPrefix applies the HasPrefix predicate on the "group" field. func GroupHasPrefix(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.StartingWith(v)) - }, - ) + }) } // GroupHasSuffix applies the HasSuffix predicate on the "group" field. func GroupHasSuffix(v string) predicate.File { return predicate.File(func(t *dsl.Traversal) { t.Has(Label, FieldGroup, p.EndingWith(v)) - }, - ) + }) } // GroupIsNil applies the IsNil predicate on the "group" field. func GroupIsNil() predicate.File { return predicate.File(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldGroup) - }, - ) + }) } // GroupNotNil applies the NotNil predicate on the "group" field. func GroupNotNil() predicate.File { return predicate.File(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldGroup) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. func HasOwner() predicate.File { return predicate.File(func(t *dsl.Traversal) { t.InE(OwnerInverseLabel).InV() - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -534,16 +474,14 @@ func HasOwnerWith(preds ...predicate.User) predicate.File { p(tr) } t.InE(OwnerInverseLabel).Where(tr).InV() - }, - ) + }) } // HasType applies the HasEdge predicate on the "type" edge. func HasType() predicate.File { return predicate.File(func(t *dsl.Traversal) { t.InE(TypeInverseLabel).InV() - }, - ) + }) } // HasTypeWith applies the HasEdge predicate on the "type" edge with a given conditions (other predicates). @@ -554,47 +492,40 @@ func HasTypeWith(preds ...predicate.FileType) predicate.File { p(tr) } t.InE(TypeInverseLabel).Where(tr).InV() - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.File) predicate.File { - return predicate.File( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.File(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.File) predicate.File { - return predicate.File( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.File(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.File) predicate.File { - return predicate.File( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.File(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/filetype/where.go b/entc/integration/gremlin/ent/filetype/where.go index 2bc52a169..56e881702 100644 --- a/entc/integration/gremlin/ent/filetype/where.go +++ b/entc/integration/gremlin/ent/filetype/where.go @@ -15,27 +15,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.FileType { - return predicate.FileType( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.FileType(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -46,8 +42,7 @@ func IDIn(ids ...string) predicate.FileType { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -58,64 +53,56 @@ func IDNotIn(ids ...string) predicate.FileType { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.NEQ(v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -126,8 +113,7 @@ func NameIn(vs ...string) predicate.FileType { } return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -138,72 +124,63 @@ func NameNotIn(vs ...string) predicate.FileType { } return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GT(v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GTE(v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LT(v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LTE(v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Containing(v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.StartingWith(v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EndingWith(v)) - }, - ) + }) } // HasFiles applies the HasEdge predicate on the "files" edge. func HasFiles() predicate.FileType { return predicate.FileType(func(t *dsl.Traversal) { t.OutE(FilesLabel).OutV() - }, - ) + }) } // HasFilesWith applies the HasEdge predicate on the "files" edge with a given conditions (other predicates). @@ -214,47 +191,40 @@ func HasFilesWith(preds ...predicate.File) predicate.FileType { p(tr) } t.OutE(FilesLabel).Where(tr).OutV() - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.FileType) predicate.FileType { - return predicate.FileType( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.FileType(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.FileType) predicate.FileType { - return predicate.FileType( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.FileType(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.FileType) predicate.FileType { - return predicate.FileType( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.FileType(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/group/where.go b/entc/integration/gremlin/ent/group/where.go index 874ec012c..3bc4c819d 100644 --- a/entc/integration/gremlin/ent/group/where.go +++ b/entc/integration/gremlin/ent/group/where.go @@ -17,27 +17,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Group { - return predicate.Group( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.Group(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -48,8 +44,7 @@ func IDIn(ids ...string) predicate.Group { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -60,112 +55,98 @@ func IDNotIn(ids ...string) predicate.Group { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // Active applies equality check predicate on the "active" field. It's identical to ActiveEQ. func Active(v bool) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldActive, p.EQ(v)) - }, - ) + }) } // Expire applies equality check predicate on the "expire" field. It's identical to ExpireEQ. func Expire(v time.Time) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.EQ(v)) - }, - ) + }) } // Type applies equality check predicate on the "type" field. It's identical to TypeEQ. func Type(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.EQ(v)) - }, - ) + }) } // MaxUsers applies equality check predicate on the "max_users" field. It's identical to MaxUsersEQ. func MaxUsers(v int) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.EQ(v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // ActiveEQ applies the EQ predicate on the "active" field. func ActiveEQ(v bool) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldActive, p.EQ(v)) - }, - ) + }) } // ActiveNEQ applies the NEQ predicate on the "active" field. func ActiveNEQ(v bool) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldActive, p.NEQ(v)) - }, - ) + }) } // ExpireEQ applies the EQ predicate on the "expire" field. func ExpireEQ(v time.Time) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.EQ(v)) - }, - ) + }) } // ExpireNEQ applies the NEQ predicate on the "expire" field. func ExpireNEQ(v time.Time) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.NEQ(v)) - }, - ) + }) } // ExpireIn applies the In predicate on the "expire" field. @@ -176,8 +157,7 @@ func ExpireIn(vs ...time.Time) predicate.Group { } return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.Within(v...)) - }, - ) + }) } // ExpireNotIn applies the NotIn predicate on the "expire" field. @@ -188,56 +168,49 @@ func ExpireNotIn(vs ...time.Time) predicate.Group { } return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.Without(v...)) - }, - ) + }) } // ExpireGT applies the GT predicate on the "expire" field. func ExpireGT(v time.Time) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.GT(v)) - }, - ) + }) } // ExpireGTE applies the GTE predicate on the "expire" field. func ExpireGTE(v time.Time) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.GTE(v)) - }, - ) + }) } // ExpireLT applies the LT predicate on the "expire" field. func ExpireLT(v time.Time) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.LT(v)) - }, - ) + }) } // ExpireLTE applies the LTE predicate on the "expire" field. func ExpireLTE(v time.Time) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldExpire, p.LTE(v)) - }, - ) + }) } // TypeEQ applies the EQ predicate on the "type" field. func TypeEQ(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.EQ(v)) - }, - ) + }) } // TypeNEQ applies the NEQ predicate on the "type" field. func TypeNEQ(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.NEQ(v)) - }, - ) + }) } // TypeIn applies the In predicate on the "type" field. @@ -248,8 +221,7 @@ func TypeIn(vs ...string) predicate.Group { } return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.Within(v...)) - }, - ) + }) } // TypeNotIn applies the NotIn predicate on the "type" field. @@ -260,96 +232,84 @@ func TypeNotIn(vs ...string) predicate.Group { } return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.Without(v...)) - }, - ) + }) } // TypeGT applies the GT predicate on the "type" field. func TypeGT(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.GT(v)) - }, - ) + }) } // TypeGTE applies the GTE predicate on the "type" field. func TypeGTE(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.GTE(v)) - }, - ) + }) } // TypeLT applies the LT predicate on the "type" field. func TypeLT(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.LT(v)) - }, - ) + }) } // TypeLTE applies the LTE predicate on the "type" field. func TypeLTE(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.LTE(v)) - }, - ) + }) } // TypeContains applies the Contains predicate on the "type" field. func TypeContains(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.Containing(v)) - }, - ) + }) } // TypeHasPrefix applies the HasPrefix predicate on the "type" field. func TypeHasPrefix(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.StartingWith(v)) - }, - ) + }) } // TypeHasSuffix applies the HasSuffix predicate on the "type" field. func TypeHasSuffix(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldType, p.EndingWith(v)) - }, - ) + }) } // TypeIsNil applies the IsNil predicate on the "type" field. func TypeIsNil() predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldType) - }, - ) + }) } // TypeNotNil applies the NotNil predicate on the "type" field. func TypeNotNil() predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldType) - }, - ) + }) } // MaxUsersEQ applies the EQ predicate on the "max_users" field. func MaxUsersEQ(v int) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.EQ(v)) - }, - ) + }) } // MaxUsersNEQ applies the NEQ predicate on the "max_users" field. func MaxUsersNEQ(v int) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.NEQ(v)) - }, - ) + }) } // MaxUsersIn applies the In predicate on the "max_users" field. @@ -360,8 +320,7 @@ func MaxUsersIn(vs ...int) predicate.Group { } return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.Within(v...)) - }, - ) + }) } // MaxUsersNotIn applies the NotIn predicate on the "max_users" field. @@ -372,72 +331,63 @@ func MaxUsersNotIn(vs ...int) predicate.Group { } return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.Without(v...)) - }, - ) + }) } // MaxUsersGT applies the GT predicate on the "max_users" field. func MaxUsersGT(v int) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.GT(v)) - }, - ) + }) } // MaxUsersGTE applies the GTE predicate on the "max_users" field. func MaxUsersGTE(v int) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.GTE(v)) - }, - ) + }) } // MaxUsersLT applies the LT predicate on the "max_users" field. func MaxUsersLT(v int) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.LT(v)) - }, - ) + }) } // MaxUsersLTE applies the LTE predicate on the "max_users" field. func MaxUsersLTE(v int) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.LTE(v)) - }, - ) + }) } // MaxUsersIsNil applies the IsNil predicate on the "max_users" field. func MaxUsersIsNil() predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldMaxUsers) - }, - ) + }) } // MaxUsersNotNil applies the NotNil predicate on the "max_users" field. func MaxUsersNotNil() predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldMaxUsers) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.NEQ(v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -448,8 +398,7 @@ func NameIn(vs ...string) predicate.Group { } return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -460,72 +409,63 @@ func NameNotIn(vs ...string) predicate.Group { } return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GT(v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GTE(v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LT(v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LTE(v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Containing(v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.StartingWith(v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EndingWith(v)) - }, - ) + }) } // HasFiles applies the HasEdge predicate on the "files" edge. func HasFiles() predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.OutE(FilesLabel).OutV() - }, - ) + }) } // HasFilesWith applies the HasEdge predicate on the "files" edge with a given conditions (other predicates). @@ -536,16 +476,14 @@ func HasFilesWith(preds ...predicate.File) predicate.Group { p(tr) } t.OutE(FilesLabel).Where(tr).OutV() - }, - ) + }) } // HasBlocked applies the HasEdge predicate on the "blocked" edge. func HasBlocked() predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.OutE(BlockedLabel).OutV() - }, - ) + }) } // HasBlockedWith applies the HasEdge predicate on the "blocked" edge with a given conditions (other predicates). @@ -556,16 +494,14 @@ func HasBlockedWith(preds ...predicate.User) predicate.Group { p(tr) } t.OutE(BlockedLabel).Where(tr).OutV() - }, - ) + }) } // HasUsers applies the HasEdge predicate on the "users" edge. func HasUsers() predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.InE(UsersInverseLabel).InV() - }, - ) + }) } // HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates). @@ -576,16 +512,14 @@ func HasUsersWith(preds ...predicate.User) predicate.Group { p(tr) } t.InE(UsersInverseLabel).Where(tr).InV() - }, - ) + }) } // HasInfo applies the HasEdge predicate on the "info" edge. func HasInfo() predicate.Group { return predicate.Group(func(t *dsl.Traversal) { t.OutE(InfoLabel).OutV() - }, - ) + }) } // HasInfoWith applies the HasEdge predicate on the "info" edge with a given conditions (other predicates). @@ -596,47 +530,40 @@ func HasInfoWith(preds ...predicate.GroupInfo) predicate.Group { p(tr) } t.OutE(InfoLabel).Where(tr).OutV() - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.Group(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.Group(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Group) predicate.Group { - return predicate.Group( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.Group(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/groupinfo/where.go b/entc/integration/gremlin/ent/groupinfo/where.go index 2436b5438..77e8f9ae4 100644 --- a/entc/integration/gremlin/ent/groupinfo/where.go +++ b/entc/integration/gremlin/ent/groupinfo/where.go @@ -15,27 +15,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.GroupInfo { - return predicate.GroupInfo( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.GroupInfo(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -46,8 +42,7 @@ func IDIn(ids ...string) predicate.GroupInfo { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -58,72 +53,63 @@ func IDNotIn(ids ...string) predicate.GroupInfo { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // Desc applies equality check predicate on the "desc" field. It's identical to DescEQ. func Desc(v string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.EQ(v)) - }, - ) + }) } // MaxUsers applies equality check predicate on the "max_users" field. It's identical to MaxUsersEQ. func MaxUsers(v int) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.EQ(v)) - }, - ) + }) } // DescEQ applies the EQ predicate on the "desc" field. func DescEQ(v string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.EQ(v)) - }, - ) + }) } // DescNEQ applies the NEQ predicate on the "desc" field. func DescNEQ(v string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.NEQ(v)) - }, - ) + }) } // DescIn applies the In predicate on the "desc" field. @@ -134,8 +120,7 @@ func DescIn(vs ...string) predicate.GroupInfo { } return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.Within(v...)) - }, - ) + }) } // DescNotIn applies the NotIn predicate on the "desc" field. @@ -146,80 +131,70 @@ func DescNotIn(vs ...string) predicate.GroupInfo { } return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.Without(v...)) - }, - ) + }) } // DescGT applies the GT predicate on the "desc" field. func DescGT(v string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.GT(v)) - }, - ) + }) } // DescGTE applies the GTE predicate on the "desc" field. func DescGTE(v string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.GTE(v)) - }, - ) + }) } // DescLT applies the LT predicate on the "desc" field. func DescLT(v string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.LT(v)) - }, - ) + }) } // DescLTE applies the LTE predicate on the "desc" field. func DescLTE(v string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.LTE(v)) - }, - ) + }) } // DescContains applies the Contains predicate on the "desc" field. func DescContains(v string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.Containing(v)) - }, - ) + }) } // DescHasPrefix applies the HasPrefix predicate on the "desc" field. func DescHasPrefix(v string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.StartingWith(v)) - }, - ) + }) } // DescHasSuffix applies the HasSuffix predicate on the "desc" field. func DescHasSuffix(v string) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldDesc, p.EndingWith(v)) - }, - ) + }) } // MaxUsersEQ applies the EQ predicate on the "max_users" field. func MaxUsersEQ(v int) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.EQ(v)) - }, - ) + }) } // MaxUsersNEQ applies the NEQ predicate on the "max_users" field. func MaxUsersNEQ(v int) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.NEQ(v)) - }, - ) + }) } // MaxUsersIn applies the In predicate on the "max_users" field. @@ -230,8 +205,7 @@ func MaxUsersIn(vs ...int) predicate.GroupInfo { } return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.Within(v...)) - }, - ) + }) } // MaxUsersNotIn applies the NotIn predicate on the "max_users" field. @@ -242,48 +216,42 @@ func MaxUsersNotIn(vs ...int) predicate.GroupInfo { } return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.Without(v...)) - }, - ) + }) } // MaxUsersGT applies the GT predicate on the "max_users" field. func MaxUsersGT(v int) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.GT(v)) - }, - ) + }) } // MaxUsersGTE applies the GTE predicate on the "max_users" field. func MaxUsersGTE(v int) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.GTE(v)) - }, - ) + }) } // MaxUsersLT applies the LT predicate on the "max_users" field. func MaxUsersLT(v int) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.LT(v)) - }, - ) + }) } // MaxUsersLTE applies the LTE predicate on the "max_users" field. func MaxUsersLTE(v int) predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.Has(Label, FieldMaxUsers, p.LTE(v)) - }, - ) + }) } // HasGroups applies the HasEdge predicate on the "groups" edge. func HasGroups() predicate.GroupInfo { return predicate.GroupInfo(func(t *dsl.Traversal) { t.InE(GroupsInverseLabel).InV() - }, - ) + }) } // HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates). @@ -294,47 +262,40 @@ func HasGroupsWith(preds ...predicate.Group) predicate.GroupInfo { p(tr) } t.InE(GroupsInverseLabel).Where(tr).InV() - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.GroupInfo) predicate.GroupInfo { - return predicate.GroupInfo( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.GroupInfo(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.GroupInfo) predicate.GroupInfo { - return predicate.GroupInfo( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.GroupInfo(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.GroupInfo) predicate.GroupInfo { - return predicate.GroupInfo( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.GroupInfo(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/item/where.go b/entc/integration/gremlin/ent/item/where.go index 6862f92e8..c4298232f 100644 --- a/entc/integration/gremlin/ent/item/where.go +++ b/entc/integration/gremlin/ent/item/where.go @@ -15,27 +15,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Item { - return predicate.Item( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.Item(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.Item { return predicate.Item(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.Item { return predicate.Item(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -46,8 +42,7 @@ func IDIn(ids ...string) predicate.Item { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -58,79 +53,68 @@ func IDNotIn(ids ...string) predicate.Item { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.Item { return predicate.Item(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.Item { return predicate.Item(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.Item { return predicate.Item(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.Item { return predicate.Item(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Item) predicate.Item { - return predicate.Item( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.Item(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Item) predicate.Item { - return predicate.Item( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.Item(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Item) predicate.Item { - return predicate.Item( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.Item(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/node/where.go b/entc/integration/gremlin/ent/node/where.go index 39bc32474..b409b5366 100644 --- a/entc/integration/gremlin/ent/node/where.go +++ b/entc/integration/gremlin/ent/node/where.go @@ -15,27 +15,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Node { - return predicate.Node( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.Node(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -46,8 +42,7 @@ func IDIn(ids ...string) predicate.Node { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -58,64 +53,56 @@ func IDNotIn(ids ...string) predicate.Node { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // Value applies equality check predicate on the "value" field. It's identical to ValueEQ. func Value(v int) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.EQ(v)) - }, - ) + }) } // ValueEQ applies the EQ predicate on the "value" field. func ValueEQ(v int) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.EQ(v)) - }, - ) + }) } // ValueNEQ applies the NEQ predicate on the "value" field. func ValueNEQ(v int) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.NEQ(v)) - }, - ) + }) } // ValueIn applies the In predicate on the "value" field. @@ -126,8 +113,7 @@ func ValueIn(vs ...int) predicate.Node { } return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.Within(v...)) - }, - ) + }) } // ValueNotIn applies the NotIn predicate on the "value" field. @@ -138,64 +124,56 @@ func ValueNotIn(vs ...int) predicate.Node { } return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.Without(v...)) - }, - ) + }) } // ValueGT applies the GT predicate on the "value" field. func ValueGT(v int) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.GT(v)) - }, - ) + }) } // ValueGTE applies the GTE predicate on the "value" field. func ValueGTE(v int) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.GTE(v)) - }, - ) + }) } // ValueLT applies the LT predicate on the "value" field. func ValueLT(v int) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.LT(v)) - }, - ) + }) } // ValueLTE applies the LTE predicate on the "value" field. func ValueLTE(v int) predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.Has(Label, FieldValue, p.LTE(v)) - }, - ) + }) } // ValueIsNil applies the IsNil predicate on the "value" field. func ValueIsNil() predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldValue) - }, - ) + }) } // ValueNotNil applies the NotNil predicate on the "value" field. func ValueNotNil() predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldValue) - }, - ) + }) } // HasPrev applies the HasEdge predicate on the "prev" edge. func HasPrev() predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.InE(PrevInverseLabel).InV() - }, - ) + }) } // HasPrevWith applies the HasEdge predicate on the "prev" edge with a given conditions (other predicates). @@ -206,16 +184,14 @@ func HasPrevWith(preds ...predicate.Node) predicate.Node { p(tr) } t.InE(PrevInverseLabel).Where(tr).InV() - }, - ) + }) } // HasNext applies the HasEdge predicate on the "next" edge. func HasNext() predicate.Node { return predicate.Node(func(t *dsl.Traversal) { t.OutE(NextLabel).OutV() - }, - ) + }) } // HasNextWith applies the HasEdge predicate on the "next" edge with a given conditions (other predicates). @@ -226,47 +202,40 @@ func HasNextWith(preds ...predicate.Node) predicate.Node { p(tr) } t.OutE(NextLabel).Where(tr).OutV() - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Node) predicate.Node { - return predicate.Node( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.Node(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Node) predicate.Node { - return predicate.Node( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.Node(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Node) predicate.Node { - return predicate.Node( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.Node(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/pet/where.go b/entc/integration/gremlin/ent/pet/where.go index c31321a29..a996ef643 100644 --- a/entc/integration/gremlin/ent/pet/where.go +++ b/entc/integration/gremlin/ent/pet/where.go @@ -15,27 +15,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Pet { - return predicate.Pet( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.Pet(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -46,8 +42,7 @@ func IDIn(ids ...string) predicate.Pet { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -58,64 +53,56 @@ func IDNotIn(ids ...string) predicate.Pet { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.NEQ(v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -126,8 +113,7 @@ func NameIn(vs ...string) predicate.Pet { } return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -138,72 +124,63 @@ func NameNotIn(vs ...string) predicate.Pet { } return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GT(v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GTE(v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LT(v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LTE(v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Containing(v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.StartingWith(v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EndingWith(v)) - }, - ) + }) } // HasTeam applies the HasEdge predicate on the "team" edge. func HasTeam() predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.InE(TeamInverseLabel).InV() - }, - ) + }) } // HasTeamWith applies the HasEdge predicate on the "team" edge with a given conditions (other predicates). @@ -214,16 +191,14 @@ func HasTeamWith(preds ...predicate.User) predicate.Pet { p(tr) } t.InE(TeamInverseLabel).Where(tr).InV() - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. func HasOwner() predicate.Pet { return predicate.Pet(func(t *dsl.Traversal) { t.InE(OwnerInverseLabel).InV() - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -234,47 +209,40 @@ func HasOwnerWith(preds ...predicate.User) predicate.Pet { p(tr) } t.InE(OwnerInverseLabel).Where(tr).InV() - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.Pet(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.Pet(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Pet) predicate.Pet { - return predicate.Pet( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.Pet(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/spec/where.go b/entc/integration/gremlin/ent/spec/where.go index dcf9951a0..287300f0f 100644 --- a/entc/integration/gremlin/ent/spec/where.go +++ b/entc/integration/gremlin/ent/spec/where.go @@ -15,27 +15,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.Spec { - return predicate.Spec( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.Spec(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.Spec { return predicate.Spec(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.Spec { return predicate.Spec(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -46,8 +42,7 @@ func IDIn(ids ...string) predicate.Spec { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -58,48 +53,42 @@ func IDNotIn(ids ...string) predicate.Spec { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.Spec { return predicate.Spec(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.Spec { return predicate.Spec(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.Spec { return predicate.Spec(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.Spec { return predicate.Spec(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // HasCard applies the HasEdge predicate on the "card" edge. func HasCard() predicate.Spec { return predicate.Spec(func(t *dsl.Traversal) { t.OutE(CardLabel).OutV() - }, - ) + }) } // HasCardWith applies the HasEdge predicate on the "card" edge with a given conditions (other predicates). @@ -110,47 +99,40 @@ func HasCardWith(preds ...predicate.Card) predicate.Spec { p(tr) } t.OutE(CardLabel).Where(tr).OutV() - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Spec) predicate.Spec { - return predicate.Spec( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.Spec(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Spec) predicate.Spec { - return predicate.Spec( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.Spec(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Spec) predicate.Spec { - return predicate.Spec( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.Spec(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/gremlin/ent/user/where.go b/entc/integration/gremlin/ent/user/where.go index 699f9afa6..b1804c784 100644 --- a/entc/integration/gremlin/ent/user/where.go +++ b/entc/integration/gremlin/ent/user/where.go @@ -15,27 +15,23 @@ import ( // ID filters vertices based on their identifier. func ID(id string) predicate.User { - return predicate.User( - func(t *dsl.Traversal) { - t.HasID(id) - }, - ) + return predicate.User(func(t *dsl.Traversal) { + t.HasID(id) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasID(p.EQ(id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasID(p.NEQ(id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -46,8 +42,7 @@ func IDIn(ids ...string) predicate.User { v[i] = ids[i] } t.HasID(p.Within(v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -58,112 +53,98 @@ func IDNotIn(ids ...string) predicate.User { v[i] = ids[i] } t.HasID(p.Without(v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasID(p.GT(id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasID(p.GTE(id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasID(p.LT(id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasID(p.LTE(id)) - }, - ) + }) } // OptionalInt applies equality check predicate on the "optional_int" field. It's identical to OptionalIntEQ. func OptionalInt(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.EQ(v)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.EQ(v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // Last applies equality check predicate on the "last" field. It's identical to LastEQ. func Last(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.EQ(v)) - }, - ) + }) } // Nickname applies equality check predicate on the "nickname" field. It's identical to NicknameEQ. func Nickname(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.EQ(v)) - }, - ) + }) } // Phone applies equality check predicate on the "phone" field. It's identical to PhoneEQ. func Phone(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.EQ(v)) - }, - ) + }) } // Password applies equality check predicate on the "password" field. It's identical to PasswordEQ. func Password(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.EQ(v)) - }, - ) + }) } // OptionalIntEQ applies the EQ predicate on the "optional_int" field. func OptionalIntEQ(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.EQ(v)) - }, - ) + }) } // OptionalIntNEQ applies the NEQ predicate on the "optional_int" field. func OptionalIntNEQ(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.NEQ(v)) - }, - ) + }) } // OptionalIntIn applies the In predicate on the "optional_int" field. @@ -174,8 +155,7 @@ func OptionalIntIn(vs ...int) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.Within(v...)) - }, - ) + }) } // OptionalIntNotIn applies the NotIn predicate on the "optional_int" field. @@ -186,72 +166,63 @@ func OptionalIntNotIn(vs ...int) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.Without(v...)) - }, - ) + }) } // OptionalIntGT applies the GT predicate on the "optional_int" field. func OptionalIntGT(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.GT(v)) - }, - ) + }) } // OptionalIntGTE applies the GTE predicate on the "optional_int" field. func OptionalIntGTE(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.GTE(v)) - }, - ) + }) } // OptionalIntLT applies the LT predicate on the "optional_int" field. func OptionalIntLT(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.LT(v)) - }, - ) + }) } // OptionalIntLTE applies the LTE predicate on the "optional_int" field. func OptionalIntLTE(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldOptionalInt, p.LTE(v)) - }, - ) + }) } // OptionalIntIsNil applies the IsNil predicate on the "optional_int" field. func OptionalIntIsNil() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldOptionalInt) - }, - ) + }) } // OptionalIntNotNil applies the NotNil predicate on the "optional_int" field. func OptionalIntNotNil() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldOptionalInt) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.EQ(v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.NEQ(v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -262,8 +233,7 @@ func AgeIn(vs ...int) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.Within(v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -274,56 +244,49 @@ func AgeNotIn(vs ...int) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.Without(v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.GT(v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.GTE(v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.LT(v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldAge, p.LTE(v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EQ(v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.NEQ(v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -334,8 +297,7 @@ func NameIn(vs ...string) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Within(v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -346,80 +308,70 @@ func NameNotIn(vs ...string) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Without(v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GT(v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.GTE(v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LT(v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.LTE(v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.Containing(v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.StartingWith(v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldName, p.EndingWith(v)) - }, - ) + }) } // LastEQ applies the EQ predicate on the "last" field. func LastEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.EQ(v)) - }, - ) + }) } // LastNEQ applies the NEQ predicate on the "last" field. func LastNEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.NEQ(v)) - }, - ) + }) } // LastIn applies the In predicate on the "last" field. @@ -430,8 +382,7 @@ func LastIn(vs ...string) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.Within(v...)) - }, - ) + }) } // LastNotIn applies the NotIn predicate on the "last" field. @@ -442,80 +393,70 @@ func LastNotIn(vs ...string) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.Without(v...)) - }, - ) + }) } // LastGT applies the GT predicate on the "last" field. func LastGT(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.GT(v)) - }, - ) + }) } // LastGTE applies the GTE predicate on the "last" field. func LastGTE(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.GTE(v)) - }, - ) + }) } // LastLT applies the LT predicate on the "last" field. func LastLT(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.LT(v)) - }, - ) + }) } // LastLTE applies the LTE predicate on the "last" field. func LastLTE(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.LTE(v)) - }, - ) + }) } // LastContains applies the Contains predicate on the "last" field. func LastContains(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.Containing(v)) - }, - ) + }) } // LastHasPrefix applies the HasPrefix predicate on the "last" field. func LastHasPrefix(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.StartingWith(v)) - }, - ) + }) } // LastHasSuffix applies the HasSuffix predicate on the "last" field. func LastHasSuffix(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldLast, p.EndingWith(v)) - }, - ) + }) } // NicknameEQ applies the EQ predicate on the "nickname" field. func NicknameEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.EQ(v)) - }, - ) + }) } // NicknameNEQ applies the NEQ predicate on the "nickname" field. func NicknameNEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.NEQ(v)) - }, - ) + }) } // NicknameIn applies the In predicate on the "nickname" field. @@ -526,8 +467,7 @@ func NicknameIn(vs ...string) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.Within(v...)) - }, - ) + }) } // NicknameNotIn applies the NotIn predicate on the "nickname" field. @@ -538,96 +478,84 @@ func NicknameNotIn(vs ...string) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.Without(v...)) - }, - ) + }) } // NicknameGT applies the GT predicate on the "nickname" field. func NicknameGT(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.GT(v)) - }, - ) + }) } // NicknameGTE applies the GTE predicate on the "nickname" field. func NicknameGTE(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.GTE(v)) - }, - ) + }) } // NicknameLT applies the LT predicate on the "nickname" field. func NicknameLT(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.LT(v)) - }, - ) + }) } // NicknameLTE applies the LTE predicate on the "nickname" field. func NicknameLTE(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.LTE(v)) - }, - ) + }) } // NicknameContains applies the Contains predicate on the "nickname" field. func NicknameContains(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.Containing(v)) - }, - ) + }) } // NicknameHasPrefix applies the HasPrefix predicate on the "nickname" field. func NicknameHasPrefix(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.StartingWith(v)) - }, - ) + }) } // NicknameHasSuffix applies the HasSuffix predicate on the "nickname" field. func NicknameHasSuffix(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldNickname, p.EndingWith(v)) - }, - ) + }) } // NicknameIsNil applies the IsNil predicate on the "nickname" field. func NicknameIsNil() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldNickname) - }, - ) + }) } // NicknameNotNil applies the NotNil predicate on the "nickname" field. func NicknameNotNil() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldNickname) - }, - ) + }) } // PhoneEQ applies the EQ predicate on the "phone" field. func PhoneEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.EQ(v)) - }, - ) + }) } // PhoneNEQ applies the NEQ predicate on the "phone" field. func PhoneNEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.NEQ(v)) - }, - ) + }) } // PhoneIn applies the In predicate on the "phone" field. @@ -638,8 +566,7 @@ func PhoneIn(vs ...string) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.Within(v...)) - }, - ) + }) } // PhoneNotIn applies the NotIn predicate on the "phone" field. @@ -650,96 +577,84 @@ func PhoneNotIn(vs ...string) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.Without(v...)) - }, - ) + }) } // PhoneGT applies the GT predicate on the "phone" field. func PhoneGT(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.GT(v)) - }, - ) + }) } // PhoneGTE applies the GTE predicate on the "phone" field. func PhoneGTE(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.GTE(v)) - }, - ) + }) } // PhoneLT applies the LT predicate on the "phone" field. func PhoneLT(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.LT(v)) - }, - ) + }) } // PhoneLTE applies the LTE predicate on the "phone" field. func PhoneLTE(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.LTE(v)) - }, - ) + }) } // PhoneContains applies the Contains predicate on the "phone" field. func PhoneContains(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.Containing(v)) - }, - ) + }) } // PhoneHasPrefix applies the HasPrefix predicate on the "phone" field. func PhoneHasPrefix(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.StartingWith(v)) - }, - ) + }) } // PhoneHasSuffix applies the HasSuffix predicate on the "phone" field. func PhoneHasSuffix(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPhone, p.EndingWith(v)) - }, - ) + }) } // PhoneIsNil applies the IsNil predicate on the "phone" field. func PhoneIsNil() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldPhone) - }, - ) + }) } // PhoneNotNil applies the NotNil predicate on the "phone" field. func PhoneNotNil() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldPhone) - }, - ) + }) } // PasswordEQ applies the EQ predicate on the "password" field. func PasswordEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.EQ(v)) - }, - ) + }) } // PasswordNEQ applies the NEQ predicate on the "password" field. func PasswordNEQ(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.NEQ(v)) - }, - ) + }) } // PasswordIn applies the In predicate on the "password" field. @@ -750,8 +665,7 @@ func PasswordIn(vs ...string) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.Within(v...)) - }, - ) + }) } // PasswordNotIn applies the NotIn predicate on the "password" field. @@ -762,96 +676,84 @@ func PasswordNotIn(vs ...string) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.Without(v...)) - }, - ) + }) } // PasswordGT applies the GT predicate on the "password" field. func PasswordGT(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.GT(v)) - }, - ) + }) } // PasswordGTE applies the GTE predicate on the "password" field. func PasswordGTE(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.GTE(v)) - }, - ) + }) } // PasswordLT applies the LT predicate on the "password" field. func PasswordLT(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.LT(v)) - }, - ) + }) } // PasswordLTE applies the LTE predicate on the "password" field. func PasswordLTE(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.LTE(v)) - }, - ) + }) } // PasswordContains applies the Contains predicate on the "password" field. func PasswordContains(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.Containing(v)) - }, - ) + }) } // PasswordHasPrefix applies the HasPrefix predicate on the "password" field. func PasswordHasPrefix(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.StartingWith(v)) - }, - ) + }) } // PasswordHasSuffix applies the HasSuffix predicate on the "password" field. func PasswordHasSuffix(v string) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldPassword, p.EndingWith(v)) - }, - ) + }) } // PasswordIsNil applies the IsNil predicate on the "password" field. func PasswordIsNil() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasLabel(Label).HasNot(FieldPassword) - }, - ) + }) } // PasswordNotNil applies the NotNil predicate on the "password" field. func PasswordNotNil() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.HasLabel(Label).Has(FieldPassword) - }, - ) + }) } // RoleEQ applies the EQ predicate on the "role" field. func RoleEQ(v Role) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldRole, p.EQ(v)) - }, - ) + }) } // RoleNEQ applies the NEQ predicate on the "role" field. func RoleNEQ(v Role) predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldRole, p.NEQ(v)) - }, - ) + }) } // RoleIn applies the In predicate on the "role" field. @@ -862,8 +764,7 @@ func RoleIn(vs ...Role) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldRole, p.Within(v...)) - }, - ) + }) } // RoleNotIn applies the NotIn predicate on the "role" field. @@ -874,16 +775,14 @@ func RoleNotIn(vs ...Role) predicate.User { } return predicate.User(func(t *dsl.Traversal) { t.Has(Label, FieldRole, p.Without(v...)) - }, - ) + }) } // HasCard applies the HasEdge predicate on the "card" edge. func HasCard() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.OutE(CardLabel).OutV() - }, - ) + }) } // HasCardWith applies the HasEdge predicate on the "card" edge with a given conditions (other predicates). @@ -894,16 +793,14 @@ func HasCardWith(preds ...predicate.Card) predicate.User { p(tr) } t.OutE(CardLabel).Where(tr).OutV() - }, - ) + }) } // HasPets applies the HasEdge predicate on the "pets" edge. func HasPets() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.OutE(PetsLabel).OutV() - }, - ) + }) } // HasPetsWith applies the HasEdge predicate on the "pets" edge with a given conditions (other predicates). @@ -914,16 +811,14 @@ func HasPetsWith(preds ...predicate.Pet) predicate.User { p(tr) } t.OutE(PetsLabel).Where(tr).OutV() - }, - ) + }) } // HasFiles applies the HasEdge predicate on the "files" edge. func HasFiles() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.OutE(FilesLabel).OutV() - }, - ) + }) } // HasFilesWith applies the HasEdge predicate on the "files" edge with a given conditions (other predicates). @@ -934,16 +829,14 @@ func HasFilesWith(preds ...predicate.File) predicate.User { p(tr) } t.OutE(FilesLabel).Where(tr).OutV() - }, - ) + }) } // HasGroups applies the HasEdge predicate on the "groups" edge. func HasGroups() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.OutE(GroupsLabel).OutV() - }, - ) + }) } // HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates). @@ -954,16 +847,14 @@ func HasGroupsWith(preds ...predicate.Group) predicate.User { p(tr) } t.OutE(GroupsLabel).Where(tr).OutV() - }, - ) + }) } // HasFriends applies the HasEdge predicate on the "friends" edge. func HasFriends() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Both(FriendsLabel) - }, - ) + }) } // HasFriendsWith applies the HasEdge predicate on the "friends" edge with a given conditions (other predicates). @@ -980,16 +871,14 @@ func HasFriendsWith(preds ...predicate.User) predicate.User { __.InE(FriendsLabel).Where(out), ), ) - }, - ) + }) } // HasFollowers applies the HasEdge predicate on the "followers" edge. func HasFollowers() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.InE(FollowersInverseLabel).InV() - }, - ) + }) } // HasFollowersWith applies the HasEdge predicate on the "followers" edge with a given conditions (other predicates). @@ -1000,16 +889,14 @@ func HasFollowersWith(preds ...predicate.User) predicate.User { p(tr) } t.InE(FollowersInverseLabel).Where(tr).InV() - }, - ) + }) } // HasFollowing applies the HasEdge predicate on the "following" edge. func HasFollowing() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.OutE(FollowingLabel).OutV() - }, - ) + }) } // HasFollowingWith applies the HasEdge predicate on the "following" edge with a given conditions (other predicates). @@ -1020,16 +907,14 @@ func HasFollowingWith(preds ...predicate.User) predicate.User { p(tr) } t.OutE(FollowingLabel).Where(tr).OutV() - }, - ) + }) } // HasTeam applies the HasEdge predicate on the "team" edge. func HasTeam() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.OutE(TeamLabel).OutV() - }, - ) + }) } // HasTeamWith applies the HasEdge predicate on the "team" edge with a given conditions (other predicates). @@ -1040,16 +925,14 @@ func HasTeamWith(preds ...predicate.Pet) predicate.User { p(tr) } t.OutE(TeamLabel).Where(tr).OutV() - }, - ) + }) } // HasSpouse applies the HasEdge predicate on the "spouse" edge. func HasSpouse() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.Both(SpouseLabel) - }, - ) + }) } // HasSpouseWith applies the HasEdge predicate on the "spouse" edge with a given conditions (other predicates). @@ -1066,16 +949,14 @@ func HasSpouseWith(preds ...predicate.User) predicate.User { __.InE(SpouseLabel).Where(out), ), ) - }, - ) + }) } // HasChildren applies the HasEdge predicate on the "children" edge. func HasChildren() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.InE(ChildrenInverseLabel).InV() - }, - ) + }) } // HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). @@ -1086,16 +967,14 @@ func HasChildrenWith(preds ...predicate.User) predicate.User { p(tr) } t.InE(ChildrenInverseLabel).Where(tr).InV() - }, - ) + }) } // HasParent applies the HasEdge predicate on the "parent" edge. func HasParent() predicate.User { return predicate.User(func(t *dsl.Traversal) { t.OutE(ParentLabel).OutV() - }, - ) + }) } // HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). @@ -1106,47 +985,40 @@ func HasParentWith(preds ...predicate.User) predicate.User { p(tr) } t.OutE(ParentLabel).Where(tr).OutV() - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.And(trs...)) - }, - ) + return predicate.User(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.And(trs...)) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(tr *dsl.Traversal) { - trs := make([]interface{}, 0, len(predicates)) - for _, p := range predicates { - t := __.New() - p(t) - trs = append(trs, t) - } - tr.Where(__.Or(trs...)) - }, - ) + return predicate.User(func(tr *dsl.Traversal) { + trs := make([]interface{}, 0, len(predicates)) + for _, p := range predicates { + t := __.New() + p(t) + trs = append(trs, t) + } + tr.Where(__.Or(trs...)) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(tr *dsl.Traversal) { - t := __.New() - p(t) - tr.Where(__.Not(t)) - }, - ) + return predicate.User(func(tr *dsl.Traversal) { + t := __.New() + p(t) + tr.Where(__.Not(t)) + }) } diff --git a/entc/integration/idtype/ent/user/where.go b/entc/integration/idtype/ent/user/where.go index d26a29000..aa1fac566 100644 --- a/entc/integration/idtype/ent/user/where.go +++ b/entc/integration/idtype/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id uint64) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id uint64) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id uint64) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...uint64) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...uint64) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id uint64) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id uint64) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id uint64) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id uint64) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -143,8 +130,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -161,80 +147,70 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasSpouse applies the HasEdge predicate on the "spouse" edge. @@ -246,8 +222,7 @@ func HasSpouse() predicate.User { sqlgraph.Edge(sqlgraph.O2O, false, SpouseTable, SpouseColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasSpouseWith applies the HasEdge predicate on the "spouse" edge with a given conditions (other predicates). @@ -263,8 +238,7 @@ func HasSpouseWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasFollowers applies the HasEdge predicate on the "followers" edge. @@ -276,8 +250,7 @@ func HasFollowers() predicate.User { sqlgraph.Edge(sqlgraph.M2M, true, FollowersTable, FollowersPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFollowersWith applies the HasEdge predicate on the "followers" edge with a given conditions (other predicates). @@ -293,8 +266,7 @@ func HasFollowersWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasFollowing applies the HasEdge predicate on the "following" edge. @@ -306,8 +278,7 @@ func HasFollowing() predicate.User { sqlgraph.Edge(sqlgraph.M2M, false, FollowingTable, FollowingPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFollowingWith applies the HasEdge predicate on the "following" edge with a given conditions (other predicates). @@ -323,44 +294,37 @@ func HasFollowingWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/json/ent/user/where.go b/entc/integration/json/ent/user/where.go index 124991a6c..220815fcc 100644 --- a/entc/integration/json/ent/user/where.go +++ b/entc/integration/json/ent/user/where.go @@ -13,27 +13,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -50,8 +46,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -68,172 +63,149 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // URLIsNil applies the IsNil predicate on the "url" field. func URLIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldURL))) - }, - ) + }) } // URLNotNil applies the NotNil predicate on the "url" field. func URLNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldURL))) - }, - ) + }) } // RawIsNil applies the IsNil predicate on the "raw" field. func RawIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldRaw))) - }, - ) + }) } // RawNotNil applies the NotNil predicate on the "raw" field. func RawNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldRaw))) - }, - ) + }) } // DirsIsNil applies the IsNil predicate on the "dirs" field. func DirsIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldDirs))) - }, - ) + }) } // DirsNotNil applies the NotNil predicate on the "dirs" field. func DirsNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldDirs))) - }, - ) + }) } // IntsIsNil applies the IsNil predicate on the "ints" field. func IntsIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldInts))) - }, - ) + }) } // IntsNotNil applies the NotNil predicate on the "ints" field. func IntsNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldInts))) - }, - ) + }) } // FloatsIsNil applies the IsNil predicate on the "floats" field. func FloatsIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldFloats))) - }, - ) + }) } // FloatsNotNil applies the NotNil predicate on the "floats" field. func FloatsNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldFloats))) - }, - ) + }) } // StringsIsNil applies the IsNil predicate on the "strings" field. func StringsIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldStrings))) - }, - ) + }) } // StringsNotNil applies the NotNil predicate on the "strings" field. func StringsNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldStrings))) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/migrate/entv1/car/where.go b/entc/integration/migrate/entv1/car/where.go index 728adeb2d..19680098e 100644 --- a/entc/integration/migrate/entv1/car/where.go +++ b/entc/integration/migrate/entv1/car/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Car(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Car { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,40 +64,35 @@ func IDNotIn(ids ...int) predicate.Car { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. @@ -114,8 +104,7 @@ func HasOwner() predicate.Car { sqlgraph.Edge(sqlgraph.O2O, true, OwnerTable, OwnerColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -131,44 +120,37 @@ func HasOwnerWith(preds ...predicate.User) predicate.Car { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Car) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Car(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Car) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Car(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Car) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Car(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/migrate/entv1/user/where.go b/entc/integration/migrate/entv1/user/where.go index 344d8dc12..6070dd54e 100644 --- a/entc/integration/migrate/entv1/user/where.go +++ b/entc/integration/migrate/entv1/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,104 +64,91 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int32) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // Nickname applies equality check predicate on the "nickname" field. It's identical to NicknameEQ. func Nickname(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNickname), v)) - }, - ) + }) } // Address applies equality check predicate on the "address" field. It's identical to AddressEQ. func Address(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAddress), v)) - }, - ) + }) } // Renamed applies equality check predicate on the "renamed" field. It's identical to RenamedEQ. func Renamed(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldRenamed), v)) - }, - ) + }) } // Blob applies equality check predicate on the "blob" field. It's identical to BlobEQ. func Blob(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldBlob), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int32) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int32) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -183,8 +165,7 @@ func AgeIn(vs ...int32) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -201,56 +182,49 @@ func AgeNotIn(vs ...int32) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int32) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int32) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int32) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int32) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -267,8 +241,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -285,96 +258,84 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // NicknameEQ applies the EQ predicate on the "nickname" field. func NicknameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameNEQ applies the NEQ predicate on the "nickname" field. func NicknameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameIn applies the In predicate on the "nickname" field. @@ -391,8 +352,7 @@ func NicknameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldNickname), v...)) - }, - ) + }) } // NicknameNotIn applies the NotIn predicate on the "nickname" field. @@ -409,96 +369,84 @@ func NicknameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldNickname), v...)) - }, - ) + }) } // NicknameGT applies the GT predicate on the "nickname" field. func NicknameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameGTE applies the GTE predicate on the "nickname" field. func NicknameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameLT applies the LT predicate on the "nickname" field. func NicknameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameLTE applies the LTE predicate on the "nickname" field. func NicknameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameContains applies the Contains predicate on the "nickname" field. func NicknameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameHasPrefix applies the HasPrefix predicate on the "nickname" field. func NicknameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameHasSuffix applies the HasSuffix predicate on the "nickname" field. func NicknameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameEqualFold applies the EqualFold predicate on the "nickname" field. func NicknameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameContainsFold applies the ContainsFold predicate on the "nickname" field. func NicknameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldNickname), v)) - }, - ) + }) } // AddressEQ applies the EQ predicate on the "address" field. func AddressEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAddress), v)) - }, - ) + }) } // AddressNEQ applies the NEQ predicate on the "address" field. func AddressNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAddress), v)) - }, - ) + }) } // AddressIn applies the In predicate on the "address" field. @@ -515,8 +463,7 @@ func AddressIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldAddress), v...)) - }, - ) + }) } // AddressNotIn applies the NotIn predicate on the "address" field. @@ -533,112 +480,98 @@ func AddressNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAddress), v...)) - }, - ) + }) } // AddressGT applies the GT predicate on the "address" field. func AddressGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAddress), v)) - }, - ) + }) } // AddressGTE applies the GTE predicate on the "address" field. func AddressGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAddress), v)) - }, - ) + }) } // AddressLT applies the LT predicate on the "address" field. func AddressLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAddress), v)) - }, - ) + }) } // AddressLTE applies the LTE predicate on the "address" field. func AddressLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAddress), v)) - }, - ) + }) } // AddressContains applies the Contains predicate on the "address" field. func AddressContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldAddress), v)) - }, - ) + }) } // AddressHasPrefix applies the HasPrefix predicate on the "address" field. func AddressHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldAddress), v)) - }, - ) + }) } // AddressHasSuffix applies the HasSuffix predicate on the "address" field. func AddressHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldAddress), v)) - }, - ) + }) } // AddressIsNil applies the IsNil predicate on the "address" field. func AddressIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldAddress))) - }, - ) + }) } // AddressNotNil applies the NotNil predicate on the "address" field. func AddressNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldAddress))) - }, - ) + }) } // AddressEqualFold applies the EqualFold predicate on the "address" field. func AddressEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldAddress), v)) - }, - ) + }) } // AddressContainsFold applies the ContainsFold predicate on the "address" field. func AddressContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldAddress), v)) - }, - ) + }) } // RenamedEQ applies the EQ predicate on the "renamed" field. func RenamedEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldRenamed), v)) - }, - ) + }) } // RenamedNEQ applies the NEQ predicate on the "renamed" field. func RenamedNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldRenamed), v)) - }, - ) + }) } // RenamedIn applies the In predicate on the "renamed" field. @@ -655,8 +588,7 @@ func RenamedIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldRenamed), v...)) - }, - ) + }) } // RenamedNotIn applies the NotIn predicate on the "renamed" field. @@ -673,112 +605,98 @@ func RenamedNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldRenamed), v...)) - }, - ) + }) } // RenamedGT applies the GT predicate on the "renamed" field. func RenamedGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldRenamed), v)) - }, - ) + }) } // RenamedGTE applies the GTE predicate on the "renamed" field. func RenamedGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldRenamed), v)) - }, - ) + }) } // RenamedLT applies the LT predicate on the "renamed" field. func RenamedLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldRenamed), v)) - }, - ) + }) } // RenamedLTE applies the LTE predicate on the "renamed" field. func RenamedLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldRenamed), v)) - }, - ) + }) } // RenamedContains applies the Contains predicate on the "renamed" field. func RenamedContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldRenamed), v)) - }, - ) + }) } // RenamedHasPrefix applies the HasPrefix predicate on the "renamed" field. func RenamedHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldRenamed), v)) - }, - ) + }) } // RenamedHasSuffix applies the HasSuffix predicate on the "renamed" field. func RenamedHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldRenamed), v)) - }, - ) + }) } // RenamedIsNil applies the IsNil predicate on the "renamed" field. func RenamedIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldRenamed))) - }, - ) + }) } // RenamedNotNil applies the NotNil predicate on the "renamed" field. func RenamedNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldRenamed))) - }, - ) + }) } // RenamedEqualFold applies the EqualFold predicate on the "renamed" field. func RenamedEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldRenamed), v)) - }, - ) + }) } // RenamedContainsFold applies the ContainsFold predicate on the "renamed" field. func RenamedContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldRenamed), v)) - }, - ) + }) } // BlobEQ applies the EQ predicate on the "blob" field. func BlobEQ(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldBlob), v)) - }, - ) + }) } // BlobNEQ applies the NEQ predicate on the "blob" field. func BlobNEQ(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldBlob), v)) - }, - ) + }) } // BlobIn applies the In predicate on the "blob" field. @@ -795,8 +713,7 @@ func BlobIn(vs ...[]byte) predicate.User { return } s.Where(sql.In(s.C(FieldBlob), v...)) - }, - ) + }) } // BlobNotIn applies the NotIn predicate on the "blob" field. @@ -813,72 +730,63 @@ func BlobNotIn(vs ...[]byte) predicate.User { return } s.Where(sql.NotIn(s.C(FieldBlob), v...)) - }, - ) + }) } // BlobGT applies the GT predicate on the "blob" field. func BlobGT(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldBlob), v)) - }, - ) + }) } // BlobGTE applies the GTE predicate on the "blob" field. func BlobGTE(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldBlob), v)) - }, - ) + }) } // BlobLT applies the LT predicate on the "blob" field. func BlobLT(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldBlob), v)) - }, - ) + }) } // BlobLTE applies the LTE predicate on the "blob" field. func BlobLTE(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldBlob), v)) - }, - ) + }) } // BlobIsNil applies the IsNil predicate on the "blob" field. func BlobIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldBlob))) - }, - ) + }) } // BlobNotNil applies the NotNil predicate on the "blob" field. func BlobNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldBlob))) - }, - ) + }) } // StateEQ applies the EQ predicate on the "state" field. func StateEQ(v State) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldState), v)) - }, - ) + }) } // StateNEQ applies the NEQ predicate on the "state" field. func StateNEQ(v State) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldState), v)) - }, - ) + }) } // StateIn applies the In predicate on the "state" field. @@ -895,8 +803,7 @@ func StateIn(vs ...State) predicate.User { return } s.Where(sql.In(s.C(FieldState), v...)) - }, - ) + }) } // StateNotIn applies the NotIn predicate on the "state" field. @@ -913,24 +820,21 @@ func StateNotIn(vs ...State) predicate.User { return } s.Where(sql.NotIn(s.C(FieldState), v...)) - }, - ) + }) } // StateIsNil applies the IsNil predicate on the "state" field. func StateIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldState))) - }, - ) + }) } // StateNotNil applies the NotNil predicate on the "state" field. func StateNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldState))) - }, - ) + }) } // HasParent applies the HasEdge predicate on the "parent" edge. @@ -942,8 +846,7 @@ func HasParent() predicate.User { sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). @@ -959,8 +862,7 @@ func HasParentWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasChildren applies the HasEdge predicate on the "children" edge. @@ -972,8 +874,7 @@ func HasChildren() predicate.User { sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). @@ -989,8 +890,7 @@ func HasChildrenWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasSpouse applies the HasEdge predicate on the "spouse" edge. @@ -1002,8 +902,7 @@ func HasSpouse() predicate.User { sqlgraph.Edge(sqlgraph.O2O, false, SpouseTable, SpouseColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasSpouseWith applies the HasEdge predicate on the "spouse" edge with a given conditions (other predicates). @@ -1019,8 +918,7 @@ func HasSpouseWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasCar applies the HasEdge predicate on the "car" edge. @@ -1032,8 +930,7 @@ func HasCar() predicate.User { sqlgraph.Edge(sqlgraph.O2O, false, CarTable, CarColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasCarWith applies the HasEdge predicate on the "car" edge with a given conditions (other predicates). @@ -1049,44 +946,37 @@ func HasCarWith(preds ...predicate.Car) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/migrate/entv2/car/where.go b/entc/integration/migrate/entv2/car/where.go index 06149006a..71142ba59 100644 --- a/entc/integration/migrate/entv2/car/where.go +++ b/entc/integration/migrate/entv2/car/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Car(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Car { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,40 +64,35 @@ func IDNotIn(ids ...int) predicate.Car { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. @@ -114,8 +104,7 @@ func HasOwner() predicate.Car { sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -131,44 +120,37 @@ func HasOwnerWith(preds ...predicate.User) predicate.Car { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Car) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Car(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Car) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Car(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Car) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Car(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/migrate/entv2/group/where.go b/entc/integration/migrate/entv2/group/where.go index c117a0ec4..41af22c84 100644 --- a/entc/integration/migrate/entv2/group/where.go +++ b/entc/integration/migrate/entv2/group/where.go @@ -13,27 +13,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -50,8 +46,7 @@ func IDIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -68,76 +63,65 @@ func IDNotIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/migrate/entv2/pet/where.go b/entc/integration/migrate/entv2/pet/where.go index f74e76273..a67bb4810 100644 --- a/entc/integration/migrate/entv2/pet/where.go +++ b/entc/integration/migrate/entv2/pet/where.go @@ -13,27 +13,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -50,8 +46,7 @@ func IDIn(ids ...int) predicate.Pet { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -68,76 +63,65 @@ func IDNotIn(ids ...int) predicate.Pet { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Pet(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/migrate/entv2/user/where.go b/entc/integration/migrate/entv2/user/where.go index 270f9238d..a12290ac5 100644 --- a/entc/integration/migrate/entv2/user/where.go +++ b/entc/integration/migrate/entv2/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,120 +64,105 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // Nickname applies equality check predicate on the "nickname" field. It's identical to NicknameEQ. func Nickname(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNickname), v)) - }, - ) + }) } // Phone applies equality check predicate on the "phone" field. It's identical to PhoneEQ. func Phone(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldPhone), v)) - }, - ) + }) } // Buffer applies equality check predicate on the "buffer" field. It's identical to BufferEQ. func Buffer(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldBuffer), v)) - }, - ) + }) } // Title applies equality check predicate on the "title" field. It's identical to TitleEQ. func Title(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldTitle), v)) - }, - ) + }) } // NewName applies equality check predicate on the "new_name" field. It's identical to NewNameEQ. func NewName(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNewName), v)) - }, - ) + }) } // Blob applies equality check predicate on the "blob" field. It's identical to BlobEQ. func Blob(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldBlob), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -199,8 +179,7 @@ func AgeIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -217,56 +196,49 @@ func AgeNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -283,8 +255,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -301,96 +272,84 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // NicknameEQ applies the EQ predicate on the "nickname" field. func NicknameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameNEQ applies the NEQ predicate on the "nickname" field. func NicknameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameIn applies the In predicate on the "nickname" field. @@ -407,8 +366,7 @@ func NicknameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldNickname), v...)) - }, - ) + }) } // NicknameNotIn applies the NotIn predicate on the "nickname" field. @@ -425,96 +383,84 @@ func NicknameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldNickname), v...)) - }, - ) + }) } // NicknameGT applies the GT predicate on the "nickname" field. func NicknameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameGTE applies the GTE predicate on the "nickname" field. func NicknameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameLT applies the LT predicate on the "nickname" field. func NicknameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameLTE applies the LTE predicate on the "nickname" field. func NicknameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameContains applies the Contains predicate on the "nickname" field. func NicknameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameHasPrefix applies the HasPrefix predicate on the "nickname" field. func NicknameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameHasSuffix applies the HasSuffix predicate on the "nickname" field. func NicknameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameEqualFold applies the EqualFold predicate on the "nickname" field. func NicknameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldNickname), v)) - }, - ) + }) } // NicknameContainsFold applies the ContainsFold predicate on the "nickname" field. func NicknameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldNickname), v)) - }, - ) + }) } // PhoneEQ applies the EQ predicate on the "phone" field. func PhoneEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneNEQ applies the NEQ predicate on the "phone" field. func PhoneNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneIn applies the In predicate on the "phone" field. @@ -531,8 +477,7 @@ func PhoneIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldPhone), v...)) - }, - ) + }) } // PhoneNotIn applies the NotIn predicate on the "phone" field. @@ -549,96 +494,84 @@ func PhoneNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldPhone), v...)) - }, - ) + }) } // PhoneGT applies the GT predicate on the "phone" field. func PhoneGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneGTE applies the GTE predicate on the "phone" field. func PhoneGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneLT applies the LT predicate on the "phone" field. func PhoneLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneLTE applies the LTE predicate on the "phone" field. func PhoneLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneContains applies the Contains predicate on the "phone" field. func PhoneContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneHasPrefix applies the HasPrefix predicate on the "phone" field. func PhoneHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneHasSuffix applies the HasSuffix predicate on the "phone" field. func PhoneHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneEqualFold applies the EqualFold predicate on the "phone" field. func PhoneEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldPhone), v)) - }, - ) + }) } // PhoneContainsFold applies the ContainsFold predicate on the "phone" field. func PhoneContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldPhone), v)) - }, - ) + }) } // BufferEQ applies the EQ predicate on the "buffer" field. func BufferEQ(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldBuffer), v)) - }, - ) + }) } // BufferNEQ applies the NEQ predicate on the "buffer" field. func BufferNEQ(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldBuffer), v)) - }, - ) + }) } // BufferIn applies the In predicate on the "buffer" field. @@ -655,8 +588,7 @@ func BufferIn(vs ...[]byte) predicate.User { return } s.Where(sql.In(s.C(FieldBuffer), v...)) - }, - ) + }) } // BufferNotIn applies the NotIn predicate on the "buffer" field. @@ -673,72 +605,63 @@ func BufferNotIn(vs ...[]byte) predicate.User { return } s.Where(sql.NotIn(s.C(FieldBuffer), v...)) - }, - ) + }) } // BufferGT applies the GT predicate on the "buffer" field. func BufferGT(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldBuffer), v)) - }, - ) + }) } // BufferGTE applies the GTE predicate on the "buffer" field. func BufferGTE(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldBuffer), v)) - }, - ) + }) } // BufferLT applies the LT predicate on the "buffer" field. func BufferLT(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldBuffer), v)) - }, - ) + }) } // BufferLTE applies the LTE predicate on the "buffer" field. func BufferLTE(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldBuffer), v)) - }, - ) + }) } // BufferIsNil applies the IsNil predicate on the "buffer" field. func BufferIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldBuffer))) - }, - ) + }) } // BufferNotNil applies the NotNil predicate on the "buffer" field. func BufferNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldBuffer))) - }, - ) + }) } // TitleEQ applies the EQ predicate on the "title" field. func TitleEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldTitle), v)) - }, - ) + }) } // TitleNEQ applies the NEQ predicate on the "title" field. func TitleNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldTitle), v)) - }, - ) + }) } // TitleIn applies the In predicate on the "title" field. @@ -755,8 +678,7 @@ func TitleIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldTitle), v...)) - }, - ) + }) } // TitleNotIn applies the NotIn predicate on the "title" field. @@ -773,96 +695,84 @@ func TitleNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldTitle), v...)) - }, - ) + }) } // TitleGT applies the GT predicate on the "title" field. func TitleGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldTitle), v)) - }, - ) + }) } // TitleGTE applies the GTE predicate on the "title" field. func TitleGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldTitle), v)) - }, - ) + }) } // TitleLT applies the LT predicate on the "title" field. func TitleLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldTitle), v)) - }, - ) + }) } // TitleLTE applies the LTE predicate on the "title" field. func TitleLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldTitle), v)) - }, - ) + }) } // TitleContains applies the Contains predicate on the "title" field. func TitleContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldTitle), v)) - }, - ) + }) } // TitleHasPrefix applies the HasPrefix predicate on the "title" field. func TitleHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldTitle), v)) - }, - ) + }) } // TitleHasSuffix applies the HasSuffix predicate on the "title" field. func TitleHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldTitle), v)) - }, - ) + }) } // TitleEqualFold applies the EqualFold predicate on the "title" field. func TitleEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldTitle), v)) - }, - ) + }) } // TitleContainsFold applies the ContainsFold predicate on the "title" field. func TitleContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldTitle), v)) - }, - ) + }) } // NewNameEQ applies the EQ predicate on the "new_name" field. func NewNameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNewName), v)) - }, - ) + }) } // NewNameNEQ applies the NEQ predicate on the "new_name" field. func NewNameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNewName), v)) - }, - ) + }) } // NewNameIn applies the In predicate on the "new_name" field. @@ -879,8 +789,7 @@ func NewNameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldNewName), v...)) - }, - ) + }) } // NewNameNotIn applies the NotIn predicate on the "new_name" field. @@ -897,112 +806,98 @@ func NewNameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldNewName), v...)) - }, - ) + }) } // NewNameGT applies the GT predicate on the "new_name" field. func NewNameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNewName), v)) - }, - ) + }) } // NewNameGTE applies the GTE predicate on the "new_name" field. func NewNameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNewName), v)) - }, - ) + }) } // NewNameLT applies the LT predicate on the "new_name" field. func NewNameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNewName), v)) - }, - ) + }) } // NewNameLTE applies the LTE predicate on the "new_name" field. func NewNameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNewName), v)) - }, - ) + }) } // NewNameContains applies the Contains predicate on the "new_name" field. func NewNameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldNewName), v)) - }, - ) + }) } // NewNameHasPrefix applies the HasPrefix predicate on the "new_name" field. func NewNameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldNewName), v)) - }, - ) + }) } // NewNameHasSuffix applies the HasSuffix predicate on the "new_name" field. func NewNameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldNewName), v)) - }, - ) + }) } // NewNameIsNil applies the IsNil predicate on the "new_name" field. func NewNameIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldNewName))) - }, - ) + }) } // NewNameNotNil applies the NotNil predicate on the "new_name" field. func NewNameNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldNewName))) - }, - ) + }) } // NewNameEqualFold applies the EqualFold predicate on the "new_name" field. func NewNameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldNewName), v)) - }, - ) + }) } // NewNameContainsFold applies the ContainsFold predicate on the "new_name" field. func NewNameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldNewName), v)) - }, - ) + }) } // BlobEQ applies the EQ predicate on the "blob" field. func BlobEQ(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldBlob), v)) - }, - ) + }) } // BlobNEQ applies the NEQ predicate on the "blob" field. func BlobNEQ(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldBlob), v)) - }, - ) + }) } // BlobIn applies the In predicate on the "blob" field. @@ -1019,8 +914,7 @@ func BlobIn(vs ...[]byte) predicate.User { return } s.Where(sql.In(s.C(FieldBlob), v...)) - }, - ) + }) } // BlobNotIn applies the NotIn predicate on the "blob" field. @@ -1037,72 +931,63 @@ func BlobNotIn(vs ...[]byte) predicate.User { return } s.Where(sql.NotIn(s.C(FieldBlob), v...)) - }, - ) + }) } // BlobGT applies the GT predicate on the "blob" field. func BlobGT(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldBlob), v)) - }, - ) + }) } // BlobGTE applies the GTE predicate on the "blob" field. func BlobGTE(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldBlob), v)) - }, - ) + }) } // BlobLT applies the LT predicate on the "blob" field. func BlobLT(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldBlob), v)) - }, - ) + }) } // BlobLTE applies the LTE predicate on the "blob" field. func BlobLTE(v []byte) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldBlob), v)) - }, - ) + }) } // BlobIsNil applies the IsNil predicate on the "blob" field. func BlobIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldBlob))) - }, - ) + }) } // BlobNotNil applies the NotNil predicate on the "blob" field. func BlobNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldBlob))) - }, - ) + }) } // StateEQ applies the EQ predicate on the "state" field. func StateEQ(v State) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldState), v)) - }, - ) + }) } // StateNEQ applies the NEQ predicate on the "state" field. func StateNEQ(v State) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldState), v)) - }, - ) + }) } // StateIn applies the In predicate on the "state" field. @@ -1119,8 +1004,7 @@ func StateIn(vs ...State) predicate.User { return } s.Where(sql.In(s.C(FieldState), v...)) - }, - ) + }) } // StateNotIn applies the NotIn predicate on the "state" field. @@ -1137,24 +1021,21 @@ func StateNotIn(vs ...State) predicate.User { return } s.Where(sql.NotIn(s.C(FieldState), v...)) - }, - ) + }) } // StateIsNil applies the IsNil predicate on the "state" field. func StateIsNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldState))) - }, - ) + }) } // StateNotNil applies the NotNil predicate on the "state" field. func StateNotNil() predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldState))) - }, - ) + }) } // HasCar applies the HasEdge predicate on the "car" edge. @@ -1166,8 +1047,7 @@ func HasCar() predicate.User { sqlgraph.Edge(sqlgraph.O2M, false, CarTable, CarColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasCarWith applies the HasEdge predicate on the "car" edge with a given conditions (other predicates). @@ -1183,8 +1063,7 @@ func HasCarWith(preds ...predicate.Car) predicate.User { p(s) } }) - }, - ) + }) } // HasPets applies the HasEdge predicate on the "pets" edge. @@ -1196,8 +1075,7 @@ func HasPets() predicate.User { sqlgraph.Edge(sqlgraph.M2O, false, PetsTable, PetsColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasPetsWith applies the HasEdge predicate on the "pets" edge with a given conditions (other predicates). @@ -1213,44 +1091,37 @@ func HasPetsWith(preds ...predicate.Pet) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/template/ent/group/where.go b/entc/integration/template/ent/group/where.go index 607279106..d26c77b85 100644 --- a/entc/integration/template/ent/group/where.go +++ b/entc/integration/template/ent/group/where.go @@ -13,27 +13,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -50,8 +46,7 @@ func IDIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -68,64 +63,56 @@ func IDNotIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // MaxUsers applies equality check predicate on the "max_users" field. It's identical to MaxUsersEQ. func MaxUsers(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersEQ applies the EQ predicate on the "max_users" field. func MaxUsersEQ(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersNEQ applies the NEQ predicate on the "max_users" field. func MaxUsersNEQ(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersIn applies the In predicate on the "max_users" field. @@ -142,8 +129,7 @@ func MaxUsersIn(vs ...int) predicate.Group { return } s.Where(sql.In(s.C(FieldMaxUsers), v...)) - }, - ) + }) } // MaxUsersNotIn applies the NotIn predicate on the "max_users" field. @@ -160,76 +146,65 @@ func MaxUsersNotIn(vs ...int) predicate.Group { return } s.Where(sql.NotIn(s.C(FieldMaxUsers), v...)) - }, - ) + }) } // MaxUsersGT applies the GT predicate on the "max_users" field. func MaxUsersGT(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersGTE applies the GTE predicate on the "max_users" field. func MaxUsersGTE(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersLT applies the LT predicate on the "max_users" field. func MaxUsersLT(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldMaxUsers), v)) - }, - ) + }) } // MaxUsersLTE applies the LTE predicate on the "max_users" field. func MaxUsersLTE(v int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldMaxUsers), v)) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/template/ent/pet/where.go b/entc/integration/template/ent/pet/where.go index 1f9705194..c7ad14a50 100644 --- a/entc/integration/template/ent/pet/where.go +++ b/entc/integration/template/ent/pet/where.go @@ -16,27 +16,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -53,8 +49,7 @@ func IDIn(ids ...int) predicate.Pet { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -71,72 +66,63 @@ func IDNotIn(ids ...int) predicate.Pet { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // LicensedAt applies equality check predicate on the "licensed_at" field. It's identical to LicensedAtEQ. func LicensedAt(v time.Time) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldLicensedAt), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -153,8 +139,7 @@ func AgeIn(vs ...int) predicate.Pet { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -171,56 +156,49 @@ func AgeNotIn(vs ...int) predicate.Pet { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // LicensedAtEQ applies the EQ predicate on the "licensed_at" field. func LicensedAtEQ(v time.Time) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldLicensedAt), v)) - }, - ) + }) } // LicensedAtNEQ applies the NEQ predicate on the "licensed_at" field. func LicensedAtNEQ(v time.Time) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldLicensedAt), v)) - }, - ) + }) } // LicensedAtIn applies the In predicate on the "licensed_at" field. @@ -237,8 +215,7 @@ func LicensedAtIn(vs ...time.Time) predicate.Pet { return } s.Where(sql.In(s.C(FieldLicensedAt), v...)) - }, - ) + }) } // LicensedAtNotIn applies the NotIn predicate on the "licensed_at" field. @@ -255,56 +232,49 @@ func LicensedAtNotIn(vs ...time.Time) predicate.Pet { return } s.Where(sql.NotIn(s.C(FieldLicensedAt), v...)) - }, - ) + }) } // LicensedAtGT applies the GT predicate on the "licensed_at" field. func LicensedAtGT(v time.Time) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldLicensedAt), v)) - }, - ) + }) } // LicensedAtGTE applies the GTE predicate on the "licensed_at" field. func LicensedAtGTE(v time.Time) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldLicensedAt), v)) - }, - ) + }) } // LicensedAtLT applies the LT predicate on the "licensed_at" field. func LicensedAtLT(v time.Time) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldLicensedAt), v)) - }, - ) + }) } // LicensedAtLTE applies the LTE predicate on the "licensed_at" field. func LicensedAtLTE(v time.Time) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldLicensedAt), v)) - }, - ) + }) } // LicensedAtIsNil applies the IsNil predicate on the "licensed_at" field. func LicensedAtIsNil() predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.IsNull(s.C(FieldLicensedAt))) - }, - ) + }) } // LicensedAtNotNil applies the NotNil predicate on the "licensed_at" field. func LicensedAtNotNil() predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.NotNull(s.C(FieldLicensedAt))) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. @@ -316,8 +286,7 @@ func HasOwner() predicate.Pet { sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -333,44 +302,37 @@ func HasOwnerWith(preds ...predicate.User) predicate.Pet { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Pet(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/entc/integration/template/ent/user/where.go b/entc/integration/template/ent/user/where.go index 7d8e17614..71aae5a1b 100644 --- a/entc/integration/template/ent/user/where.go +++ b/entc/integration/template/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -143,8 +130,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -161,80 +147,70 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasPets applies the HasEdge predicate on the "pets" edge. @@ -246,8 +222,7 @@ func HasPets() predicate.User { sqlgraph.Edge(sqlgraph.O2M, false, PetsTable, PetsColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasPetsWith applies the HasEdge predicate on the "pets" edge with a given conditions (other predicates). @@ -263,8 +238,7 @@ func HasPetsWith(preds ...predicate.Pet) predicate.User { p(s) } }) - }, - ) + }) } // HasFriends applies the HasEdge predicate on the "friends" edge. @@ -276,8 +250,7 @@ func HasFriends() predicate.User { sqlgraph.Edge(sqlgraph.M2M, false, FriendsTable, FriendsPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFriendsWith applies the HasEdge predicate on the "friends" edge with a given conditions (other predicates). @@ -293,44 +266,37 @@ func HasFriendsWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/edgeindex/ent/city/where.go b/examples/edgeindex/ent/city/where.go index 5201ebadb..a3e940975 100644 --- a/examples/edgeindex/ent/city/where.go +++ b/examples/edgeindex/ent/city/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.City { - return predicate.City( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.City(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.City { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...int) predicate.City { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -143,8 +130,7 @@ func NameIn(vs ...string) predicate.City { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -161,80 +147,70 @@ func NameNotIn(vs ...string) predicate.City { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.City { return predicate.City(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasStreets applies the HasEdge predicate on the "streets" edge. @@ -246,8 +222,7 @@ func HasStreets() predicate.City { sqlgraph.Edge(sqlgraph.O2M, false, StreetsTable, StreetsColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasStreetsWith applies the HasEdge predicate on the "streets" edge with a given conditions (other predicates). @@ -263,44 +238,37 @@ func HasStreetsWith(preds ...predicate.Street) predicate.City { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.City) predicate.City { - return predicate.City( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.City(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.City) predicate.City { - return predicate.City( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.City(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.City) predicate.City { - return predicate.City( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.City(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/edgeindex/ent/street/where.go b/examples/edgeindex/ent/street/where.go index 303fb681a..2c9875bfc 100644 --- a/examples/edgeindex/ent/street/where.go +++ b/examples/edgeindex/ent/street/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Street { - return predicate.Street( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Street(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Street { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...int) predicate.Street { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -143,8 +130,7 @@ func NameIn(vs ...string) predicate.Street { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -161,80 +147,70 @@ func NameNotIn(vs ...string) predicate.Street { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.Street { return predicate.Street(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasCity applies the HasEdge predicate on the "city" edge. @@ -246,8 +222,7 @@ func HasCity() predicate.Street { sqlgraph.Edge(sqlgraph.M2O, true, CityTable, CityColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasCityWith applies the HasEdge predicate on the "city" edge with a given conditions (other predicates). @@ -263,44 +238,37 @@ func HasCityWith(preds ...predicate.City) predicate.Street { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Street) predicate.Street { - return predicate.Street( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Street(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Street) predicate.Street { - return predicate.Street( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Street(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Street) predicate.Street { - return predicate.Street( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Street(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/entcpkg/ent/user/where.go b/examples/entcpkg/ent/user/where.go index b22dc735b..571952e73 100644 --- a/examples/entcpkg/ent/user/where.go +++ b/examples/entcpkg/ent/user/where.go @@ -13,27 +13,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -50,8 +46,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -68,76 +63,65 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/m2m2types/ent/group/where.go b/examples/m2m2types/ent/group/where.go index 147e54c18..fd2855bd8 100644 --- a/examples/m2m2types/ent/group/where.go +++ b/examples/m2m2types/ent/group/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -143,8 +130,7 @@ func NameIn(vs ...string) predicate.Group { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -161,80 +147,70 @@ func NameNotIn(vs ...string) predicate.Group { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasUsers applies the HasEdge predicate on the "users" edge. @@ -246,8 +222,7 @@ func HasUsers() predicate.Group { sqlgraph.Edge(sqlgraph.M2M, false, UsersTable, UsersPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates). @@ -263,44 +238,37 @@ func HasUsersWith(preds ...predicate.User) predicate.Group { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/m2m2types/ent/user/where.go b/examples/m2m2types/ent/user/where.go index 5af14375a..174961a2c 100644 --- a/examples/m2m2types/ent/user/where.go +++ b/examples/m2m2types/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,72 +64,63 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -151,8 +137,7 @@ func AgeIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -169,56 +154,49 @@ func AgeNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -235,8 +213,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -253,80 +230,70 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasGroups applies the HasEdge predicate on the "groups" edge. @@ -338,8 +305,7 @@ func HasGroups() predicate.User { sqlgraph.Edge(sqlgraph.M2M, true, GroupsTable, GroupsPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates). @@ -355,44 +321,37 @@ func HasGroupsWith(preds ...predicate.Group) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/m2mbidi/ent/user/where.go b/examples/m2mbidi/ent/user/where.go index eb493f515..36fa96485 100644 --- a/examples/m2mbidi/ent/user/where.go +++ b/examples/m2mbidi/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,72 +64,63 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -151,8 +137,7 @@ func AgeIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -169,56 +154,49 @@ func AgeNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -235,8 +213,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -253,80 +230,70 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasFriends applies the HasEdge predicate on the "friends" edge. @@ -338,8 +305,7 @@ func HasFriends() predicate.User { sqlgraph.Edge(sqlgraph.M2M, false, FriendsTable, FriendsPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFriendsWith applies the HasEdge predicate on the "friends" edge with a given conditions (other predicates). @@ -355,44 +321,37 @@ func HasFriendsWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/m2mrecur/ent/user/where.go b/examples/m2mrecur/ent/user/where.go index 839646043..18b3b3849 100644 --- a/examples/m2mrecur/ent/user/where.go +++ b/examples/m2mrecur/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,72 +64,63 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -151,8 +137,7 @@ func AgeIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -169,56 +154,49 @@ func AgeNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -235,8 +213,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -253,80 +230,70 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasFollowers applies the HasEdge predicate on the "followers" edge. @@ -338,8 +305,7 @@ func HasFollowers() predicate.User { sqlgraph.Edge(sqlgraph.M2M, true, FollowersTable, FollowersPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFollowersWith applies the HasEdge predicate on the "followers" edge with a given conditions (other predicates). @@ -355,8 +321,7 @@ func HasFollowersWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasFollowing applies the HasEdge predicate on the "following" edge. @@ -368,8 +333,7 @@ func HasFollowing() predicate.User { sqlgraph.Edge(sqlgraph.M2M, false, FollowingTable, FollowingPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFollowingWith applies the HasEdge predicate on the "following" edge with a given conditions (other predicates). @@ -385,44 +349,37 @@ func HasFollowingWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/o2m2types/ent/pet/where.go b/examples/o2m2types/ent/pet/where.go index d8d2d216a..fa57c946b 100644 --- a/examples/o2m2types/ent/pet/where.go +++ b/examples/o2m2types/ent/pet/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Pet { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...int) predicate.Pet { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -143,8 +130,7 @@ func NameIn(vs ...string) predicate.Pet { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -161,80 +147,70 @@ func NameNotIn(vs ...string) predicate.Pet { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. @@ -246,8 +222,7 @@ func HasOwner() predicate.Pet { sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -263,44 +238,37 @@ func HasOwnerWith(preds ...predicate.User) predicate.Pet { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Pet(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/o2m2types/ent/user/where.go b/examples/o2m2types/ent/user/where.go index fe3cc97e4..05efa86a9 100644 --- a/examples/o2m2types/ent/user/where.go +++ b/examples/o2m2types/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,72 +64,63 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -151,8 +137,7 @@ func AgeIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -169,56 +154,49 @@ func AgeNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -235,8 +213,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -253,80 +230,70 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasPets applies the HasEdge predicate on the "pets" edge. @@ -338,8 +305,7 @@ func HasPets() predicate.User { sqlgraph.Edge(sqlgraph.O2M, false, PetsTable, PetsColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasPetsWith applies the HasEdge predicate on the "pets" edge with a given conditions (other predicates). @@ -355,44 +321,37 @@ func HasPetsWith(preds ...predicate.Pet) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/o2mrecur/ent/node/where.go b/examples/o2mrecur/ent/node/where.go index 390980cf5..be36908aa 100644 --- a/examples/o2mrecur/ent/node/where.go +++ b/examples/o2mrecur/ent/node/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Node(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Node { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...int) predicate.Node { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Value applies equality check predicate on the "value" field. It's identical to ValueEQ. func Value(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldValue), v)) - }, - ) + }) } // ValueEQ applies the EQ predicate on the "value" field. func ValueEQ(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldValue), v)) - }, - ) + }) } // ValueNEQ applies the NEQ predicate on the "value" field. func ValueNEQ(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldValue), v)) - }, - ) + }) } // ValueIn applies the In predicate on the "value" field. @@ -143,8 +130,7 @@ func ValueIn(vs ...int) predicate.Node { return } s.Where(sql.In(s.C(FieldValue), v...)) - }, - ) + }) } // ValueNotIn applies the NotIn predicate on the "value" field. @@ -161,40 +147,35 @@ func ValueNotIn(vs ...int) predicate.Node { return } s.Where(sql.NotIn(s.C(FieldValue), v...)) - }, - ) + }) } // ValueGT applies the GT predicate on the "value" field. func ValueGT(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldValue), v)) - }, - ) + }) } // ValueGTE applies the GTE predicate on the "value" field. func ValueGTE(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldValue), v)) - }, - ) + }) } // ValueLT applies the LT predicate on the "value" field. func ValueLT(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldValue), v)) - }, - ) + }) } // ValueLTE applies the LTE predicate on the "value" field. func ValueLTE(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldValue), v)) - }, - ) + }) } // HasParent applies the HasEdge predicate on the "parent" edge. @@ -206,8 +187,7 @@ func HasParent() predicate.Node { sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). @@ -223,8 +203,7 @@ func HasParentWith(preds ...predicate.Node) predicate.Node { p(s) } }) - }, - ) + }) } // HasChildren applies the HasEdge predicate on the "children" edge. @@ -236,8 +215,7 @@ func HasChildren() predicate.Node { sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). @@ -253,44 +231,37 @@ func HasChildrenWith(preds ...predicate.Node) predicate.Node { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Node) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Node(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Node) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Node(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Node) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Node(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/o2o2types/ent/card/where.go b/examples/o2o2types/ent/card/where.go index eecdb6c83..91f12b100 100644 --- a/examples/o2o2types/ent/card/where.go +++ b/examples/o2o2types/ent/card/where.go @@ -16,27 +16,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Card { - return predicate.Card( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Card(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -53,8 +49,7 @@ func IDIn(ids ...int) predicate.Card { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -71,72 +66,63 @@ func IDNotIn(ids ...int) predicate.Card { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Expired applies equality check predicate on the "expired" field. It's identical to ExpiredEQ. func Expired(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldExpired), v)) - }, - ) + }) } // Number applies equality check predicate on the "number" field. It's identical to NumberEQ. func Number(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNumber), v)) - }, - ) + }) } // ExpiredEQ applies the EQ predicate on the "expired" field. func ExpiredEQ(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldExpired), v)) - }, - ) + }) } // ExpiredNEQ applies the NEQ predicate on the "expired" field. func ExpiredNEQ(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldExpired), v)) - }, - ) + }) } // ExpiredIn applies the In predicate on the "expired" field. @@ -153,8 +139,7 @@ func ExpiredIn(vs ...time.Time) predicate.Card { return } s.Where(sql.In(s.C(FieldExpired), v...)) - }, - ) + }) } // ExpiredNotIn applies the NotIn predicate on the "expired" field. @@ -171,56 +156,49 @@ func ExpiredNotIn(vs ...time.Time) predicate.Card { return } s.Where(sql.NotIn(s.C(FieldExpired), v...)) - }, - ) + }) } // ExpiredGT applies the GT predicate on the "expired" field. func ExpiredGT(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldExpired), v)) - }, - ) + }) } // ExpiredGTE applies the GTE predicate on the "expired" field. func ExpiredGTE(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldExpired), v)) - }, - ) + }) } // ExpiredLT applies the LT predicate on the "expired" field. func ExpiredLT(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldExpired), v)) - }, - ) + }) } // ExpiredLTE applies the LTE predicate on the "expired" field. func ExpiredLTE(v time.Time) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldExpired), v)) - }, - ) + }) } // NumberEQ applies the EQ predicate on the "number" field. func NumberEQ(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldNumber), v)) - }, - ) + }) } // NumberNEQ applies the NEQ predicate on the "number" field. func NumberNEQ(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldNumber), v)) - }, - ) + }) } // NumberIn applies the In predicate on the "number" field. @@ -237,8 +215,7 @@ func NumberIn(vs ...string) predicate.Card { return } s.Where(sql.In(s.C(FieldNumber), v...)) - }, - ) + }) } // NumberNotIn applies the NotIn predicate on the "number" field. @@ -255,80 +232,70 @@ func NumberNotIn(vs ...string) predicate.Card { return } s.Where(sql.NotIn(s.C(FieldNumber), v...)) - }, - ) + }) } // NumberGT applies the GT predicate on the "number" field. func NumberGT(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldNumber), v)) - }, - ) + }) } // NumberGTE applies the GTE predicate on the "number" field. func NumberGTE(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldNumber), v)) - }, - ) + }) } // NumberLT applies the LT predicate on the "number" field. func NumberLT(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldNumber), v)) - }, - ) + }) } // NumberLTE applies the LTE predicate on the "number" field. func NumberLTE(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldNumber), v)) - }, - ) + }) } // NumberContains applies the Contains predicate on the "number" field. func NumberContains(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldNumber), v)) - }, - ) + }) } // NumberHasPrefix applies the HasPrefix predicate on the "number" field. func NumberHasPrefix(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldNumber), v)) - }, - ) + }) } // NumberHasSuffix applies the HasSuffix predicate on the "number" field. func NumberHasSuffix(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldNumber), v)) - }, - ) + }) } // NumberEqualFold applies the EqualFold predicate on the "number" field. func NumberEqualFold(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldNumber), v)) - }, - ) + }) } // NumberContainsFold applies the ContainsFold predicate on the "number" field. func NumberContainsFold(v string) predicate.Card { return predicate.Card(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldNumber), v)) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. @@ -340,8 +307,7 @@ func HasOwner() predicate.Card { sqlgraph.Edge(sqlgraph.O2O, true, OwnerTable, OwnerColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -357,44 +323,37 @@ func HasOwnerWith(preds ...predicate.User) predicate.Card { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Card) predicate.Card { - return predicate.Card( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Card(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Card) predicate.Card { - return predicate.Card( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Card(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Card) predicate.Card { - return predicate.Card( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Card(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/o2o2types/ent/user/where.go b/examples/o2o2types/ent/user/where.go index c4669b971..cf61b912a 100644 --- a/examples/o2o2types/ent/user/where.go +++ b/examples/o2o2types/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,72 +64,63 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -151,8 +137,7 @@ func AgeIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -169,56 +154,49 @@ func AgeNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -235,8 +213,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -253,80 +230,70 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasCard applies the HasEdge predicate on the "card" edge. @@ -338,8 +305,7 @@ func HasCard() predicate.User { sqlgraph.Edge(sqlgraph.O2O, false, CardTable, CardColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasCardWith applies the HasEdge predicate on the "card" edge with a given conditions (other predicates). @@ -355,44 +321,37 @@ func HasCardWith(preds ...predicate.Card) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/o2obidi/ent/user/where.go b/examples/o2obidi/ent/user/where.go index 8527e4f84..c5f070dd7 100644 --- a/examples/o2obidi/ent/user/where.go +++ b/examples/o2obidi/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,72 +64,63 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -151,8 +137,7 @@ func AgeIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -169,56 +154,49 @@ func AgeNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -235,8 +213,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -253,80 +230,70 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasSpouse applies the HasEdge predicate on the "spouse" edge. @@ -338,8 +305,7 @@ func HasSpouse() predicate.User { sqlgraph.Edge(sqlgraph.O2O, false, SpouseTable, SpouseColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasSpouseWith applies the HasEdge predicate on the "spouse" edge with a given conditions (other predicates). @@ -355,44 +321,37 @@ func HasSpouseWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/o2orecur/ent/node/where.go b/examples/o2orecur/ent/node/where.go index 29e29dbc6..b61f0dd95 100644 --- a/examples/o2orecur/ent/node/where.go +++ b/examples/o2orecur/ent/node/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Node(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Node { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...int) predicate.Node { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Value applies equality check predicate on the "value" field. It's identical to ValueEQ. func Value(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldValue), v)) - }, - ) + }) } // ValueEQ applies the EQ predicate on the "value" field. func ValueEQ(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldValue), v)) - }, - ) + }) } // ValueNEQ applies the NEQ predicate on the "value" field. func ValueNEQ(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldValue), v)) - }, - ) + }) } // ValueIn applies the In predicate on the "value" field. @@ -143,8 +130,7 @@ func ValueIn(vs ...int) predicate.Node { return } s.Where(sql.In(s.C(FieldValue), v...)) - }, - ) + }) } // ValueNotIn applies the NotIn predicate on the "value" field. @@ -161,40 +147,35 @@ func ValueNotIn(vs ...int) predicate.Node { return } s.Where(sql.NotIn(s.C(FieldValue), v...)) - }, - ) + }) } // ValueGT applies the GT predicate on the "value" field. func ValueGT(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldValue), v)) - }, - ) + }) } // ValueGTE applies the GTE predicate on the "value" field. func ValueGTE(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldValue), v)) - }, - ) + }) } // ValueLT applies the LT predicate on the "value" field. func ValueLT(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldValue), v)) - }, - ) + }) } // ValueLTE applies the LTE predicate on the "value" field. func ValueLTE(v int) predicate.Node { return predicate.Node(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldValue), v)) - }, - ) + }) } // HasPrev applies the HasEdge predicate on the "prev" edge. @@ -206,8 +187,7 @@ func HasPrev() predicate.Node { sqlgraph.Edge(sqlgraph.O2O, true, PrevTable, PrevColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasPrevWith applies the HasEdge predicate on the "prev" edge with a given conditions (other predicates). @@ -223,8 +203,7 @@ func HasPrevWith(preds ...predicate.Node) predicate.Node { p(s) } }) - }, - ) + }) } // HasNext applies the HasEdge predicate on the "next" edge. @@ -236,8 +215,7 @@ func HasNext() predicate.Node { sqlgraph.Edge(sqlgraph.O2O, false, NextTable, NextColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasNextWith applies the HasEdge predicate on the "next" edge with a given conditions (other predicates). @@ -253,44 +231,37 @@ func HasNextWith(preds ...predicate.Node) predicate.Node { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Node) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Node(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Node) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Node(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Node) predicate.Node { - return predicate.Node( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Node(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/start/ent/car/where.go b/examples/start/ent/car/where.go index e4502e712..96b1b4692 100644 --- a/examples/start/ent/car/where.go +++ b/examples/start/ent/car/where.go @@ -16,27 +16,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Car(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -53,8 +49,7 @@ func IDIn(ids ...int) predicate.Car { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -71,72 +66,63 @@ func IDNotIn(ids ...int) predicate.Car { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Model applies equality check predicate on the "model" field. It's identical to ModelEQ. func Model(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldModel), v)) - }, - ) + }) } // RegisteredAt applies equality check predicate on the "registered_at" field. It's identical to RegisteredAtEQ. func RegisteredAt(v time.Time) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldRegisteredAt), v)) - }, - ) + }) } // ModelEQ applies the EQ predicate on the "model" field. func ModelEQ(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldModel), v)) - }, - ) + }) } // ModelNEQ applies the NEQ predicate on the "model" field. func ModelNEQ(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldModel), v)) - }, - ) + }) } // ModelIn applies the In predicate on the "model" field. @@ -153,8 +139,7 @@ func ModelIn(vs ...string) predicate.Car { return } s.Where(sql.In(s.C(FieldModel), v...)) - }, - ) + }) } // ModelNotIn applies the NotIn predicate on the "model" field. @@ -171,96 +156,84 @@ func ModelNotIn(vs ...string) predicate.Car { return } s.Where(sql.NotIn(s.C(FieldModel), v...)) - }, - ) + }) } // ModelGT applies the GT predicate on the "model" field. func ModelGT(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldModel), v)) - }, - ) + }) } // ModelGTE applies the GTE predicate on the "model" field. func ModelGTE(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldModel), v)) - }, - ) + }) } // ModelLT applies the LT predicate on the "model" field. func ModelLT(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldModel), v)) - }, - ) + }) } // ModelLTE applies the LTE predicate on the "model" field. func ModelLTE(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldModel), v)) - }, - ) + }) } // ModelContains applies the Contains predicate on the "model" field. func ModelContains(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldModel), v)) - }, - ) + }) } // ModelHasPrefix applies the HasPrefix predicate on the "model" field. func ModelHasPrefix(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldModel), v)) - }, - ) + }) } // ModelHasSuffix applies the HasSuffix predicate on the "model" field. func ModelHasSuffix(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldModel), v)) - }, - ) + }) } // ModelEqualFold applies the EqualFold predicate on the "model" field. func ModelEqualFold(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldModel), v)) - }, - ) + }) } // ModelContainsFold applies the ContainsFold predicate on the "model" field. func ModelContainsFold(v string) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldModel), v)) - }, - ) + }) } // RegisteredAtEQ applies the EQ predicate on the "registered_at" field. func RegisteredAtEQ(v time.Time) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldRegisteredAt), v)) - }, - ) + }) } // RegisteredAtNEQ applies the NEQ predicate on the "registered_at" field. func RegisteredAtNEQ(v time.Time) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldRegisteredAt), v)) - }, - ) + }) } // RegisteredAtIn applies the In predicate on the "registered_at" field. @@ -277,8 +250,7 @@ func RegisteredAtIn(vs ...time.Time) predicate.Car { return } s.Where(sql.In(s.C(FieldRegisteredAt), v...)) - }, - ) + }) } // RegisteredAtNotIn applies the NotIn predicate on the "registered_at" field. @@ -295,40 +267,35 @@ func RegisteredAtNotIn(vs ...time.Time) predicate.Car { return } s.Where(sql.NotIn(s.C(FieldRegisteredAt), v...)) - }, - ) + }) } // RegisteredAtGT applies the GT predicate on the "registered_at" field. func RegisteredAtGT(v time.Time) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldRegisteredAt), v)) - }, - ) + }) } // RegisteredAtGTE applies the GTE predicate on the "registered_at" field. func RegisteredAtGTE(v time.Time) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldRegisteredAt), v)) - }, - ) + }) } // RegisteredAtLT applies the LT predicate on the "registered_at" field. func RegisteredAtLT(v time.Time) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldRegisteredAt), v)) - }, - ) + }) } // RegisteredAtLTE applies the LTE predicate on the "registered_at" field. func RegisteredAtLTE(v time.Time) predicate.Car { return predicate.Car(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldRegisteredAt), v)) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. @@ -340,8 +307,7 @@ func HasOwner() predicate.Car { sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -357,44 +323,37 @@ func HasOwnerWith(preds ...predicate.User) predicate.Car { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Car) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Car(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Car) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Car(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Car) predicate.Car { - return predicate.Car( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Car(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/start/ent/group/where.go b/examples/start/ent/group/where.go index b7c6a2fd7..50e8df451 100644 --- a/examples/start/ent/group/where.go +++ b/examples/start/ent/group/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -143,8 +130,7 @@ func NameIn(vs ...string) predicate.Group { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -161,80 +147,70 @@ func NameNotIn(vs ...string) predicate.Group { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasUsers applies the HasEdge predicate on the "users" edge. @@ -246,8 +222,7 @@ func HasUsers() predicate.Group { sqlgraph.Edge(sqlgraph.M2M, false, UsersTable, UsersPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates). @@ -263,44 +238,37 @@ func HasUsersWith(preds ...predicate.User) predicate.Group { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/start/ent/user/where.go b/examples/start/ent/user/where.go index cdf14effe..da29beb22 100644 --- a/examples/start/ent/user/where.go +++ b/examples/start/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,72 +64,63 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -151,8 +137,7 @@ func AgeIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -169,56 +154,49 @@ func AgeNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -235,8 +213,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -253,80 +230,70 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasCars applies the HasEdge predicate on the "cars" edge. @@ -338,8 +305,7 @@ func HasCars() predicate.User { sqlgraph.Edge(sqlgraph.O2M, false, CarsTable, CarsColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasCarsWith applies the HasEdge predicate on the "cars" edge with a given conditions (other predicates). @@ -355,8 +321,7 @@ func HasCarsWith(preds ...predicate.Car) predicate.User { p(s) } }) - }, - ) + }) } // HasGroups applies the HasEdge predicate on the "groups" edge. @@ -368,8 +333,7 @@ func HasGroups() predicate.User { sqlgraph.Edge(sqlgraph.M2M, true, GroupsTable, GroupsPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates). @@ -385,44 +349,37 @@ func HasGroupsWith(preds ...predicate.Group) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/traversal/ent/group/where.go b/examples/traversal/ent/group/where.go index 4b0d02d38..710028d25 100644 --- a/examples/traversal/ent/group/where.go +++ b/examples/traversal/ent/group/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...int) predicate.Group { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -143,8 +130,7 @@ func NameIn(vs ...string) predicate.Group { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -161,80 +147,70 @@ func NameNotIn(vs ...string) predicate.Group { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.Group { return predicate.Group(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasUsers applies the HasEdge predicate on the "users" edge. @@ -246,8 +222,7 @@ func HasUsers() predicate.Group { sqlgraph.Edge(sqlgraph.M2M, false, UsersTable, UsersPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates). @@ -263,8 +238,7 @@ func HasUsersWith(preds ...predicate.User) predicate.Group { p(s) } }) - }, - ) + }) } // HasAdmin applies the HasEdge predicate on the "admin" edge. @@ -276,8 +250,7 @@ func HasAdmin() predicate.Group { sqlgraph.Edge(sqlgraph.M2O, false, AdminTable, AdminColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasAdminWith applies the HasEdge predicate on the "admin" edge with a given conditions (other predicates). @@ -293,44 +266,37 @@ func HasAdminWith(preds ...predicate.User) predicate.Group { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Group(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Group) predicate.Group { - return predicate.Group( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Group(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/traversal/ent/pet/where.go b/examples/traversal/ent/pet/where.go index bad8307ec..e5e3d3155 100644 --- a/examples/traversal/ent/pet/where.go +++ b/examples/traversal/ent/pet/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.Pet { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,64 +64,56 @@ func IDNotIn(ids ...int) predicate.Pet { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -143,8 +130,7 @@ func NameIn(vs ...string) predicate.Pet { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -161,80 +147,70 @@ func NameNotIn(vs ...string) predicate.Pet { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.Pet { return predicate.Pet(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasFriends applies the HasEdge predicate on the "friends" edge. @@ -246,8 +222,7 @@ func HasFriends() predicate.Pet { sqlgraph.Edge(sqlgraph.M2M, false, FriendsTable, FriendsPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFriendsWith applies the HasEdge predicate on the "friends" edge with a given conditions (other predicates). @@ -263,8 +238,7 @@ func HasFriendsWith(preds ...predicate.Pet) predicate.Pet { p(s) } }) - }, - ) + }) } // HasOwner applies the HasEdge predicate on the "owner" edge. @@ -276,8 +250,7 @@ func HasOwner() predicate.Pet { sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). @@ -293,44 +266,37 @@ func HasOwnerWith(preds ...predicate.User) predicate.Pet { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.Pet(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.Pet) predicate.Pet { - return predicate.Pet( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.Pet(func(s *sql.Selector) { + p(s.Not()) + }) } diff --git a/examples/traversal/ent/user/where.go b/examples/traversal/ent/user/where.go index 18b1f1a6d..2ab62b2b1 100644 --- a/examples/traversal/ent/user/where.go +++ b/examples/traversal/ent/user/where.go @@ -14,27 +14,23 @@ import ( // ID filters vertices based on their identifier. func ID(id int) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + return predicate.User(func(s *sql.Selector) { + s.Where(sql.EQ(s.C(FieldID), id)) + }) } // IDEQ applies the EQ predicate on the ID field. func IDEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldID), id)) - }, - ) + }) } // IDNEQ applies the NEQ predicate on the ID field. func IDNEQ(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldID), id)) - }, - ) + }) } // IDIn applies the In predicate on the ID field. @@ -51,8 +47,7 @@ func IDIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.In(s.C(FieldID), v...)) - }, - ) + }) } // IDNotIn applies the NotIn predicate on the ID field. @@ -69,72 +64,63 @@ func IDNotIn(ids ...int) predicate.User { v[i] = ids[i] } s.Where(sql.NotIn(s.C(FieldID), v...)) - }, - ) + }) } // IDGT applies the GT predicate on the ID field. func IDGT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldID), id)) - }, - ) + }) } // IDGTE applies the GTE predicate on the ID field. func IDGTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldID), id)) - }, - ) + }) } // IDLT applies the LT predicate on the ID field. func IDLT(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldID), id)) - }, - ) + }) } // IDLTE applies the LTE predicate on the ID field. func IDLTE(id int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldID), id)) - }, - ) + }) } // Age applies equality check predicate on the "age" field. It's identical to AgeEQ. func Age(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // Name applies equality check predicate on the "name" field. It's identical to NameEQ. func Name(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // AgeEQ applies the EQ predicate on the "age" field. func AgeEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeNEQ applies the NEQ predicate on the "age" field. func AgeNEQ(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldAge), v)) - }, - ) + }) } // AgeIn applies the In predicate on the "age" field. @@ -151,8 +137,7 @@ func AgeIn(vs ...int) predicate.User { return } s.Where(sql.In(s.C(FieldAge), v...)) - }, - ) + }) } // AgeNotIn applies the NotIn predicate on the "age" field. @@ -169,56 +154,49 @@ func AgeNotIn(vs ...int) predicate.User { return } s.Where(sql.NotIn(s.C(FieldAge), v...)) - }, - ) + }) } // AgeGT applies the GT predicate on the "age" field. func AgeGT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldAge), v)) - }, - ) + }) } // AgeGTE applies the GTE predicate on the "age" field. func AgeGTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldAge), v)) - }, - ) + }) } // AgeLT applies the LT predicate on the "age" field. func AgeLT(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldAge), v)) - }, - ) + }) } // AgeLTE applies the LTE predicate on the "age" field. func AgeLTE(v int) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldAge), v)) - }, - ) + }) } // NameEQ applies the EQ predicate on the "name" field. func NameEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EQ(s.C(FieldName), v)) - }, - ) + }) } // NameNEQ applies the NEQ predicate on the "name" field. func NameNEQ(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.NEQ(s.C(FieldName), v)) - }, - ) + }) } // NameIn applies the In predicate on the "name" field. @@ -235,8 +213,7 @@ func NameIn(vs ...string) predicate.User { return } s.Where(sql.In(s.C(FieldName), v...)) - }, - ) + }) } // NameNotIn applies the NotIn predicate on the "name" field. @@ -253,80 +230,70 @@ func NameNotIn(vs ...string) predicate.User { return } s.Where(sql.NotIn(s.C(FieldName), v...)) - }, - ) + }) } // NameGT applies the GT predicate on the "name" field. func NameGT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GT(s.C(FieldName), v)) - }, - ) + }) } // NameGTE applies the GTE predicate on the "name" field. func NameGTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.GTE(s.C(FieldName), v)) - }, - ) + }) } // NameLT applies the LT predicate on the "name" field. func NameLT(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LT(s.C(FieldName), v)) - }, - ) + }) } // NameLTE applies the LTE predicate on the "name" field. func NameLTE(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.LTE(s.C(FieldName), v)) - }, - ) + }) } // NameContains applies the Contains predicate on the "name" field. func NameContains(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.Contains(s.C(FieldName), v)) - }, - ) + }) } // NameHasPrefix applies the HasPrefix predicate on the "name" field. func NameHasPrefix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasPrefix(s.C(FieldName), v)) - }, - ) + }) } // NameHasSuffix applies the HasSuffix predicate on the "name" field. func NameHasSuffix(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.HasSuffix(s.C(FieldName), v)) - }, - ) + }) } // NameEqualFold applies the EqualFold predicate on the "name" field. func NameEqualFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.EqualFold(s.C(FieldName), v)) - }, - ) + }) } // NameContainsFold applies the ContainsFold predicate on the "name" field. func NameContainsFold(v string) predicate.User { return predicate.User(func(s *sql.Selector) { s.Where(sql.ContainsFold(s.C(FieldName), v)) - }, - ) + }) } // HasPets applies the HasEdge predicate on the "pets" edge. @@ -338,8 +305,7 @@ func HasPets() predicate.User { sqlgraph.Edge(sqlgraph.O2M, false, PetsTable, PetsColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasPetsWith applies the HasEdge predicate on the "pets" edge with a given conditions (other predicates). @@ -355,8 +321,7 @@ func HasPetsWith(preds ...predicate.Pet) predicate.User { p(s) } }) - }, - ) + }) } // HasFriends applies the HasEdge predicate on the "friends" edge. @@ -368,8 +333,7 @@ func HasFriends() predicate.User { sqlgraph.Edge(sqlgraph.M2M, false, FriendsTable, FriendsPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasFriendsWith applies the HasEdge predicate on the "friends" edge with a given conditions (other predicates). @@ -385,8 +349,7 @@ func HasFriendsWith(preds ...predicate.User) predicate.User { p(s) } }) - }, - ) + }) } // HasGroups applies the HasEdge predicate on the "groups" edge. @@ -398,8 +361,7 @@ func HasGroups() predicate.User { sqlgraph.Edge(sqlgraph.M2M, true, GroupsTable, GroupsPrimaryKey...), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates). @@ -415,8 +377,7 @@ func HasGroupsWith(preds ...predicate.Group) predicate.User { p(s) } }) - }, - ) + }) } // HasManage applies the HasEdge predicate on the "manage" edge. @@ -428,8 +389,7 @@ func HasManage() predicate.User { sqlgraph.Edge(sqlgraph.O2M, true, ManageTable, ManageColumn), ) sqlgraph.HasNeighbors(s, step) - }, - ) + }) } // HasManageWith applies the HasEdge predicate on the "manage" edge with a given conditions (other predicates). @@ -445,44 +405,37 @@ func HasManageWith(preds ...predicate.Group) predicate.User { p(s) } }) - }, - ) + }) } // And groups list of predicates with the AND operator between them. func And(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for _, p := range predicates { - p(s1) - } - s.Where(s1.P()) - }, - ) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for _, p := range predicates { + p(s1) + } + s.Where(s1.P()) + }) } // Or groups list of predicates with the OR operator between them. func Or(predicates ...predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - s1 := s.Clone().SetP(nil) - for i, p := range predicates { - if i > 0 { - s1.Or() - } - p(s1) + return predicate.User(func(s *sql.Selector) { + s1 := s.Clone().SetP(nil) + for i, p := range predicates { + if i > 0 { + s1.Or() } - s.Where(s1.P()) - }, - ) + p(s1) + } + s.Where(s1.P()) + }) } // Not applies the not operator on the given predicate. func Not(p predicate.User) predicate.User { - return predicate.User( - func(s *sql.Selector) { - p(s.Not()) - }, - ) + return predicate.User(func(s *sql.Selector) { + p(s.Not()) + }) }