pool

package
v0.0.0-...-1c35737 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClosePool

func ClosePool() error

ClosePool safely closes the global pool. It should be called during application shutdown.

func GetPool

func GetPool() (*sqlitex.Pool, error)

GetPool returns the initialized global pool. Returns an error if the pool is not initialized.

func GetPoolUri

func GetPoolUri() string

GetPoolUri returns the path to the system database.

func InitPool

func InitPool(uri string, poolSize int) error

InitPool initializes the global pool with the given directory. It should be called once during application startup.

func ResetPool

func ResetPool(poolSize int) error

ResetPool safely closes the current pool and re-initializes it with the existing poolUri. This can be useful for reloading configurations.

func SetPool

func SetPool(newPool *sqlitex.Pool) error

SetPool allows injecting an existing *sqlitex.Pool into the dbpool. This is primarily intended for testing purposes. It closes any existing pool before setting the new one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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