database

package
v0.0.0-...-6f371f5 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateUserQuery = `INSERT INTO users (ID, email) VALUES($1, $2)`
)

User repository interface implementation

View Source
const (
	GetUserByIDQuery = "SELECT email FROM user where ID = $1"
)

Variables

This section is empty.

Functions

func NewPostgresRepository

func NewPostgresRepository(ctx *context.Context) (repository repository.PostgresRepository, err error)

Types

type PostgresRepositoryImpl

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

func (*PostgresRepositoryImpl) BeginTransaction

func (repository *PostgresRepositoryImpl) BeginTransaction(ctx *context.Context) (dbTx *sql.Tx, err error)

func (*PostgresRepositoryImpl) CommitTransaction

func (repository *PostgresRepositoryImpl) CommitTransaction(dbTx *sql.Tx) (err error)

func (*PostgresRepositoryImpl) CreateUser

func (repository *PostgresRepositoryImpl) CreateUser(ctx *context.Context, user *entities.User) (err error)

func (*PostgresRepositoryImpl) DeleteUserByID

func (repository *PostgresRepositoryImpl) DeleteUserByID(ctx *context.Context, userID string) (err error)

func (*PostgresRepositoryImpl) GetUserByID

func (repository *PostgresRepositoryImpl) GetUserByID(ctx *context.Context, userID string) (user *entities.User, err error)

func (*PostgresRepositoryImpl) Init

func (repository *PostgresRepositoryImpl) Init(ctx *context.Context) (err error)

func (*PostgresRepositoryImpl) RollbackTransaction

func (repository *PostgresRepositoryImpl) RollbackTransaction(dbTx *sql.Tx) (err error)

func (*PostgresRepositoryImpl) UpdateUser

func (repository *PostgresRepositoryImpl) UpdateUser(ctx *context.Context, user *entities.User) (err error)

Jump to

Keyboard shortcuts

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