Documentation
¶
Overview ¶
Package preparedcache is a per-connection LRU prepared-statement cache used by the PostgreSQL proxy. Plan 05a uses it for the wire-protocol Extended Query cache; Plan 05b adds a second instance per connection for SQL-level PREPARE/EXECUTE.
The default capacity is 4096 entries per spec §7.4.
Index ¶
Constants ¶
const DefaultCapacity = 4096
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a fixed-capacity LRU keyed by prepared-statement name. Empty name is a legal key per §7.4 (unnamed prepared statement).
func New ¶
New returns a Cache with the given capacity. capacity <= 0 falls back to DefaultCapacity.
type Entry ¶
type Entry struct {
Classification effects.ClassifiedStatement
RedactionTier policy.RedactionTier
CatalogRefreshSearchPath bool
CatalogRefreshSnapshot bool
Redirect *RedirectMetadata
}
Entry is the cached value: the classified statement plus the redaction tier captured at Parse time so a later Execute renders consistently even if policy is hot-swapped between Parse and Execute.
type RedirectMetadata ¶
type RedirectMetadata struct {
OriginalClassification effects.ClassifiedStatement
OriginalSQL string
OriginalStatementDigest string
RewrittenStatementDigest string
Rule string
SourceRelation string
TargetRelation string
PolicyIdentity string
}
RedirectMetadata captures parse-time redirect state for wire-protocol prepared statements. Classification on Entry is the rewritten statement; OriginalClassification keeps the client statement for audit.