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 *pgx.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 Seeder ¶
type Seeder struct {
// contains filtered or unexported fields
}
func New ¶
func New(pool *pgxpool.Pool, opts ...SeederOption) *Seeder
New creates a new PgSeeder. 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
Click to show internal directories.
Click to hide internal directories.