pg

package
v0.0.0-...-1969f72 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConnectionString

func BuildConnectionString(env *env.Env) string

Build connection string

Types

type PgClient

type PgClient struct {
	Db *gorm.DB
}

PostgresClient struct

func GetInstance

func GetInstance() (*PgClient, error)

The GetInstance function returns a singleton instance of a Postgres client, creating a new instance if one does not already exist.

func New

func New(ctx context.Context, env *env.Env) (*PgClient, error)

The New function initializes a new PostgreSQL client and returns it along with a nil error if successful.

func (*PgClient) CloseConnection

func (pgclient *PgClient) CloseConnection() error

The `CloseConnection` method is a function defined on the `PgClient` struct. It is used to close the connection to the PostgreSQL database.

func (*PgClient) DropDatabaseTables

func (pgClient *PgClient) DropDatabaseTables()

Drop database tables

Jump to

Keyboard shortcuts

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