Documentation
¶
Overview ¶
Package db opens the SQLite database and applies embedded migrations.
Index ¶
- func Backup(ctx context.Context, d *sql.DB, source, destination string) error
- func DefaultDataDir() string
- func DefaultPath() string
- func Describe(s string) string
- func IsPostgres(d *sql.DB) bool
- func IsPostgresURL(s string) bool
- func Migrate(ctx context.Context, d *sql.DB) error
- func Open(path string) (*sql.DB, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Backup ¶ added in v0.2.0
Backup creates a SQLite snapshot or a PostgreSQL custom-format dump. PostgreSQL credentials are supplied as environment variables, never process arguments.
func DefaultDataDir ¶
func DefaultDataDir() string
DefaultDataDir returns the directory holding the database and logs. SWITCHBOARD_DATA_DIR overrides it.
func IsPostgres ¶ added in v0.2.0
func IsPostgresURL ¶ added in v0.2.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.