database

package
v0.0.0-...-b805d9c Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbConfig

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

func NewDbConfig

func NewDbConfig(user string, password string, name string, host string, port string) *DbConfig

Create a new db config type

func (*DbConfig) WithMigration

func (config *DbConfig) WithMigration(path string) *DbConfig

If dbMigration is needed in the api we use this function to set the path

type DbConn

type DbConn struct {
	DbPool *sql.DB
}

func InitPool

func InitPool(config *DbConfig) *DbConn

InitPool initializes the database connection pool and runs migrations.

func (*DbConn) ClosePool

func (db *DbConn) ClosePool() error

ClosePool closes the database connection pool.

Jump to

Keyboard shortcuts

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