Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // The path to the file to be seeded FileName string // ChunkSize is the number of lines to be read at a time (defaults to 100) ChunkSize int // HandleLine is called for each line in the file. // If HandleLine returns an error, the seeder will stop running. HandleLine func(batch *Batch, line []byte) error // A slice of Configs that will be run after the parent Config has finished. Children []Config }
Config represents a file to be seeded.
type QueuedQuery ¶
type QueuedQuery struct {
// contains filtered or unexported fields
}
type Seeder ¶
type Seeder struct {
// contains filtered or unexported fields
}
func New ¶
func New(db *sql.DB, opts ...SeederOption) *Seeder
New creates a new sqlseeder. Available options are:
- WithProgress : pass in an *mpb.Progress to get progress bars
type SeederOption ¶
type SeederOption = func(s *Seeder)
func WithProgress ¶
func WithProgress(p *mpb.Progress) SeederOption
Enables progress bars for the seeder.
Click to show internal directories.
Click to hide internal directories.