package stmtcache

Import Path
	github.com/jackc/pgx/v5/internal/stmtcache (on go.dev)

Dependency Relation
	imports 3 packages, and imported by one package

Involved Source Files lru_cache.go Package stmtcache is a cache for statement descriptions.
Package-Level Type Names (total 3, in which 2 are exported)
/* sort exporteds by: | */
Cache caches statement descriptions. Cap returns the maximum number of cached prepared statement descriptions. Get returns the statement description for sql. Returns nil if not found. GetInvalidated returns a slice of all statement descriptions invalidated since the last call to RemoveInvalidated. Invalidate invalidates statement description identified by sql. Does nothing if not found. InvalidateAll invalidates all statement descriptions. Len returns the number of cached prepared statement descriptions. Put stores sd in the cache. Put panics if sd.SQL is "". Put does nothing if sd.SQL already exists in the cache. RemoveInvalidated removes all invalidated statement descriptions. No other calls to Cache must be made between a call to GetInvalidated and RemoveInvalidated or RemoveInvalidated may remove statement descriptions that were never seen by the call to GetInvalidated. *LRUCache
LRUCache implements Cache with a Least Recently Used (LRU) cache. Cap returns the maximum number of cached prepared statement descriptions. Get returns the statement description for sql. Returns nil if not found. GetInvalidated returns a slice of all statement descriptions invalidated since the last call to RemoveInvalidated. Invalidate invalidates statement description identified by sql. Does nothing if not found. InvalidateAll invalidates all statement descriptions. Len returns the number of cached prepared statement descriptions. Put stores sd in the cache. Put panics if sd.SQL is "". Put does nothing if sd.SQL already exists in the cache or sd.SQL has been invalidated and HandleInvalidated has not been called yet. RemoveInvalidated removes all invalidated statement descriptions. No other calls to Cache must be made between a call to GetInvalidated and RemoveInvalidated or RemoveInvalidated may remove statement descriptions that were never seen by the call to GetInvalidated. *LRUCache : Cache func NewLRUCache(cap int) *LRUCache
Package-Level Functions (total 2, both are exported)
NewLRUCache creates a new LRUCache. cap is the maximum size of the cache.
StatementName returns a statement name that will be stable for sql across multiple connections and program executions.