db

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package db provides structure to implement database connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

type Postgres struct {
	Pool *pgxpool.Pool
}

Postgres is wrapper over pgxpool.Pool.

func NewPostgres

func NewPostgres(ctx context.Context, uri string) (*Postgres, error)

NewPostgres creates new Pool and ping database. It returns pointer to a Postgres instance or nil if connection failed.

func (*Postgres) Close

func (p *Postgres) Close()

Close closes all connections in the Pool.

Jump to

Keyboard shortcuts

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