database

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDSN

func FormatDSN(cfg config.DatabaseConfig) string

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

func Connect

func Connect(ctx context.Context, cfg config.DatabaseConfig) (*Database, error)

func NewDatabase

func NewDatabase(conn *sql.DB) *Database

func (*Database) Close

func (d *Database) Close() error

func (*Database) Conn

func (d *Database) Conn() *sql.DB

func (*Database) Ping

func (p *Database) Ping(ctx context.Context) error

Jump to

Keyboard shortcuts

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