package stmtcache

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

Dependency Relation
	imports 5 packages, and imported by one package

Involved Source Files lru_cache.go Package stmtcache is a cache for statement descriptions. unlimited_cache.go
Package-Level Type Names (total 3)
/* sort 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. HandleInvalidated returns a slice of all statement descriptions invalidated since the last call to HandleInvalidated. 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. *LRUCache *UnlimitedCache
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. (*LRUCache) HandleInvalidated() []*pgconn.StatementDescription 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. *LRUCache : Cache func NewLRUCache(cap int) *LRUCache
UnlimitedCache implements Cache with no capacity limit. Cap returns the maximum number of cached prepared statement descriptions. Get returns the statement description for sql. Returns nil if not found. (*UnlimitedCache) HandleInvalidated() []*pgconn.StatementDescription 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. *UnlimitedCache : Cache func NewUnlimitedCache() *UnlimitedCache
Package-Level Functions (total 4)
NewLRUCache creates a new LRUCache. cap is the maximum size of the cache.
NewUnlimitedCache creates a new UnlimitedCache.
NextStatementName returns a statement name that will be unique for the lifetime of the program.