MCPcopy Index your code
hub / github.com/riverqueue/river / Replacer

Struct Replacer

rivershared/sqlctemplate/sqlc_template.go:91–94  ·  view source on GitHub ↗

Replacer replaces templates with template values. As an optimization, it contains an internal cache to short circuit SQL that has entirely stable template replacements and whose output is invariant of input parameters. The struct is written so that it's safe to use as a value and doesn't need to be

Source from the content-addressed store, hash-verified

89// be initialized with a constructor. This lets it default to a usable instance
90// on drivers that may themselves not be initialized.
91type Replacer struct {
92 cache map[replacerCacheKey]string
93 cacheMu sync.RWMutex
94}
95
96var (
97 templateBeginEndRE = regexp.MustCompile(`/\* TEMPLATE_BEGIN: (.*?) \*/ .*? /\* TEMPLATE_END \*/`)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected