sqlite

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DriverName is the unrestricted sqlite3 driver used for the management catalog.
	DriverName = "sqlite3"
	// RestrictedDriverName denies ATTACH/DETACH and unsafe PRAGMAs for tenant databases.
	RestrictedDriverName = "sqlite3_restricted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool manages SQLite database connections

func NewPool

func NewPool(dbPath string, config PoolConfig) (*Pool, error)

NewPool creates a new SQLite connection pool

func (*Pool) Close

func (p *Pool) Close() error

Close closes the database connection pool

func (*Pool) DB

func (p *Pool) DB() *sql.DB

DB returns the underlying sql.DB

func (*Pool) Stats

func (p *Pool) Stats() sql.DBStats

Stats returns pool statistics

type PoolConfig

type PoolConfig struct {
	MaxOpenConns int
	MaxIdleConns int
	MaxLifetime  time.Duration
	BusyTimeout  time.Duration
	WALMode      bool
	// Restricted enables the ATTACH/DETACH/PRAGMA authorizer. Tenant DBs should use this.
	Restricted bool
}

PoolConfig holds configuration for the SQLite connection pool

func DefaultPoolConfig

func DefaultPoolConfig() PoolConfig

DefaultPoolConfig returns sensible defaults

Jump to

Keyboard shortcuts

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