database

package
v0.0.0-...-f7ac94d Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: GPL-3.0 Imports: 8 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, sslmode string, url string) *DbConfig

create a new db config type

func (*DbConfig) WithMigration

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

we use this function to set the path if migration path is not nil

type DbConn

type DbConn struct {
	Dbpool *pgxpool.Pool
}

func InitPool

func InitPool(config *DbConfig) *DbConn

initializes the database connection pool and runs migrations

func (*DbConn) ClosePool

func (db *DbConn) ClosePool()

closes the database connection pool

Jump to

Keyboard shortcuts

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