database

package
v0.0.0-...-cd37d07 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateUserDML = `INSERT INTO "user"(id, name) VALUES ($1, $2)`
)
View Source
const (
	FindUserByIDDML = `SELECT id, name FROM "user" WHERE id = $1`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IUserPostgres

type IUserPostgres interface {
	CreateUser(userID string, name string) (err error)
	FindUserByID(userID string) (user *userEntities.User, err error)
	interfaces.IPostgres
}

func NewUserPostgres

func NewUserPostgres() (userPostgres IUserPostgres, err error)

type UserPostgres

type UserPostgres struct {
	*commonEntities.Postgres
}

func (*UserPostgres) BeginTx

func (userPostgres *UserPostgres) BeginTx(ctx context.Context) (tx *sql.Tx, err error)

func (*UserPostgres) CommitTx

func (userPostgres *UserPostgres) CommitTx(tx *sql.Tx) (err error)

func (*UserPostgres) CreateUser

func (userPostgres *UserPostgres) CreateUser(userID string, name string) (err error)

func (*UserPostgres) FindUserByID

func (userPostgres *UserPostgres) FindUserByID(userID string) (user *userEntities.User, err error)

func (*UserPostgres) Open

func (userPostgres *UserPostgres) Open() (DB *sql.DB, err error)

func (*UserPostgres) RollbackTx

func (userPostgres *UserPostgres) RollbackTx(tx *sql.Tx) (err error)

Jump to

Keyboard shortcuts

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