|
|
|
@ -32,7 +32,7 @@ func (m *default{{.upperStartCamelObject}}Model) FindOne(ctx context.Context, {{
|
|
|
|
|
|
|
|
|
|
// FindOneByField defines find row by field.
|
|
|
|
|
var FindOneByField = `
|
|
|
|
|
func (m *default{{.upperStartCamelObject}}Model) FindOneBy{{.upperField}}({{.in}}) (*{{.upperStartCamelObject}}, error) {
|
|
|
|
|
func (m *default{{.upperStartCamelObject}}Model) FindOneBy{{.upperField}}(ctx context.Context, {{.in}}) (*{{.upperStartCamelObject}}, error) {
|
|
|
|
|
{{if .withCache}}{{.cacheKey}}
|
|
|
|
|
var resp {{.upperStartCamelObject}}
|
|
|
|
|
err := m.QueryRowIndexCtx(ctx, &resp, {{.cacheKeyVariable}}, m.formatPrimary, func(ctx context.Context, conn sqlx.SqlConn, v interface{}) (i interface{}, e error) {
|
|
|
|
|