func (v *VenueSvc) Create(ctx context.Context, tx *sql.Tx, vdb *db.Venue, payload *model.CreateVenueRequest) (err error) {
	if pdebug.Enabled {
		g := pdebug.Marker("service.Venue.Create").BindError(&err)
		defer g.End()
	}
	if err := v.populateRowForCreate(ctx, vdb, payload); err != nil {
		return errors.Wrap(err, `failed to populate row`)
	}
	if err := vdb.Create(tx, payload.DatabaseOptions...); err != nil {
		return errors.Wrap(err, `failed to insert into database`)
	}
	if err := payload.LocalizedFields.CreateLocalizedStrings(tx, "Venue", vdb.EID); err != nil {
		return errors.Wrap(err, `failed to populate localized strings`)
	}
	return nil
}
Create takes in the transaction, the incoming payload, and a reference to
a database row. The database row is initialized/populated so that the
caller can use it afterwards.
package service
import (
	"context"
	"database/sql"
	"sync"
	"time"
	"github.com/builderscon/octav/octav/cache"
	"github.com/builderscon/octav/octav/db"
	"github.com/builderscon/octav/octav/internal/errors"
	"github.com/builderscon/octav/octav/model"
	"github.com/lestrrat/go-pdebug"
)
var _ = time.Time{}
var _ = cache.WithExpires(time.Minute)
var _ = context.Background
var _ = errors.Wrap
var _ = model.Venue{}
var _ = db.Venue{}
var _ = sql.ErrNoRows
var _ = pdebug.Enabled
var venueSvc VenueSvc
var venueOnce sync.Once
func Venue() *VenueSvc {
	venueOnce.Do(venueSvc.Init)
	return &venueSvc
}
func (v *VenueSvc) LookupFromPayload(ctx context.Context, tx *sql.Tx, m *model.Venue, payload *model.LookupVenueRequest) (err error) {
	if pdebug.Enabled {
		g := pdebug.Marker("service.Venue.LookupFromPayload %s", payload.ID).BindError(&err)
		defer g.End()
	}
	if err = v.Lookup(ctx, tx, m, payload.ID); err != nil {
		return errors.Wrap(err, "failed to load model.Venue from database")
	}
	if err := v.Decorate(ctx, tx, m, payload.VerifiedCall, payload.Lang.String); err != nil {
		return errors.Wrap(err, "failed to load associated data for model.Venue from database")
	}
	return nil
}
func (v *VenueSvc) Lookup(ctx context.Context, tx *sql.Tx, m *model.Venue, id string) (err error) {
	if pdebug.Enabled {
		g := pdebug.Marker("service.Venue.Lookup %s", id).BindError(&err)
		defer g.End()
	}
	var r model.Venue
	c := Cache()
	key := c.Key("Venue", id)
	var cacheMiss bool
	_, err = c.GetOrSet(key, &r, func() (interface{}, error) {
		if pdebug.Enabled {
			cacheMiss = true
		}
		if err := r.Load(tx, id); err != nil {
			return nil, errors.Wrap(err, "failed to load model.Venue from database")
		}
		return &r, nil
	}, cache.WithExpires(time.Hour))
	if pdebug.Enabled {
		cacheSt := `HIT`
		if cacheMiss {
			cacheSt = `MISS`
		}
		pdebug.Printf(`CACHE %s: %s`, cacheSt, key)
	}
	*m = r
	return nil
}