Documentation
¶
Overview ¶
Package storage opens a database for one service. It runs no migrations: each service's backend owns its own schema and migrates itself when it is wired up.
Index ¶
Constants ¶
View Source
const ( DriverSQLite = "sqlite" DriverPostgres = "postgres" )
SQLite is the default because it needs nothing to be running.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Driver is DriverSQLite or DriverPostgres.
Driver string
// Path is the SQLite file. The postgres driver ignores it.
Path string
// DSN is the Postgres connection string. The sqlite driver ignores it.
DSN string
// MaxOpenConns bounds each Postgres pool. SQLite is always one connection.
MaxOpenConns int
}
type Handle ¶
Handle is one service's open database.
func OpenHandle ¶
OpenHandle opens the configured database for the service owning schema.
Click to show internal directories.
Click to hide internal directories.