commondb

package
v0.0.0-...-fe69749 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

package commondb is an opinionated package for setting up db connections within desq components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupDB

func SetupDB(log *zap.Logger, detailer DBConnectionDetailer) (*sqlx.DB, error)

func SetupDBOrFatal

func SetupDBOrFatal(log *zap.Logger, detailer DBConnectionDetailer) *sqlx.DB

Types

type DBConnectionDetailer

type DBConnectionDetailer interface {
	DSN() string
	DSNSafe() string
	MaxIdleConns() int
	MaxOpenConns() int
}

DBConnectionDetailer defines types that implement methods to provide information for setting up a DB connection. Known implementations within these desq common packages are: commonflags.EventDB or commonflags.JournalDB.

Jump to

Keyboard shortcuts

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