MCPcopy
hub / github.com/jackc/pgx / StatementName

Function StatementName

internal/stmtcache/stmtcache.go:13–16  ·  view source on GitHub ↗

StatementName returns a statement name that will be stable for sql across multiple connections and program executions.

(sql string)

Source from the content-addressed store, hash-verified

11// StatementName returns a statement name that will be stable for sql across multiple connections and program
12// executions.
13func StatementName(sql string) string {
14 digest := sha256.Sum256([]byte(sql))
15 return "stmtcache_" + hex.EncodeToString(digest[0:24])
16}
17
18// Cache caches statement descriptions.
19type Cache interface {

Callers 3

execMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected