database

package
v0.0.0-...-e6f38c9 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FileMigrations string = "./db/migration"
)

Functions

func Connect

func Connect(ctx context.Context, cfg *config.Config) *sql.DB

func PostgresMigrate

func PostgresMigrate(ctx context.Context, db *sql.DB, cfg *config.Config)

func RunMigrations

func RunMigrations(ctx context.Context, db *sql.DB, cfg *config.Config)

Types

type DBPurchase

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

func NewDBPurchase

func NewDBPurchase(database *Database) DBPurchase

func (DBPurchase) Start

func (db DBPurchase) Start() (core.TxPurchasePort, error)

type Database

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

func InitDb

func InitDb(ctx context.Context, cfg *config.Config) *Database

func New

func New(db *sql.DB) *Database

func (Database) Check

func (m Database) Check(ctx context.Context) error

func (Database) Close

func (m Database) Close() error

type TxOrderAdapter

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

func (TxOrderAdapter) End

func (t TxOrderAdapter) End() error

func (TxOrderAdapter) Rollback

func (t TxOrderAdapter) Rollback() error

func (TxOrderAdapter) SavePurchase

func (t TxOrderAdapter) SavePurchase(ctx context.Context, purchase domain.Purchase) (domain.Purchase, error)

Jump to

Keyboard shortcuts

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