stmtcache

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StmtCache

type StmtCache struct {
	// contains filtered or unexported fields
}

func New

func New(cap int) *StmtCache

New returns a new StmtCache with n maximum capacity, panics if capacity <= 0.

func (*StmtCache) Clear

func (c *StmtCache) Clear()

Clear removes all entries from the cache, closing all prepared statements.

func (*StmtCache) Get

func (c *StmtCache) Get(key string) (stmt, bool)

func (*StmtCache) Len

func (c *StmtCache) Len() int

Len returns the number of cached statements.

func (*StmtCache) Put

func (c *StmtCache) Put(key string, stmt stmt) (evicted bool)

Put adds a new entry to cache, returns whether an item was evicted, panics if key is blank.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL