From 0447ddda2fa7fe572b688c17bc7dfaae2a4bf344 Mon Sep 17 00:00:00 2001 From: bbarcklay-cpi Date: Mon, 15 Feb 2021 16:27:49 -0800 Subject: [PATCH] Generates whereHelper In/Nin functions for nullable primitive types. --- boilingcore/templates.go | 7 ++++--- boilingcore/text_helpers.go | 16 ++++++++++++++++ templatebin/bindata.go | 6 +++--- templates/00_struct.go.tpl | 2 +- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/boilingcore/templates.go b/boilingcore/templates.go index 7a9eed0f2..f37a85f5f 100644 --- a/boilingcore/templates.go +++ b/boilingcore/templates.go @@ -299,9 +299,10 @@ var templateFunctions = template.FuncMap{ "whereClause": strmangle.WhereClause, // Alias and text helping - "aliasCols": func(ta TableAlias) func(string) string { return ta.Column }, - "usesPrimitives": usesPrimitives, - "isPrimitive": isPrimitive, + "aliasCols": func(ta TableAlias) func(string) string { return ta.Column }, + "usesPrimitives": usesPrimitives, + "isPrimitive": isPrimitive, + "isNullPrimitive": isNullPrimitive, "splitLines": func(a string) []string { if a == "" { return nil diff --git a/boilingcore/text_helpers.go b/boilingcore/text_helpers.go index 9f6a7da9c..0e9ac6523 100644 --- a/boilingcore/text_helpers.go +++ b/boilingcore/text_helpers.go @@ -151,3 +151,19 @@ func isPrimitive(typ string) bool { return false } + +func isNullPrimitive(typ string) bool { + switch typ { + // Numeric + case "null.Int", "null.Int8", "null.Int16", "null.Int32", "null.Int64": + return true + case "null.Uint", "null.Uint8", "null.Uint16", "null.Uint32", "null.Uint64": + return true + case "null.Float32", "null.Float64": + return true + case "null.Byte", "null.String": + return true + } + + return false +} diff --git a/templatebin/bindata.go b/templatebin/bindata.go index b9a489f8e..fd5895b64 100644 --- a/templatebin/bindata.go +++ b/templatebin/bindata.go @@ -1,6 +1,6 @@ // Code generated by go-bindata. DO NOT EDIT. // sources: -// templates/00_struct.go.tpl (7.222kB) +// templates/00_struct.go.tpl (7.251kB) // templates/01_types.go.tpl (2.472kB) // templates/02_hooks.go.tpl (6.687kB) // templates/03_finishers.go.tpl (7.298kB) @@ -113,7 +113,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _templates00_structGoTpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x58\xdd\x6f\xdb\x36\x10\x7f\xb6\xfe\x8a\x83\x91\x0e\x76\xe0\x28\x7b\x0e\x50\x0c\x5d\x9a\x66\xd9\x5c\xb7\x49\xbc\xed\xa1\x28\x1a\x46\x3e\x2b\xec\x24\xd2\x25\xe9\xa6\x86\xca\xff\x7d\xe0\x87\x3e\x2d\x39\x76\x92\x36\xed\x93\x65\xf1\x3e\x7e\xf7\xe3\xf1\x78\xba\x2c\x3b\x80\x3d\x92\x50\x22\xe1\xe8\x39\x84\x2f\xcc\x13\xca\x70\x4a\xae\x13\x04\xf7\x13\x4e\x48\x8a\x70\xa0\x75\x60\x85\xb9\xa0\xf1\x07\x75\x9d\x7c\x60\xe6\xb5\x51\x6a\x48\x05\x87\x87\x90\x65\xce\x68\xf8\xf7\xe2\x92\xb2\x78\x99\x10\xa1\x35\x50\x09\x84\x01\xbf\xfe\x88\x91\x02\x81\x0b\x81\x12\x99\xa2\x2c\x06\x75\x83\x30\x23\x8a\x5c\x13\x89\xa0\xac\xbd\x40\xad\x16\xd8\x61\x48\x2a\xb1\x8c\x14\x64\x41\xcf\x40\x12\x84\xc5\x08\x7b\x11\x4f\x96\x29\xab\x20\x3a\xb6\x2f\xa4\x05\x65\x05\x8d\xc8\x8b\x3c\x56\x6f\xd7\x09\xe5\xda\x65\x14\xbd\x32\xd8\x88\x97\xc1\xb6\xcb\xd5\x10\x84\xc7\x3c\x4d\x91\x29\xf8\x0a\x72\x91\x50\x35\xa6\x0c\x2d\x08\xb0\xc4\x40\x08\x4e\x0d\xd9\x2c\xb7\x40\xe7\x40\x63\xc6\x05\x36\xe9\x6d\x00\xd8\x0b\xa7\x24\x3e\x73\x92\x5e\xb5\x88\x49\x6b\x70\xff\x0c\x84\xe9\x6a\x81\x5a\xc3\x55\x96\xc5\xc8\x50\x10\x85\x4e\x6b\x4a\x62\xe9\xac\x48\xad\xaf\x39\x4d\x8e\xfa\xa5\x92\x89\x49\xeb\x3e\x7c\x94\x9c\x1d\xf5\x0f\xfa\xa0\x78\x9a\xd8\x87\x15\x71\x0f\x57\x16\x77\x22\x11\xe8\x1c\xf0\x13\xec\x85\x97\x76\x27\xa6\x24\x3e\x26\xd2\x6c\x64\x5f\x51\x95\x60\x7f\x57\x74\x15\x5c\x50\x87\xb3\x19\x64\xfd\x3d\x7c\x05\xeb\xfe\x98\x48\xd4\xda\xd2\x5a\x2c\x2f\x93\xc4\x24\x85\xd6\x23\x9e\x52\x85\xe9\x42\xad\xec\x16\x18\x5b\x2e\xce\x4d\xb6\x72\x0a\x1e\xc5\xdf\x16\x2c\x46\x24\xc5\xe4\xe9\x58\xb4\xee\x1f\x89\xc5\x8a\xad\x4e\x16\xef\xe3\x6f\x0b\x16\xed\x09\x7f\x30\x8b\x5e\x67\x1b\x0a\xbd\xe8\xfd\x38\xf3\xca\x75\x92\x76\xb5\x58\xb2\xf2\x24\xb9\xf3\xd0\x7c\xe9\xca\x91\x9d\x19\x28\x6b\x6b\xe5\xf1\xc0\xa4\x8a\xbf\x1c\xce\xe4\x9f\x9c\x32\x77\xcf\x15\xcb\x86\x38\xf3\x7c\x01\xfb\xc5\xc5\xf3\x92\xdf\xb2\xf2\xea\xb9\xe8\xe4\x2c\xbc\xc0\x84\x28\xca\xd9\x94\xc4\x15\xd2\xea\xaf\x2b\xac\x35\x17\x0a\x3a\x9a\x0b\x05\x1f\x8d\x85\xab\xa0\x37\x86\x0e\x98\xe3\xad\x4a\xff\xc1\xdd\xb5\xde\x93\xa7\x83\xe0\x33\x11\xed\xb7\x71\x7e\xcd\x3e\xaf\x5d\xcb\xdf\xea\x52\xae\xe6\xb3\x54\x82\xb2\xb8\x86\xf3\x7b\xf9\x3e\x82\xf5\xcc\x1d\x35\x18\xcb\xb2\xc3\x7d\x38\xf5\x9b\x30\x83\xdb\x1b\x14\x08\x37\x98\x2c\x50\x48\x98\x73\x01\x24\x49\xc0\x74\x39\x12\x28\xab\xb7\x40\xfb\x87\x5a\x9b\x3e\xaa\xa1\x1d\x94\xcd\x46\x57\x48\x74\x0e\x03\xce\x22\x7c\xbb\x54\xb0\x17\xbe\xfc\x7d\x6a\xed\xdb\x03\x3f\xf4\x51\xe4\xbd\xcc\x42\x50\xa6\xe6\xd0\xb7\xa6\xff\xb0\xb8\x9e\xc9\x3e\x0c\x62\xfe\x0f\x11\x56\xa8\x50\xcb\x7b\x31\x66\x23\x2d\x36\x1a\xe6\x14\x93\x99\xdf\x07\xd0\xc1\x7c\xc9\x22\x18\xdc\x96\x92\x43\x38\x39\x1f\x7c\x81\x2c\xf3\x15\x67\x08\x9f\xd2\xf0\x7c\x89\x62\xf5\x9a\xcf\x20\x03\x81\x6a\x29\x18\x7c\x4a\x1d\x2d\xe1\xbf\x06\x8a\x3d\xea\x95\x33\x6e\x9e\x4e\xce\x07\xb7\xa1\xf5\x36\x82\x39\x49\x24\x8e\xe0\xcb\xd0\x55\x3a\xad\xcb\xa5\xc2\xd0\xc9\xb9\x17\x30\x35\xa1\x1d\xd9\xe4\x1b\x40\x53\x62\x79\x17\xb2\x49\x13\x5a\xdd\xa6\xdd\xc9\x16\xb4\x67\xd2\x48\x0c\xb6\x42\xe9\x65\xbd\xef\x61\x7b\xf8\x67\x72\xc2\xd5\x4e\x36\xbd\x78\xc5\x6c\x99\xee\x2d\x0e\xc6\xd3\x9d\xe9\x6d\xa1\x6b\x3c\x35\x6c\xb5\x87\x30\x9e\x9e\x3c\x8e\x8b\x93\x6e\x1f\xa7\x8f\x12\xc5\xe9\x86\x28\x4e\x1f\x27\x8a\xd3\x22\x0a\xf7\x3d\x21\xdf\x0a\x9a\x52\x45\x3f\xfb\x63\xdc\x99\x58\x93\x81\x4c\x68\x84\xf0\xee\x7d\x17\x86\x00\xe0\x33\x49\x96\x68\xcb\x64\x4a\xfe\xc3\xc1\xbb\xf7\x94\x29\x14\x73\x12\x61\xa6\x47\xf0\xeb\x08\x12\x64\xce\xce\x70\x18\x80\xad\x6e\x1f\x46\x4e\xcb\x28\xb9\x9a\xe5\xfc\x18\x73\x85\xc1\xe7\x40\x16\x0b\x64\xb3\x81\xfb\xef\x55\x8c\x09\x1d\x40\x19\xbb\xcf\x41\x36\x98\xa7\x2a\xbc\x74\x85\x6b\xd0\x7f\x26\xe1\x6c\x02\xbf\xf5\x47\x90\xe7\xa4\xd7\x97\x61\x18\x0e\x83\xf6\x53\xbf\x4d\xbc\xbd\x9d\xc2\xed\x6d\x8e\xb6\x77\x67\xb0\x3d\x1d\xf4\x1a\xa1\x4e\xb8\x6a\x89\x76\xf2\x66\xba\x31\x62\xa8\x9d\x49\xd7\xd2\xf8\x3f\xfe\x59\x6f\xba\xc9\xad\xe7\x27\xb8\xc7\x2b\x17\x50\x96\x95\xb7\x4f\xbd\x59\x7d\xa2\x6b\x7e\x2b\x6c\x99\xdd\x0b\xd7\x13\x54\xc7\x21\x5f\xcd\x57\x49\x74\x83\x29\x99\xba\xfb\x22\x5c\xfb\xf4\xd9\x0b\xcf\x97\x5c\xa1\x69\xfc\xf5\x7a\x03\xb1\xa9\x63\xad\x34\xac\x5d\x13\x97\x0b\x4c\x24\x50\xe9\x5b\x0f\xe1\xdb\x47\x79\x43\x17\x60\xa2\x90\x40\x04\x82\x54\x5c\xe0\x2c\xec\x4e\x0b\x6b\xa5\x2d\x2b\x3c\xb0\x57\x7f\xe1\xaa\xca\xb6\xc0\x35\xb6\x2f\xaa\xae\xeb\x64\xe7\xd2\xe1\x2b\x2e\x90\xc6\xac\xb5\xaf\x5b\xf3\x39\xe5\x6f\x18\x56\xad\x56\x01\xcc\xed\x04\xc9\xba\x6f\x4e\xb4\xbc\x93\x46\xdf\x5f\x87\xec\xd4\xb7\xc2\x3c\xe6\x11\x49\xb6\x45\xfc\x9a\xb0\x55\x17\xe4\x1a\x80\x02\x74\x53\xa3\x81\xdf\x81\x0a\xcb\xb4\xb0\x8f\x16\x93\xd9\x93\x1d\x21\xdb\x76\xd5\x41\x56\x3c\x25\x6c\xe5\xba\x50\xfd\xed\x37\xdc\x1d\x9c\xf5\xf7\xf5\x8e\xfa\x07\xcf\x81\x46\x10\xfe\xed\x9d\x21\xfc\x50\x49\xb1\x45\x0c\x5d\x59\x52\x1f\xfb\x36\x3f\x9a\x5b\x6b\x50\xbd\xfc\xd4\xc7\xbd\x4d\x03\x5b\x17\x9f\x07\xee\xfb\x7d\xca\xd5\x7e\x96\xe5\xf9\x52\x9b\x52\x77\x4d\x0a\xd6\x4d\x14\xd3\x82\x96\x33\x50\x4e\x0c\xda\x16\x8b\xa9\x41\xdb\x62\x31\x39\x68\x59\xbc\xfa\x89\x8e\xd6\xfd\x19\xf6\x06\xd6\xf9\xcd\x53\xbb\x85\xdd\x62\x69\x9d\xdb\x62\x69\x9d\xd9\x7c\xe9\x2e\x5e\x37\x9d\xf7\x07\x12\xfb\x5d\xae\x8d\x2c\xcb\xc7\x06\xcf\xe4\xa5\xe9\x70\xfb\xf0\x33\x6e\xcd\xc6\x32\x36\xc1\x5b\x37\x4b\x86\x48\x20\x51\xa6\x4f\x02\x86\xb7\xf5\x06\xca\x55\x24\xff\x89\xd1\x39\x2e\x1c\x96\xc6\x06\xc3\x0d\x53\xc5\xac\xf8\x02\xf8\xa5\x4b\x26\xbb\xa3\xca\x8e\xcb\x2a\x3b\xe6\x64\x06\x29\xaa\x1b\x3e\x73\x93\x26\x24\xd1\x4d\x1d\xfe\xb6\xa5\x77\xec\x03\xcd\xaa\x5f\x16\xff\x07\x00\x00\xff\xff\x87\xa0\x58\x05\x36\x1c\x00\x00") +var _templates00_structGoTpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x58\xdd\x6f\xdb\x36\x10\x7f\xb6\xfe\x8a\x83\x91\x0e\x76\xe0\x28\x7b\x0e\x50\x0c\x5d\x9a\x66\xd9\x5c\xb7\x49\xbc\xed\xa1\x28\x1a\x46\x3e\x2b\xec\x24\xd2\x25\xe9\xa6\x86\xca\xff\x7d\xe0\x87\x3e\x2d\x39\x76\x92\x36\xed\x93\x65\xf1\x3e\x7e\xf7\xe3\xf1\x78\xba\x2c\x3b\x80\x3d\x92\x50\x22\xe1\xe8\x39\x84\x2f\xcc\x13\xca\x70\x4a\xae\x13\x04\xf7\x13\x4e\x48\x8a\x70\xa0\x75\x60\x85\xb9\xa0\xf1\x07\x75\x9d\x7c\x60\xe6\xb5\x51\x6a\x48\x05\x87\x87\x90\x65\xce\x68\xf8\xf7\xe2\x92\xb2\x78\x99\x10\xa1\x35\x50\x09\x84\x01\xbf\xfe\x88\x91\x02\x81\x0b\x81\x12\x99\xa2\x2c\x06\x75\x83\x30\x23\x8a\x5c\x13\x89\xa0\xac\xbd\x40\xad\x16\xd8\x61\x48\x2a\xb1\x8c\x14\x64\x41\xcf\x40\x12\x84\xc5\x08\x7b\x11\x4f\x96\x29\xab\x20\x3a\xb6\x2f\xa4\x05\x65\x05\x8d\xc8\x8b\x3c\x56\x6f\xd7\x09\xe5\xda\x65\x14\xbd\x32\xd8\x88\x97\xc1\xb6\xcb\xd5\x10\x84\xc7\x3c\x4d\x91\x29\xf8\x0a\x72\x91\x50\x35\xa6\x0c\x2d\x08\xb0\xc4\x40\x08\x4e\x0d\xd9\x2c\xb7\x40\xe7\x40\x63\xc6\x05\x36\xe9\x6d\x00\xd8\x0b\xa7\x24\x3e\x73\x92\x5e\xb5\x88\x49\x6b\x70\xff\x0c\x84\xe9\x6a\x81\x5a\xc3\x55\x96\xc5\xc8\x50\x10\x85\x4e\x6b\x4a\x62\xe9\xac\x48\xad\xaf\x39\x4d\x8e\xfa\xa5\x92\x89\x49\xeb\x3e\x7c\x94\x9c\x1d\xf5\x0f\xfa\xa0\x78\x9a\xd8\x87\x15\x71\x0f\x57\x16\x77\x22\x11\xe8\x1c\xf0\x13\xec\x85\x97\x76\x27\xa6\x24\x3e\x26\xd2\x6c\x64\x5f\x51\x95\x60\x7f\x57\x74\x15\x5c\x50\x87\xb3\x19\x64\xfd\x3d\x7c\x05\xeb\xfe\x98\x48\xd4\xda\xd2\x5a\x2c\x2f\x93\xc4\x24\x85\xd6\x23\x9e\x52\x85\xe9\x42\xad\xec\x16\x18\x5b\x2e\xce\x4d\xb6\x72\x0a\x1e\xc5\xdf\x16\x2c\x46\x24\xc5\xe4\xe9\x58\xb4\xee\x1f\x89\xc5\x8a\xad\x4e\x16\xef\xe3\x6f\x0b\x16\xed\x09\x7f\x30\x8b\x5e\x67\x1b\x0a\xbd\xe8\xfd\x38\xf3\xca\x75\x92\x76\xb5\x58\xb2\xf2\x24\xb9\xf3\xd0\x7c\xe9\xca\x91\x9d\x19\x28\x6b\x6b\xe5\xf1\xc0\xa4\x8a\xbf\x1c\xce\xe4\x9f\x9c\x32\x77\xcf\x15\xcb\x86\x38\xf3\x7c\x01\xfb\xc5\xc5\xf3\x92\xdf\xb2\xf2\xea\xb9\xe8\xe4\x2c\xbc\xc0\x84\x28\xca\xd9\x94\xc4\x15\xd2\xea\xaf\x2b\xac\x35\x17\x0a\x3a\x9a\x0b\x05\x1f\x8d\x85\xab\xa0\x37\x86\x0e\x98\xe3\xad\x4a\xff\xc1\xdd\xb5\xde\x93\xa7\x83\xe0\x33\x11\xed\xb7\x71\x7e\xcd\x3e\xaf\x5d\xcb\xdf\xea\x52\xae\xe6\xb3\x54\x82\xb2\xb8\x86\xf3\x7b\xf9\x3e\x82\xf5\xcc\x1d\x35\x18\xcb\xb2\xc3\x7d\x38\xf5\x9b\x30\x83\xdb\x1b\x14\x08\x37\x98\x2c\x50\x48\x98\x73\x01\x24\x49\xc0\x74\x39\x12\x28\xab\xb7\x40\xfb\x87\x5a\x9b\x3e\xaa\xa1\x1d\x94\xcd\x46\x57\x48\x74\x0e\x03\xce\x22\x7c\xbb\x54\xb0\x17\xbe\xfc\x7d\x6a\xed\xdb\x03\x3f\xf4\x51\xe4\xbd\xcc\x42\x50\xa6\xe6\xd0\xb7\xa6\xff\xb0\xb8\x9e\xc9\x3e\x0c\x62\xfe\x0f\x11\x56\xa8\x50\xcb\x7b\x31\x66\x23\x2d\x36\x1a\xe6\x14\x93\x99\xdf\x07\xd0\xc1\x7c\xc9\x22\x18\xdc\x96\x92\x43\x38\x39\x1f\x7c\x81\x2c\xf3\x15\x67\x08\x9f\xd2\xf0\x7c\x89\x62\xf5\x9a\xcf\x20\x03\x81\x6a\x29\x18\x7c\x4a\x1d\x2d\xe1\xbf\x06\x8a\x3d\xea\x95\x33\x6e\x9e\x4e\xce\x07\xb7\xa1\xf5\x36\x82\x39\x49\x24\x8e\xe0\xcb\xd0\x55\x3a\xad\xcb\xa5\xc2\xd0\xc9\xb9\x17\x30\x35\xa1\x1d\xd9\xe4\x1b\x40\x53\x62\x79\x17\xb2\x49\x13\x5a\xdd\xa6\xdd\xc9\x16\xb4\x67\xd2\x48\x0c\xb6\x42\xe9\x65\xbd\xef\x61\x7b\xf8\x67\x72\xc2\xd5\x4e\x36\xbd\x78\xc5\x6c\x99\xee\x2d\x0e\xc6\xd3\x9d\xe9\x6d\xa1\x6b\x3c\x35\x6c\xb5\x87\x30\x9e\x9e\x3c\x8e\x8b\x93\x6e\x1f\xa7\x8f\x12\xc5\xe9\x86\x28\x4e\x1f\x27\x8a\xd3\x22\x0a\x9b\x50\x5c\xc0\x80\xca\xb7\x82\xa6\x54\xd1\xcf\xf9\x51\x36\xef\xcc\x26\xae\xbd\xef\xca\xba\xc9\x40\x26\x34\x42\x78\xf7\xbe\x0b\x60\x00\xf0\x99\x24\x4b\xb4\x35\x34\x25\xff\xe1\xe0\xdd\x7b\xca\x14\x8a\x39\x89\x30\xd3\x23\xf8\x75\x04\x09\x32\x67\x67\x38\x0c\xc0\x96\xbe\x0f\x23\xa7\x65\x94\x5c\x41\x73\x7e\x8c\xb9\xc2\xe0\x73\x20\x8b\x05\xb2\xd9\xc0\xfd\xf7\x2a\xc6\x84\x0e\xa0\x24\xc6\x27\x28\x1b\xcc\x53\x15\x5e\xba\xaa\x36\xe8\x3f\x93\x70\x36\x81\xdf\xfa\x23\xc8\x13\xd6\xeb\xcb\x30\x0c\x87\x41\x7b\x49\xd8\x26\xde\xde\x4e\xe1\xf6\x36\x47\xdb\xbb\x33\xd8\x9e\x0e\x7a\x8d\x50\x27\x5c\xb5\x44\x3b\x79\x33\xdd\x18\x31\xd4\x0e\xac\xeb\x77\xfc\x1f\xff\xac\x37\x5d\xf3\xd6\xf3\x13\x5c\xf2\x95\xdb\x29\xcb\xca\xab\xa9\xde\xc9\x3e\x51\x0f\xb0\x15\xb6\xcc\xee\x85\x6b\x18\xaa\xb3\x92\xaf\xe6\x93\x25\xba\xc1\x94\x4c\xdd\x65\x12\xae\x7d\x17\xed\x85\xe7\x4b\xae\xd0\x7c\x15\xe8\xf5\xee\x62\x53\x3b\x5b\xe9\x66\xbb\xc6\x31\x17\x98\x48\xa0\xd2\xf7\x25\xc2\xf7\x96\xf2\x86\x2e\xc0\x44\x21\x81\x08\x04\xa9\xb8\xc0\x59\xd8\x9d\x16\xd6\x4a\x5b\x56\x78\x60\xaf\xfe\xc2\x55\x95\x6d\x81\x6b\x6c\x5f\x54\x5d\xd7\xc9\xce\xa5\xc3\x57\x5c\x20\x8d\x59\x6b\xd3\xb7\xe6\x73\xca\xdf\x30\xac\x5a\xad\x02\x98\xdb\xf1\x92\x75\xdf\x1c\x77\x79\x27\x8d\x8f\x82\x3a\x64\xa7\xbe\x15\xe6\x31\x8f\x48\xb2\x2d\xe2\xd7\x84\xad\xba\x20\xd7\x00\x14\xa0\x9b\x1a\x0d\xfc\x0e\x54\x58\xa6\x85\x7d\xb4\x98\xcc\x9e\xec\x08\xd9\xf6\xb2\x0e\xb2\xe2\x29\x61\x2b\xd7\xa2\xea\x6f\xbf\xe1\xee\xe0\xac\xbf\xaf\xb7\xdb\x3f\x78\x0e\x34\x82\xf0\x6f\xef\x0c\xe1\x87\x4a\x8a\x2d\x62\xe8\xca\x92\xfa\x4c\xb8\xf9\x45\xdd\x5a\x83\xea\xe5\xa7\x3e\x0b\x6e\x1a\xd8\xba\xf8\x3c\x70\xdf\xef\x53\xae\xf6\xb3\x2c\xcf\x97\xda\x08\xbb\x6b\x8c\xb0\x6e\xa2\x18\x25\xb4\x9c\x81\x72\x9c\xd0\xb6\x58\x8c\x14\xda\x16\x8b\xb1\x42\xcb\xe2\xd5\x4f\x74\xb4\xee\xcf\xb0\x37\xb0\xce\x6f\x9e\xda\x2d\xec\x16\x4b\xeb\xdc\x16\x4b\xeb\xcc\xe6\x4b\x77\xf1\xba\xe9\xbc\x3f\x90\xd8\xef\x72\x6d\x64\x59\x3e\x53\x78\x26\x2f\x4d\x87\xdb\x87\x9f\x71\x6b\x36\x96\xb1\x09\xde\xba\x41\x33\x44\x02\x89\x32\x7d\x12\x30\xbc\xad\x37\x50\xae\x22\xf9\x4f\x8c\xce\x59\xe2\xb0\x34\x36\x18\x6e\x18\x39\x66\xc5\x17\xc0\x2f\x5d\x32\xd9\x1d\x55\x76\x5c\x56\xd9\x31\x27\x33\x48\x51\xdd\xf0\x99\x1b\x43\x21\x89\x6e\xea\xf0\xb7\x2d\xbd\x63\x1f\x68\x56\xfd\xb2\xf8\x3f\x00\x00\xff\xff\xcf\x7f\x21\xb8\x53\x1c\x00\x00") func templates00_structGoTplBytes() ([]byte, error) { return bindataRead( @@ -129,7 +129,7 @@ func templates00_structGoTpl() (*asset, error) { } info := bindataFileInfo{name: "templates/00_struct.go.tpl", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x73, 0x2b, 0xdc, 0x47, 0x2d, 0x77, 0x3d, 0xe9, 0xea, 0x49, 0x65, 0xcc, 0x5, 0x13, 0xaa, 0x1b, 0x7f, 0x6c, 0xe5, 0x8a, 0x4, 0x17, 0x81, 0x97, 0x28, 0x2d, 0x2a, 0x64, 0x87, 0x10, 0xac, 0x85}} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xda, 0x2d, 0xad, 0xd1, 0x77, 0x6, 0x13, 0xea, 0x38, 0x4a, 0x24, 0xd2, 0xd3, 0xb6, 0x50, 0x7d, 0x90, 0x2, 0xe5, 0x37, 0x93, 0x5e, 0x56, 0xc, 0x35, 0x36, 0xcd, 0xc1, 0x1d, 0x4a, 0x13, 0xa8}} return a, nil } diff --git a/templates/00_struct.go.tpl b/templates/00_struct.go.tpl index 29647cc73..7891f9c9e 100644 --- a/templates/00_struct.go.tpl +++ b/templates/00_struct.go.tpl @@ -55,7 +55,7 @@ func (w {{$name}}) LT(x {{.Type}}) qm.QueryMod { return qmhelper.Where(w.field, func (w {{$name}}) LTE(x {{.Type}}) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) } func (w {{$name}}) GT(x {{.Type}}) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GT, x) } func (w {{$name}}) GTE(x {{.Type}}) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) } -{{if isPrimitive .Type -}} +{{if or (isPrimitive .Type) (isNullPrimitive .Type) -}} func (w {{$name}}) IN(slice []{{.Type}}) qm.QueryMod { values := make([]interface{}, 0, len(slice)) for _, value := range slice {