postgres

package
v0.0.0-...-0de0edb Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed query/fetch.sql
	FetchSQL string

	//go:embed query/create.sql
	CreateSQL string

	//go:embed query/addUser.sql
	AddUserSQL string

	//go:embed query/getByID.sql
	GetByIDSQL string
)

Functions

func GameFromDB

func GameFromDB(dbGame DBGame) (entity.Game, error)

GameFromDB Convert database game model to domain model.

func NewGamePgStorage

func NewGamePgStorage(db *sqlx.DB, getter *trmsqlx.CtxGetter, logger logger.Logger) ports.GamePgStorage

Types

type DBGame

type DBGame struct {
	ID        string    `db:"id"`
	Name      string    `db:"name"`
	OwnerID   string    `db:"owner_id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

DBGame Database game representation.

func GameToDB

func GameToDB(game entity.Game) DBGame

GameToDB Convert domain game model to database model.

Jump to

Keyboard shortcuts

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