postgres

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPoolConfig

func NewPoolConfig(cfg config.Database) (*pgxpool.Config, error)

func NewUserRepository added in v0.3.0

func NewUserRepository(db *TxManager) ports.UserRepository

Types

type CardBrandRepository

type CardBrandRepository struct {
	// contains filtered or unexported fields
}

func NewCardBrandRepository

func NewCardBrandRepository(db *TxManager) *CardBrandRepository

func (*CardBrandRepository) CreateCardBrand

func (r *CardBrandRepository) CreateCardBrand(
	ctx context.Context,
	name string,
) (*entity.CardBrand, error)

func (*CardBrandRepository) DeleteCardBrand

func (r *CardBrandRepository) DeleteCardBrand(
	ctx context.Context,
	id uuid.UUID,
) (*entity.CardBrand, error)

func (*CardBrandRepository) GetCardBrandByID

func (r *CardBrandRepository) GetCardBrandByID(
	ctx context.Context,
	id uuid.UUID,
) (*entity.CardBrand, error)

func (*CardBrandRepository) ListCardBrands

func (*CardBrandRepository) UpdateCardBrand

type TxManager

type TxManager struct {
	ConnPool *pgxpool.Pool
}

func (TxManager) Close

func (b TxManager) Close()

func (TxManager) Exec

func (b TxManager) Exec(
	ctx context.Context,
	query string,
	args ...any,
) (pgconn.CommandTag, error)

func (TxManager) Query

func (b TxManager) Query(
	ctx context.Context,
	query string,
	args ...any,
) (pgx.Rows, error)

func (TxManager) QueryRow

func (b TxManager) QueryRow(ctx context.Context, query string, args ...any) pgx.Row

func (TxManager) SendBatch

func (b TxManager) SendBatch(ctx context.Context, batch *pgx.Batch) pgx.BatchResults

func (TxManager) WithTx

type UserRepository added in v0.3.0

type UserRepository struct {
	// contains filtered or unexported fields
}

func (*UserRepository) Create added in v0.3.0

func (r *UserRepository) Create(ctx context.Context, logtoUserID string) (*entity.User, error)

func (*UserRepository) ExistsByLogtoUserID added in v0.3.0

func (r *UserRepository) ExistsByLogtoUserID(ctx context.Context, logtoUserID string) (bool, error)

func (*UserRepository) GetByID added in v0.3.0

func (r *UserRepository) GetByID(ctx context.Context, id uuid.UUID) (*entity.User, error)

func (*UserRepository) GetByLogtoUserID added in v0.3.0

func (r *UserRepository) GetByLogtoUserID(ctx context.Context, logtoUserID string) (*entity.User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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