StatementName returns a statement name that will be stable for sql across multiple connections and program executions.
(sql string)
| 11 | // StatementName returns a statement name that will be stable for sql across multiple connections and program |
| 12 | // executions. |
| 13 | func 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. |
| 19 | type Cache interface { |
no outgoing calls
no test coverage detected