Documentation
¶
Index ¶
Constants ¶
const DefaultMaxConnections = 5
DefaultMaxConnections is the default SQLite connection pool size.
const ProviderName = "sqlite"
ProviderName is the plugin selector used to register SQLite metadata.
Variables ¶
var BeforeOpenDataDir func(dataDir string) error
BeforeOpenDataDir, when non-nil, is called with the resolved data directory of every file-backed store immediately before the database file is opened. It exists so a test binary can place an already-migrated database in the directory and skip the schema migration, which dominates the cost of opening a store under the race detector. Production code never sets it. It is a plain package variable, so it must be assigned only from a test package's init function, which completes before any goroutine that opens a store starts; that ordering is what excludes a data race with the readers.
var LazyHotStatements bool
LazyHotStatements makes every store this package opens defer preparing its hot statements to first use instead of preparing them in Start. It exists for test binaries that open many short-lived stores; production code never sets it. Like BeforeOpenDataDir it must be assigned only from a test package's init function.
Functions ¶
func NewSQLStore ¶ added in v0.69.0
func NewSQLStore( config Config, dependencies metadata.ProviderDependencies, ) (*sqlstore.Store, error)
NewSQLStore opens the shared database/sql SQLite implementation.
func RegisterProvider ¶ added in v0.68.0
func RegisterProvider(host *hostplugin.Host) error
RegisterProvider registers the SQLite metadata provider with host.
Types ¶
type Config ¶ added in v0.68.0
type Config struct {
// DataDir overrides the application-wide database path for this provider.
// An empty value uses ProviderDependencies.DataDir.
DataDir string `yaml:"dataDir"`
// VacuumIntervalSeconds enables periodic space reclaim when positive. Zero
// disables it because the first run needs a full VACUUM, which holds the
// write pool and SQLite's database-wide writer lock for the whole rewrite.
VacuumIntervalSeconds uint64 `yaml:"vacuumIntervalSeconds"`
MaxConnections int `yaml:"maxConnections"`
}
Config contains SQLite-specific configuration.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bigintsum registers the dingo_bigint_sum SQLite aggregate with the pure-Go SQLite driver.
|
Package bigintsum registers the dingo_bigint_sum SQLite aggregate with the pure-Go SQLite driver. |
|
Package coinsum registers the dingo_coin_sum SQLite aggregate.
|
Package coinsum registers the dingo_coin_sum SQLite aggregate. |