Documentation
¶
Overview ¶
Package database wires SQLite connection pools and database lifecycle for the server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecreatePoolsWithConfig ¶ added in v0.3.0
func RecreatePoolsWithConfig(ctx context.Context, paths DatabasePaths, cfg *config.Config, oldRwPool, oldRoPool *dbconnpool.DbSQLConnPool) (*dbconnpool.DbSQLConnPool, *dbconnpool.DbSQLConnPool, error)
RecreatePoolsWithConfig closes old pools and creates new ones with the given config. This is used when configuration is loaded after initial pool creation to honor database-stored pool settings during startup.
Types ¶
type DatabasePaths ¶ added in v0.3.0
DatabasePaths holds the file paths for both application databases.
func Setup ¶
func Setup(ctx context.Context, rootDir string, cfg *config.Config) (DatabasePaths, *dbconnpool.DbSQLConnPool, *dbconnpool.DbSQLConnPool, error)
Setup initializes the database environment: 1. Sets up the directory struct 2. Runs schema migrations 3. Establishes connection pools (RW/RO) 4. Ensures root folder entry exists 5. Schedules periodic optimization
Click to show internal directories.
Click to hide internal directories.