postgres

package
v0.0.0-...-96f74f2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DSN          string
	MaxIdleTime  time.Duration
	MaxOpenConns int
	MaxIdleConns int
}

type Connection

type Connection struct {
	*sql.DB
}

func (*Connection) OpenDB

func (conn *Connection) OpenDB(c Config) error

OpenDB function returns a sql.DB connection pool.

type Database

type Database interface {
	OpenDB(c Config) error
	Stats() sql.DBStats
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
	Close() error
}

Jump to

Keyboard shortcuts

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