seeds

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package seeds seeds the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopulateDB

func PopulateDB(db *sql.DB) error

PopulateDB inserts data into the database.

func PopulateTx added in v0.4.0

func PopulateTx(db *sql.Tx) error

PopulateTx inserts data into the database thoguh the use of database tx.

Types

type Seed

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

Seed struct.

func NewSeed

func NewSeed(db *sqlx.DB) Seed

NewSeed return a Seed with a pool of connection to a dabase.

func (Seed) ProductsSeed

func (s Seed) ProductsSeed()

ProductsSeed seeds product data.

func (Seed) RolesSeed

func (s Seed) RolesSeed()

RolesSeed seeds roles data.

func (Seed) UsersSeed

func (s Seed) UsersSeed()

UsersSeed seeds roles data.

type SeedTx added in v0.4.0

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

SeedTx struct.

func NewSeedTx added in v0.4.0

func NewSeedTx(tx *sqlx.Tx) SeedTx

NewSeedTx returns a seed object with a database tx.

func (SeedTx) ProductsSeed added in v0.4.0

func (s SeedTx) ProductsSeed() error

ProductsSeed seeds product data.

func (SeedTx) RolesSeed added in v0.4.0

func (s SeedTx) RolesSeed() error

RolesSeed seeds roles data.

func (SeedTx) UsersSeed added in v0.4.0

func (s SeedTx) UsersSeed() error

UsersSeed seeds roles data.

type SeedTxWithError added in v0.4.0

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

SeedTxWithError struct used to validate the ability to rollback on errors.

func NewSeedTxWithError added in v0.4.0

func NewSeedTxWithError(tx *sqlx.Tx) SeedTxWithError

NewSeedTxWithError returns a seed object with a database tx.

func (SeedTxWithError) RolesSeed added in v0.4.0

func (s SeedTxWithError) RolesSeed() error

RolesSeed seeds roles data.

Jump to

Keyboard shortcuts

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