From 7f5720cf92c9e4527ff5e068f82a944f509b7b4e Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Tue, 19 Jan 2021 09:38:00 +0200 Subject: [PATCH] entc/gen/template: allow mutating the sqlgraph.DeleteSpec by ent extensions or user templates --- entc/gen/internal/bindata.go | 8 ++++---- entc/gen/template/dialect/sql/delete.tmpl | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index 4ada6cc44..34af3b177 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -630,7 +630,7 @@ func templateDialectSqlByTmpl() (*asset, error) { return a, nil } -var _templateDialectSqlCreateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\x6d\x6f\xdb\xc8\x11\xfe\x4c\xfe\x8a\x39\xc1\x0d\x48\x57\xa6\x9c\xa0\x28\x50\xa7\x3a\x20\x67\x27\xad\x80\xbb\xa0\x85\x9d\xc3\xa1\x86\x11\x50\xe4\x50\x5a\x88\xda\x65\x76\x97\x3e\x1b\x02\xff\x7b\x31\xb3\xbb\x14\xf5\xe2\x97\x36\xed\x97\x84\xda\x9d\xb7\x9d\x7d\xe6\xd9\x19\x6f\x36\x93\xd3\xf8\x52\x35\x8f\x5a\x2c\x96\x16\xde\x9d\xbf\xfd\xcb\x59\xa3\xd1\xa0\xb4\xf0\x29\x2f\x70\xae\xd4\x0a\x66\xb2\xc8\xe0\x43\x5d\x03\x0b\x19\xa0\x7d\x7d\x8f\x65\x16\xdf\x2c\x85\x01\xa3\x5a\x5d\x20\x14\xaa\x44\x10\x06\x6a\x51\xa0\x34\x58\x42\x2b\x4b\xd4\x60\x97\x08\x1f\x9a\xbc\x58\x22\xbc\xcb\xce\xc3\x2e\x54\xaa\x95\x65\x2c\x24\xef\xff\x3c\xbb\xfc\xf8\xf9\xfa\x23\x54\xa2\x46\xf0\x6b\x5a\x29\x0b\xa5\xd0\x58\x58\xa5\x1f\x41\x55\x60\x07\xce\xac\x46\xcc\xe2\xd3\x49\xd7\xc5\xf1\x66\x03\x25\x56\x42\x22\x8c\x4a\x91\xd7\x58\xd8\x89\xf9\x56\x4f\x0a\x8d\xb9\xc5\x11\x74\x1d\x49\x9c\xcc\x5b\x51\x53\x3c\x17\x53\x68\x72\x53\xe4\x35\x9c\x64\xd7\x85\x6a\x30\xfb\xc9\xef\x78\x41\x8d\x05\x8a\x7b\x27\xd9\x7f\xf7\xea\x5e\x68\xdd\xda\xdc\x0a\x25\xd9\x9c\x16\xd2\x0e\xf4\x46\x59\xd8\x1d\x01\xc9\xc7\x55\x2b\x0b\x48\x76\x6c\x77\x1d\x9c\x0e\xa3\xea\xba\x14\xcc\xb7\xfa\x3a\xbf\xc7\xa4\xb0\x0f\x50\x28\x69\xf1\xc1\x66\x97\xee\xff\x14\x12\x16\xcf\x3e\xe7\x6b\x84\xae\x1b\x03\x6a\xad\x74\x0a\x9b\x38\xfa\x2a\x55\x89\x63\xf8\x6a\x1a\x2c\x28\x9c\x3d\x3f\x99\xcb\xc3\x75\x83\x45\x92\xc6\x91\xa8\x48\x95\xe4\xcc\xb7\x7a\xa1\xf3\x66\x99\x5d\xb2\xc0\x67\x55\xb2\xeb\xf1\x81\x81\x52\xd3\x97\xf7\x90\xbe\x67\xfd\x1f\xa6\x20\x45\x4d\xee\xc9\x62\x81\x5a\x8f\x41\xad\xc8\xac\x30\xd7\xff\xfc\xf9\x52\x49\x63\x75\x2e\xa4\xfd\x48\x71\x26\xa8\x75\xfa\x9e\x04\x48\x21\x22\x03\x53\x56\x8a\xa3\xa8\x8b\xa3\x48\xa3\x6d\xb5\x24\x8b\x7c\xb0\x98\x16\x37\x9b\x33\x10\x15\xe4\xb2\x84\x93\x6c\x76\x95\x7d\x31\xa8\xaf\xf8\x9a\x4b\x48\x94\x76\x8b\x33\x73\x6d\xb5\x90\x8b\xf0\xeb\xcb\x97\xd9\x55\x4a\x39\x8f\x58\x7f\x72\x0a\x57\x0a\xa4\xb2\x4b\x21\x17\x63\x98\x63\x91\xb7\x06\x09\x5e\x06\xe1\x1d\xd8\xc7\x06\x0d\xac\x5b\x63\x61\x8e\x60\xda\xa6\xa9\x05\x96\x30\x7f\x64\x00\xb6\x06\x75\x06\xa7\x13\x38\xeb\x7c\x38\x58\x1b\xdc\x1a\x17\xd5\x61\x60\xbc\x49\x19\xe1\x4b\xc9\x66\x57\x30\x9d\xc2\x39\x9f\x9a\x0d\xc8\x5e\xa4\xa4\x5c\x71\x46\xc9\xc6\xaf\x79\xdd\x62\x96\x08\x69\xff\xfc\xa7\x94\xf6\xb7\xfa\x7c\x1d\x24\x73\xf3\xd8\x90\xf7\x44\x94\xe9\x8b\x11\x74\x7b\x0e\x87\xdf\x3e\xd9\x1e\x36\x52\xd4\xf1\xeb\x21\x3a\xc4\xd2\x01\x24\x4f\xf7\x10\x45\x62\x8c\xd0\xfb\x5c\x43\x12\xfb\x43\xc1\x14\xde\x0c\xf5\x36\x85\x92\x95\x58\x5c\x1c\xe2\x96\xd7\xe9\x24\x0e\xda\x53\x78\x73\xc4\x01\x03\xea\x26\x9f\xd7\xe8\x2c\x64\xff\xc8\x8b\x55\xbe\x20\xcb\x19\x2f\x8f\x49\x60\x76\x75\x31\xd0\xfe\x24\xb0\x2e\x7b\xe5\x88\x12\x7b\x01\x15\x2d\x66\xc3\x64\x67\x8c\xe2\x70\x3c\x16\xbd\x54\x75\xbb\x96\x87\x9e\x82\x1a\x6b\xe4\xd2\x06\x05\xfe\xb7\x8b\xa3\x34\x0e\x78\xfc\x50\xd7\xea\x77\xc8\xcb\x92\x50\xeb\x78\x42\x2e\x18\x6f\x47\x0e\x47\x50\x24\x26\xc6\x07\x8b\xd2\x08\x25\x0d\x28\xcd\xc0\x04\x8b\xeb\xa6\xce\x2d\x9a\x8c\x49\x90\xcd\xff\x2e\xec\x12\x4e\xec\xba\xa9\x0d\xa1\x6b\x9d\xdb\x62\x79\xe3\xe5\x8e\x71\xe3\x84\xf2\x3a\x39\x1d\x6d\x31\xad\x73\xb9\x40\x67\x82\x2c\x78\x5b\x0e\x53\xb4\xff\x10\xdc\x7a\x99\x93\xad\xea\x31\xa8\x3d\x0b\x52\x51\x81\x28\x03\x6b\xec\x70\xea\x20\xa1\xbf\xf8\xb5\xbf\x21\xe5\x34\x19\x90\xc8\xa0\x42\x44\xc9\x0b\x3b\xc5\x14\x96\x8f\x44\xe4\x0f\x59\xf1\x09\x1d\x18\x4c\x1f\xd2\x3d\x29\x3f\x17\x55\xf5\x5c\x4c\x1c\x82\xb7\x38\x85\xbc\x69\x50\x96\xc9\x70\x75\xfc\x7a\x18\x56\x4f\x81\x90\xcf\x77\xe1\x23\x7d\x11\x96\xd5\x21\x28\x07\x0c\xe3\x24\xae\xad\x6e\x0b\xcb\xf1\x50\xd9\xf3\xc1\xe9\xde\xaa\xec\xb3\xa8\x6b\xaa\x22\xe8\x3a\xaa\x5a\x97\x46\xf6\xfc\x6c\x6e\xd1\xe5\xf6\x63\xb9\xc0\x6d\x6a\xc9\xa1\x79\x2a\xad\xb8\x17\xc4\xec\xca\x50\x66\x6b\x94\x09\xeb\xa5\xf0\xa3\x27\xd2\x2d\xd4\xb9\x2c\x4a\x38\x81\x11\x39\x1a\x91\xdb\x11\x3d\x63\x66\x04\x56\xb7\x08\xa3\x7f\xa1\x56\x23\x18\x49\x51\x7b\x8c\x93\x72\x5f\x3a\xbb\x25\x51\x62\x85\x6c\x25\x23\x52\xda\x4c\x4e\x7d\x53\x51\x52\x43\x42\x02\x6d\x53\xe6\x16\x33\xc6\xbd\xab\xb9\x7d\x52\x77\x17\xed\x0e\xbd\x77\xfb\xbc\x38\x06\xf2\x90\x1e\x66\x6e\x97\x92\x59\x23\x76\x8d\x8d\x97\x78\xbe\xc7\xf9\x3a\x6f\xeb\xd5\xff\xa1\xd1\x89\x27\x13\xa0\x8e\xc4\xd3\xbe\x61\x9a\x1a\x72\x37\x91\x93\xb0\x02\x4d\x68\xda\xca\xdc\xe6\xf3\xdc\x60\xf6\xda\x07\xe5\x99\x86\xe7\xf6\xee\xc9\x96\x87\x12\xe4\x29\x6e\x85\x24\x78\x84\x3b\xc7\x8c\x9d\xfd\x47\xc5\xfb\x36\x69\x1a\x47\x3d\x1e\x83\x95\x5d\x77\x2f\xa9\x33\x82\x95\x1e\x5a\xf8\xc5\x2d\xbd\xac\x5b\x29\x0d\x82\xf3\xce\xf5\xf2\x94\x28\xe3\x9d\x32\x99\x08\x10\xd2\x8e\x5d\x53\x7c\x90\x2a\xae\x8a\xc1\xb5\x3f\x65\xee\x56\xdc\x05\xd0\x32\x2b\xff\x3d\x37\x57\x58\xe5\x6d\x6d\x43\x75\x78\xc9\xac\x74\xcb\x26\x49\x0f\x51\x4e\xaf\xf9\xba\xb5\xe0\x0f\x0b\x53\xf7\x85\x9f\x28\x4e\x0e\xf6\xc8\x7d\x8e\x61\x0d\x81\x37\x53\x48\x7e\x75\x2c\xbb\xbd\xd1\x28\x8a\x02\x23\x04\xf2\x5d\x67\xbe\xc1\x08\x7a\xfe\x66\x38\x24\xe2\x93\x1f\x02\xed\xee\x36\x90\xd5\xda\x66\xdc\x75\x56\xc9\xa8\x95\xf8\xd0\x60\x61\xb1\x84\x9e\x70\xa8\xeb\x83\x3f\xdc\x8c\xc6\xb0\x76\xa6\xba\x60\xd0\x37\xc6\x21\x09\xc5\x12\x8b\x55\x72\xd8\xf0\x46\x47\x1a\xd6\xde\x4c\x50\xee\xdd\x4d\x7b\xcf\xbc\xcf\xa0\xbb\x15\x77\x63\x60\x10\xdf\x8a\x3b\x18\x78\xdc\x69\xd5\x7d\xae\xc9\x3b\x27\x2a\x84\x29\xe0\xaf\x0c\xb0\x00\xc0\xf4\xec\x6d\x88\xeb\x2b\x87\x13\x7c\x2a\xba\xf2\x3f\xbe\xbd\x73\x19\xc4\x84\xd0\x73\xd8\xde\x6f\xd1\x41\xa2\x21\x58\x9f\x1a\xd7\xf3\x7a\xeb\x93\x09\xcc\xe4\xbd\x5a\x71\x07\x0d\x79\x61\xdb\xbc\x06\xd5\xa0\x76\x27\x55\x8e\x03\xb8\x2b\xb1\xdb\x7c\x7b\x6a\x28\x96\xb9\x90\x99\x33\xe4\x73\x3d\x98\x41\x7e\xa2\x5e\xc5\x15\xef\xf3\x43\xc8\x9b\x63\x2a\xfc\x88\x32\xf3\x5f\xb8\xb4\x76\x47\x6f\xed\xbf\x18\x55\xa2\xfd\x71\x65\x7b\xd3\xfe\xbf\x6e\x07\xbc\x59\xa9\x24\xf5\x1e\xf4\xfe\x0c\x61\xf5\x5a\xf8\x7c\xef\xd4\x13\xfd\xcf\x07\x9f\x50\xff\xfd\xec\x13\xbd\x34\x7c\x44\xdb\xd7\xfe\x56\xdc\xed\x0c\x41\x07\x64\xd2\x8f\x42\xa1\x1a\x8e\x4e\x43\x83\xba\x79\x6e\x26\x7a\x4d\x64\xdd\xd1\x28\xf6\x7e\x86\xfb\xe9\x6b\x95\xa6\xa4\xbe\x73\xea\xc9\x9b\x8a\x30\x94\xee\x52\xa9\x95\x49\xe1\x0c\xde\xbe\x07\x01\x3f\x4e\xe1\xfc\x3d\x88\xb3\xb3\x2d\xb7\x0d\xca\x9c\x65\x6f\xc5\x1d\x55\x70\x1a\xc6\xb5\x68\x5b\xb2\x77\xae\x80\xa9\x4f\x48\xc4\x18\x0a\xfb\x90\xf2\x48\x2c\xaa\xdd\xba\xef\x5b\x22\x1a\x38\xc7\x81\xbe\x7a\x3b\xe7\x7d\xe1\x1f\xad\xa8\xbe\xee\xcf\x07\x55\x7f\x58\x36\x87\x58\xed\x38\x98\x61\x8e\xfa\x31\xd2\x37\x0c\xbf\xb9\xbf\x03\xad\x90\x7f\x8d\x61\xde\x5a\x68\x72\x29\x0a\xe3\xc0\xed\xf8\x0c\x54\x51\xb4\xda\xfc\x47\xbd\xc2\x6f\xc7\x9b\x85\xbd\xc7\x9b\x87\xce\x3e\x21\xfb\x07\x0f\x3d\xc7\xf6\xaf\x21\x83\xf3\x72\x98\x4c\x02\xc3\x53\xde\xc7\xdd\x6e\x37\xf6\x9d\xc3\xd6\x0b\xb3\xd6\xd3\xa3\xd6\x00\xa8\xdb\xcf\x7f\x07\x00\x00\xff\xff\x01\x51\x07\x87\xc5\x13\x00\x00") +var _templateDialectSqlCreateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\x7b\x6f\xe3\xb8\x11\xff\x5b\xfa\x14\x73\x46\xba\x90\x52\x47\xce\x2e\x8a\x02\xcd\xd6\x07\xec\x25\xbb\xad\x81\xbb\x45\x8b\x64\x0f\x87\x06\xc1\x42\x96\x46\x36\x61\x99\xd4\x92\x54\x36\x81\xa1\xef\x5e\xcc\x90\x94\xe5\x47\x1e\x7d\xdc\x3f\x89\x4d\xce\x8b\xc3\xdf\xfc\x38\xe3\xcd\x66\x72\x1a\x5f\xaa\xe6\x51\x8b\xc5\xd2\xc2\xbb\xf3\xb7\x7f\x39\x6b\x34\x1a\x94\x16\x3e\xe5\x05\xce\x95\x5a\xc1\x4c\x16\x19\x7c\xa8\x6b\x60\x21\x03\xb4\xaf\xef\xb1\xcc\xe2\x9b\xa5\x30\x60\x54\xab\x0b\x84\x42\x95\x08\xc2\x40\x2d\x0a\x94\x06\x4b\x68\x65\x89\x1a\xec\x12\xe1\x43\x93\x17\x4b\x84\x77\xd9\x79\xd8\x85\x4a\xb5\xb2\x8c\x85\xe4\xfd\x9f\x67\x97\x1f\x3f\x5f\x7f\x84\x4a\xd4\x08\x7e\x4d\x2b\x65\xa1\x14\x1a\x0b\xab\xf4\x23\xa8\x0a\xec\xc0\x99\xd5\x88\x59\x7c\x3a\xe9\xba\x38\xde\x6c\xa0\xc4\x4a\x48\x84\x51\x29\xf2\x1a\x0b\x3b\x31\xdf\xea\x49\xa1\x31\xb7\x38\x82\xae\x23\x89\x93\x79\x2b\x6a\x8a\xe7\x62\x0a\x4d\x6e\x8a\xbc\x86\x93\xec\xba\x50\x0d\x66\x3f\xf9\x1d\x2f\xa8\xb1\x40\x71\xef\x24\xfb\xcf\xbd\xba\x17\x5a\xb7\x36\xb7\x42\x49\x36\xa7\x85\xb4\x03\xbd\x51\x16\x76\x47\x40\xf2\x71\xd5\xca\x02\x92\x1d\xdb\x5d\x07\xa7\xc3\xa8\xba\x2e\x05\xf3\xad\xbe\xce\xef\x31\x29\xec\x03\x14\x4a\x5a\x7c\xb0\xd9\xa5\xfb\x9f\x42\xc2\xe2\xd9\xe7\x7c\x8d\xd0\x75\x63\x40\xad\x95\x4e\x61\x13\x47\x5f\xa5\x2a\x71\x0c\x5f\x4d\x83\x05\x85\xb3\xe7\x27\x73\x79\xb8\x6e\xb0\x48\xd2\x38\x12\x15\xa9\x92\x9c\xf9\x56\x2f\x74\xde\x2c\xb3\x4b\x16\xf8\xac\x4a\x76\x3d\x3e\x30\x50\x6a\xfa\xe4\x3d\xa4\xef\x59\xff\x87\x29\x48\x51\x93\x7b\xb2\x58\xa0\xd6\x63\x50\x2b\x32\x2b\xcc\xf5\x3f\x7f\xbe\x54\xd2\x58\x9d\x0b\x69\x3f\x52\x9c\x09\x6a\x9d\xbe\x27\x01\x52\x88\xc8\xc0\x94\x95\xe2\x28\xea\xe2\x28\xd2\x68\x5b\x2d\xc9\x22\x1f\x2c\xa6\xc5\xcd\xe6\x0c\x44\x05\xb9\x2c\xe1\x24\x9b\x5d\x65\x5f\x0c\xea\x2b\xbe\xe6\x12\x12\xa5\xdd\xe2\xcc\x5c\x5b\x2d\xe4\x22\x7c\xfb\xf2\x65\x76\x95\x52\xce\x23\xd6\x9f\x9c\xc2\x95\x02\xa9\xec\x52\xc8\xc5\x18\xe6\x58\xe4\xad\x41\x82\x97\x41\x78\x07\xf6\xb1\x41\x03\xeb\xd6\x58\x98\x23\x98\xb6\x69\x6a\x81\x25\xcc\x1f\x19\x80\xad\x41\x9d\xc1\xe9\x04\xce\x3a\x1f\x0e\xd6\x06\xb7\xc6\x45\x75\x18\x18\x6f\x52\x46\xf8\x52\xb2\xd9\x15\x4c\xa7\x70\xce\xa7\x66\x03\xb2\x17\x29\x29\x57\x9c\x51\xb2\xf1\x6b\x5e\xb7\x98\x25\x42\xda\x3f\xff\x29\xa5\xfd\xad\x3e\x5f\x07\xc9\xdc\x3c\x36\xe4\x3d\x11\x65\xfa\x62\x04\xdd\x9e\xc3\xe1\x67\x9f\x6c\x0f\x1b\x29\xea\xf8\xf5\x10\x1d\x62\xe9\x00\x92\xa7\x7b\x88\x22\x31\x46\xe8\x7d\xae\x21\x89\xfd\xa1\x60\x0a\x6f\x86\x7a\x9b\x42\xc9\x4a\x2c\x2e\x0e\x71\xcb\xeb\x74\x12\x07\xed\x29\xbc\x39\xe2\x80\x01\x75\x93\xcf\x6b\x74\x16\xb2\x7f\xe4\xc5\x2a\x5f\x90\xe5\x8c\x97\xc7\x24\x30\xbb\xba\x18\x68\x7f\x12\x58\x97\xbd\x72\x44\x89\xbd\x80\x8a\x16\xb3\x61\xb2\x33\x46\x71\x38\x1e\x8b\x5e\xaa\xba\x5d\xcb\x43\x4f\x41\x8d\x35\x72\x69\x83\x02\xff\xed\xe2\x28\x8d\x03\x1e\x3f\xd4\xb5\xfa\x0e\x8e\x20\xe4\x82\x81\x76\xe4\x54\x84\x41\xa2\x60\x7c\xb0\x28\x8d\x50\xd2\x80\xd2\x8c\x48\xb0\xb8\x6e\xea\xdc\xa2\xc9\x98\xfd\xd8\xee\x77\x61\x97\x70\x62\xd7\x4d\x6d\x08\x56\xeb\xdc\x16\xcb\x1b\x2f\x77\x8c\x14\x27\x94\xd0\xc9\xe9\x68\x0b\x66\x9d\xcb\x05\x3a\x13\x64\xc1\xdb\x72\x60\xa2\xfd\x87\xe0\xd6\xcb\x9c\x6c\x55\x8f\x61\xec\x59\x74\x8a\x0a\x44\x19\xe8\x62\x87\x4c\x07\x99\xfc\xc5\xaf\xfd\x0d\x29\x99\xc9\x80\x3d\x06\xa5\x21\x4a\x5e\xd8\xa9\xa2\xb0\x7c\x24\x22\x7f\xc8\x8a\x4f\xe8\x50\x60\xfa\x90\xee\x49\xf9\xb9\xa8\xaa\xe7\x62\xe2\x10\xbc\xc5\x29\xe4\x4d\x83\xb2\x4c\x86\xab\xe3\xd7\xe3\xaf\x7a\x0a\x7d\x7c\xbe\x0b\x1f\xe9\x8b\x78\xac\x0e\xd1\x38\xa0\x16\x27\x71\x6d\x75\x5b\x58\x8e\x87\xea\x9d\x0f\x4e\xf7\x56\x65\x9f\x45\x5d\x53\xf9\x40\xd7\x51\xb9\xba\x34\xb2\xe7\x67\x73\x8b\x2e\xb7\x1f\xcb\x05\x6e\x53\x4b\x0e\xcd\x53\x69\xc5\xbd\x20\x66\x57\x86\x32\x5b\xa3\x4c\x58\x2f\x85\x1f\x3d\x83\x6e\xa1\xce\x65\x51\xc2\x09\x8c\xc8\xd1\x88\xdc\x8e\xe8\xfd\x32\x23\xb0\xba\x45\x18\xfd\x0b\xb5\x1a\xc1\x48\x8a\xda\x63\x9c\x94\xfb\xd2\xd9\x2d\x89\x12\x2b\x64\x2b\x19\xb1\xd1\x66\x72\xea\xbb\x89\x92\x3a\x11\x12\x68\x9b\x32\xb7\x98\x31\xee\x5d\xcd\xed\xb3\xb9\xbb\x68\x77\xe8\xbd\xdb\xe7\xc5\x31\x90\x87\xf4\x30\x73\xbb\x5c\xcc\x1a\xb1\xeb\x68\xbc\xc4\xf3\xcd\xcd\xd7\x79\x5b\xaf\x7e\x87\x0e\x27\x9e\x4c\x80\x5a\x11\xcf\xf7\x86\x69\x6a\x48\xda\x44\x4e\xc2\x0a\x34\xa1\x5b\x2b\x73\x9b\xcf\x73\x83\xd9\x6b\x5f\x92\x67\x3a\x9d\xdb\xbb\x27\x7b\x1d\x4a\x90\xa7\xb8\x15\x92\xe0\x11\xee\x1c\x33\x76\xf6\x5f\x13\xef\xdb\xa4\x69\x1c\xf5\x78\x0c\x56\x76\xdd\xbd\xa4\xce\x08\x56\x7a\x68\xe1\x17\xb7\xf4\xb2\x6e\xa5\x34\x08\xce\x3b\xd7\xcb\x53\xa2\x8c\x77\xca\x64\x22\x40\x48\x3b\x76\xdd\xf0\x41\xaa\xb8\x2a\x06\xd7\xfe\x94\xb9\x5b\x71\x17\x40\xcb\xac\xfc\xf7\xdc\x5c\x61\x95\xb7\xb5\x0d\xd5\xe1\x25\xb3\xd2\x2d\x9b\x24\x3d\x44\x39\x3d\xe3\xeb\xd6\x82\x3f\x2c\x4c\xdd\x27\xfc\x44\x71\x72\xb0\x47\xee\x73\x0c\x6b\x08\xbc\x99\x42\xf2\xab\x63\xd9\xed\x8d\x46\x51\x14\x18\x21\x90\xef\x3a\xf3\x9d\x45\xd0\xf3\x37\xc3\x21\x11\x9f\xfc\x10\x68\x77\xb7\x73\xac\xd6\x36\xe3\x76\xb3\x4a\x46\xad\xc4\x87\x06\x0b\x8b\x25\xf4\x84\x43\xed\x1e\xfc\xe1\x66\x34\x86\xb5\x33\xd5\x05\x83\xbe\x23\x0e\x49\x28\x96\x58\xac\x92\xc3\x4e\x37\x3a\xd2\xa9\xf6\x66\x82\x72\xef\x6e\xda\x7b\xe6\x7d\x06\xdd\xad\xb8\x1b\x03\x83\xf8\x56\xdc\xc1\xc0\xe3\x4e\x8f\xee\x73\x4d\xde\x39\x51\x21\x4c\x01\x7f\x65\x80\x05\x00\xa6\x67\x6f\x43\x5c\x5f\x39\x9c\xe0\x53\xd1\x95\xff\xf1\xed\x9d\xcb\x20\x26\x84\x9e\xc3\xbe\x7e\x8b\x0e\x12\x0d\xc1\xfa\xd4\xb8\x66\xd7\x5b\x9f\x4c\x60\x26\xef\xd5\x8a\x5b\x67\xc8\x0b\xdb\xe6\x35\xa8\x06\xb5\x3b\xa9\x72\x1c\xc0\x5d\x89\xdd\xe6\xdb\x53\x43\xb1\xcc\x85\xcc\x9c\x21\x9f\xeb\xc1\xf0\xf1\x13\xf5\x2a\xae\x78\x9f\x9f\x3e\xde\x1c\x53\xe1\x47\x94\x99\xff\xc2\xa5\xb5\x3b\x7a\x6b\xff\xc5\x8c\x12\xed\xcf\x29\xdb\x9b\xf6\xff\xba\x1d\xf0\x66\xa5\x92\xd4\x7b\xd0\xfb\x33\x84\xd5\x6b\xe1\xf3\xbf\x8e\x3b\xd1\xff\x7d\xe2\x09\xf5\xdf\x0f\x3d\xd1\x4b\x53\x47\xb4\x7d\xed\x6f\xc5\xdd\xce\xf4\x73\x40\x26\xfd\x0c\x14\xaa\xe1\xe8\x18\x34\xa8\x9b\xe7\x86\xa1\xd7\x44\xd6\x1d\x8d\x62\xef\x6b\xb8\x9f\xbe\x56\x69\x3c\xea\x3b\xa7\x9e\xbc\xa9\x08\x43\xe9\x2e\x95\x5a\x99\x14\xce\xe0\xed\x7b\x10\xf0\xe3\x14\xce\xdf\x83\x38\x3b\xdb\x72\xdb\xa0\xcc\x59\xf6\x56\xdc\x51\x05\xa7\x61\x4e\x8b\xb6\x25\x7b\xe7\x0a\x98\xfa\x84\x44\x8c\xa1\xb0\x0f\x29\xcf\xc2\xa2\xda\xad\xfb\xbe\x25\xa2\x49\x73\x1c\xe8\xab\xb7\x73\xde\x17\xfe\xd1\x8a\xea\xeb\xfe\x7c\x50\xf5\x87\x65\x73\x88\xd5\x8e\x83\x19\xe6\xa8\x9f\x1f\x7d\xc3\xf0\x9b\xfb\x01\x68\x85\xfc\x6d\x0c\xf3\xd6\x42\x93\x4b\x51\x18\x07\x6e\xc7\x67\xa0\x8a\xa2\xd5\xe6\x3f\xea\x15\x7e\x3b\xde\x2c\xec\x3d\xde\x3c\x6d\xf6\x09\xd9\x3f\x78\xe8\x39\xb6\x3f\x83\x0c\xce\xcb\x61\x32\x09\x0c\x4f\x79\x1f\x77\x83\x6e\xec\xdf\x01\x00\x00\xff\xff\x4b\xc0\x45\x3b\x2e\x13\x00\x00") func templateDialectSqlCreateTmplBytes() ([]byte, error) { return bindataRead( @@ -645,7 +645,7 @@ func templateDialectSqlCreateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/create.tmpl", size: 5061, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/dialect/sql/create.tmpl", size: 4910, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -670,7 +670,7 @@ func templateDialectSqlDecodeTmpl() (*asset, error) { return a, nil } -var _templateDialectSqlDeleteTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x52\xd1\x6a\x1b\x31\x10\x7c\x3e\x7d\xc5\x10\x42\xb1\x8d\x2b\xa7\x79\xab\x4b\x0a\xa9\x93\x80\xa1\x84\x80\xf3\x56\x4a\x51\xa4\x3d\x5b\x44\x91\x64\x49\x17\x12\x0e\xfd\x7b\x91\xec\x33\x97\xf6\xe1\x74\xd2\xce\xcc\xee\x6a\xb4\x7d\xbf\x98\xb1\x95\xf3\xef\x41\x6f\x77\x09\x97\x17\x5f\xbe\x7e\xf6\x81\x22\xd9\x84\x3b\x21\xe9\xc9\xb9\x67\xac\xad\xe4\xb8\x36\x06\x95\x14\x51\xf0\xf0\x4a\x8a\xb3\xc7\x9d\x8e\x88\xae\x0b\x92\x20\x9d\x22\xe8\x08\xa3\x25\xd9\x48\x0a\x9d\x55\x14\x90\x76\x84\x6b\x2f\xe4\x8e\x70\xc9\x2f\x06\x14\xad\xeb\xac\x62\xda\x56\xfc\xe7\x7a\x75\x7b\xbf\xb9\x45\xab\x0d\xe1\x18\x0b\xce\x25\x28\x1d\x48\x26\x17\xde\xe1\x5a\xa4\x51\xb1\x14\x88\x38\x9b\x2d\x72\x66\xac\xef\xa1\xa8\xd5\x96\x70\xa6\xb4\x30\x24\xd3\x22\xee\xcd\x42\x91\xa1\x44\x67\xc8\xb9\x30\xce\x9f\x3a\x6d\x4a\x3f\xcb\x2b\x78\x11\xa5\x30\x38\xe7\x1b\xe9\x3c\xf1\x1f\x47\xe4\x48\x0c\x24\x49\xbf\x1e\x98\xa7\xfd\x49\x7e\x24\xbd\x74\x49\x24\xed\x6c\x4d\x17\xb4\x4d\x23\xdd\x19\x1f\xd0\x5a\x9c\xb5\x9d\x95\x98\x8c\x53\xe7\x8c\xd9\xb8\xa7\x9c\xa7\x88\x7b\x73\xfb\x46\x72\x22\xd3\x1b\xa4\xb3\x89\xde\x12\x5f\x1d\xfe\x53\x4c\xb4\x4d\x73\x50\x08\x2e\x4c\xd1\xb3\xe6\x4f\xf4\x24\x4b\xed\x4f\x71\x6f\xb6\x41\xf8\x1d\xbf\xa9\xd7\xdd\x78\x92\x3d\x6b\x9a\x7b\xa7\x68\x39\x42\xcb\x79\xc0\x9a\x47\xf1\x64\x68\x89\xd2\x01\x7f\x10\xf2\x59\x6c\x09\x39\xf3\x1a\x9e\x17\xc2\xfa\x66\xac\xbd\xd3\x64\xd4\x49\xdc\x3c\xbe\x7b\x5a\xa2\x2d\x41\x5e\x53\xac\x6f\x78\x89\x95\x6e\x63\xba\x17\x2f\x25\x59\x4d\xd3\xac\x9c\xe9\x5e\xec\xff\x95\x06\x59\x55\x08\x9b\x06\x41\x5d\xcb\x92\x59\xa3\x5b\xf8\x58\xae\xf8\xc1\xee\x9c\xb9\x0f\xa4\xb4\x14\x89\xe2\x37\x18\xb2\x13\x1f\xa7\xf8\x8e\x8b\x62\xcb\xc1\x17\xfe\x30\x30\x70\x85\x62\xfe\x24\x92\xa9\x63\x84\x59\xdc\x1b\xbe\x39\x9e\xaa\x93\x4d\xd3\xba\x00\x5d\x1f\x5b\xd8\x2d\x95\xa2\x87\x7b\xfa\xf8\x4b\xff\x3e\x49\xa7\xb5\x3f\x56\xbf\xcc\x9a\x40\xa9\x0b\x16\xff\xb8\x5f\x5c\x8e\xe5\x05\xe7\xf8\xf8\xdc\x5c\x85\xb2\x99\xa3\x36\x38\x65\x87\xa9\x25\xab\xca\x80\xfc\x0d\x00\x00\xff\xff\x34\x05\x1c\x43\x84\x03\x00\x00") +var _templateDialectSqlDeleteTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x53\x5f\x6b\xdb\x30\x10\x7f\xb6\x3e\xc5\x51\xc2\x48\x42\x2a\x77\x7d\x5b\x46\x07\x5d\xda\x42\x60\x84\x42\xf2\x36\xc6\x50\xa4\x73\x2c\xaa\x48\x8a\x24\xb7\x09\x46\xdf\x7d\x48\xb6\xb3\x74\xeb\x43\x1c\xf9\x7e\x7f\xee\x24\xff\xd4\xb6\xe5\x94\x2c\x8c\x3d\x39\xb9\xab\x03\xdc\xde\x7c\xfe\x72\x6d\x1d\x7a\xd4\x01\x9e\x18\xc7\xad\x31\x2f\xb0\xd4\x9c\xc2\xbd\x52\x90\x49\x1e\x12\xee\x5e\x51\x50\xb2\xa9\xa5\x07\x6f\x1a\xc7\x11\xb8\x11\x08\xd2\x83\x92\x1c\xb5\x47\x01\x8d\x16\xe8\x20\xd4\x08\xf7\x96\xf1\x1a\xe1\x96\xde\x0c\x28\x54\xa6\xd1\x82\x48\x9d\xf1\x1f\xcb\xc5\xe3\x6a\xfd\x08\x95\x54\x08\x7d\xcd\x19\x13\x40\x48\x87\x3c\x18\x77\x02\x53\x41\xb8\x68\x16\x1c\x22\x25\xd3\x32\x46\x42\xda\x16\x04\x56\x52\x23\x5c\x09\xc9\x14\xf2\x50\xfa\x83\x2a\x05\x2a\x0c\x78\x05\x31\x26\xc6\x68\xdb\x48\x95\xe6\x99\xdf\x81\x65\x9e\x33\x05\x23\xba\xe6\xc6\x22\xfd\xde\x23\x3d\xd1\x21\x47\xf9\xda\x31\xcf\xeb\xb3\xbc\x27\xed\x9b\xc0\x82\x34\x3a\xdb\x39\xa9\xc3\x85\xee\x8a\x0e\x68\x6e\x4e\xaa\x46\x73\x18\x5f\x5a\xc7\x08\xd3\xcb\x99\x62\x9c\x80\x3f\xa8\xc7\x23\xf2\x31\x0f\x47\xe0\x46\x07\x3c\x06\xba\xe8\xfe\x27\x30\x96\x3a\xcc\x00\x9d\x33\x6e\x02\x2d\x29\x7e\x7b\x8b\x3c\xf5\xfe\xe4\x0f\x6a\xe7\x98\xad\xe9\x43\xde\xee\xda\x22\x6f\x49\x51\xac\x8c\xc0\xf9\x05\x9a\xde\x07\xac\xd8\xb0\xad\xc2\x39\xa4\x09\xe8\x33\xe3\x2f\x6c\x87\x10\x23\xcd\xe5\x59\x22\x2c\x1f\x2e\xb5\x4f\x12\x95\x38\x8b\x8b\xcd\xc9\xe2\x1c\xaa\x54\xa4\xd9\x62\xf9\x40\x53\x2d\x4d\xeb\xc3\x8a\xed\x93\x59\xb6\x29\x16\x46\x35\x7b\xfd\x7f\xa7\x41\x96\x15\x4c\x87\x41\x90\x9f\xe9\x11\x49\xd1\xb6\xd7\x50\x4e\x53\xec\xcc\x1b\x74\x07\xaa\x77\x39\x19\x1f\x6c\x19\xb6\x27\x48\x91\xc5\x63\x40\xed\xa5\xd1\x1e\x8c\x83\xc6\xa7\xfc\xe1\xde\x2a\x16\xd0\xd3\x9c\x96\xec\xfb\x26\x43\x0d\xa3\xb0\xb7\xca\xa7\x43\xdc\xb3\xc0\xeb\x4d\xcf\xfb\x28\x44\x65\x3a\xee\x72\x9a\x3f\x67\x91\x1d\x1c\xd3\x3b\xec\x2c\x92\x43\xef\x95\xe1\x8c\x1f\x87\xb6\x3d\x67\xf4\x57\x8a\x5a\xc0\x30\xc8\xb0\x96\x15\xd8\x3c\xca\xbb\x6c\xc5\x48\xad\x43\x21\x79\x1a\xff\x2b\x28\xd4\x63\xeb\x27\xf0\x0d\x6e\x52\x06\xba\x10\xd0\xe7\x81\x01\x77\x90\x92\x36\xf6\xa8\xf2\x9d\x81\xa9\x3f\x28\xba\xee\xdf\x72\x6c\x8a\xa2\x32\x0e\x64\x4e\x76\xde\x80\xf5\x5d\xb9\xb0\xfe\xa7\xfc\x75\x96\x4e\xf2\xc7\x20\xf9\x17\x49\xe1\x30\x34\x4e\xff\x7b\xee\x29\x52\x3e\xc5\x75\x06\xef\xb3\x4d\x85\x4b\x8b\x19\xe4\x01\x27\xa4\xbb\xa2\xfd\x56\xff\x04\x00\x00\xff\xff\x79\x70\x87\xa8\x71\x04\x00\x00") func templateDialectSqlDeleteTmplBytes() ([]byte, error) { return bindataRead( @@ -685,7 +685,7 @@ func templateDialectSqlDeleteTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/delete.tmpl", size: 900, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/dialect/sql/delete.tmpl", size: 1137, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/dialect/sql/delete.tmpl b/entc/gen/template/dialect/sql/delete.tmpl index 9aab59bfa..1d634d85b 100644 --- a/entc/gen/template/dialect/sql/delete.tmpl +++ b/entc/gen/template/dialect/sql/delete.tmpl @@ -19,6 +19,12 @@ func ({{ $receiver}} *{{ $builder }}) sqlExec(ctx context.Context) (int, error) }, }, } + {{- /* Allow mutating the sqlgraph.DeleteSpec by ent extensions or user templates.*/}} + {{- with $tmpls := matchTemplate "dialect/sql/delete/spec/*" }} + {{- range $tmpl := $tmpls }} + {{- xtemplate $tmpl $ }} + {{- end }} + {{- end }} if ps := {{ $mutation }}.predicates; len(ps) > 0 { _spec.Predicate = func(selector *sql.Selector) { for i := range ps {