database

package
v0.0.0-...-fc500c8 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Timeout = 3 * time.Second

Variables

This section is empty.

Functions

func Connect

func Connect(databaseURI string) (*pgx.Conn, error)

func ConnectPool

func ConnectPool(databaseURI string) (*pgxpool.Pool, error)

Types

type Conn

type Conn interface {
	Begin(ctx context.Context) (pgx.Tx, error)
	Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
	Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
}

Common interface for pgx.Conn, pgx.Pool, pgx.Tx, etc https://github.com/jackc/pgx/issues/644

Jump to

Keyboard shortcuts

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