MCPcopy
hub / github.com/Masterminds/squirrel / StmtCache

Struct StmtCache

stmtcacher.go:31–35  ·  view source on GitHub ↗

NOTE: NewStmtCache is defined in stmtcacher_ctx.go (Go >= 1.8) or stmtcacher_noctx.go (Go < 1.8). StmtCache wraps and delegates down to a Preparer type It also automatically prepares all statements sent to the underlying Preparer calls for Exec, Query and QueryRow and caches the returns *sql.Stmt u

Source from the content-addressed store, hash-verified

29// for Exec, Query and QueryRow and caches the returns *sql.Stmt using the provided
30// query as the key. So that it can be automatically re-used.
31type StmtCache struct {
32 prep Preparer
33 cache map[string]*sql.Stmt
34 mu sync.Mutex
35}
36
37// Prepare delegates down to the underlying Preparer and caches the result
38// using the provided query as a key

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected