Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDatabaseNotFound = errors.New("database file not found") ErrUnsupportedDriver = errors.New("unsupported database driver") )
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database wraps the SQL database connection
func Open ¶
Open opens a database connection for the specified driver and DSN. For SQLite, the DSN is a file path (parent directories are created). For PostgreSQL, the DSN is a connection string. poolMaxConns is used only for PostgreSQL to set the connection pool size.
func (*Database) RunMigrations ¶
RunMigrations runs all pending database migrations from the embedded filesystem for the specified driver ("sqlite" or "postgres").
Click to show internal directories.
Click to hide internal directories.