database

package
v0.0.0-...-5e02292 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Queries *db_sqlc.Queries
	Pool    *pgxpool.Pool
}

Client is the client for executing database queries.

func FromContext

func FromContext(ctx context.Context) (*Client, error)

FromContext retrieves the database client from the context.

func NewClientPool

func NewClientPool(ctx context.Context, host, user, password, dbname, sslMode string) Client

NewClientPool creates a new database client with a connection pool and adds it to the context.

type ClientKey

type ClientKey struct{}

ClientKey is the key for the database connection used within the context.

Directories

Path Synopsis
internal
dto
gen

Jump to

Keyboard shortcuts

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