database

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverNamePostgres = "postgres"
)

Variables

This section is empty.

Functions

func BuilDSNUri added in v0.0.15

func BuilDSNUri(cfg config.Database) string

Types

type DB

type DB struct {
	Conn *sqlx.DB
	// contains filtered or unexported fields
}

DB struct for manage database connection,

func NewDB

func NewDB(p Params) (*DB, error)

func (*DB) Connect added in v0.0.15

func (d *DB) Connect(dbUri string) error

type Params added in v0.0.15

type Params struct {
	fx.In

	LC fx.Lifecycle

	Logger *slog.Logger
	Config *config.Config
}

Jump to

Keyboard shortcuts

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