populatedb

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupportDialect    = errors.New("not support dialect")
	ErrTableNotExist        = errors.New("table not exist")
	ErrMaximumQuestionMarks = errors.New("maximum question marks")
)
View Source
var ErrNotSupportDatabaseType = errors.New("not support database type")

Functions

This section is empty.

Types

type DTBigint

type DTBigint struct{}

func (*DTBigint) Generate

func (dt *DTBigint) Generate() any

type DTInt

type DTInt struct{}

func (*DTInt) Generate

func (dt *DTInt) Generate() any

type DTJSON

type DTJSON struct{}

func (*DTJSON) Generate

func (dt *DTJSON) Generate() any

type DTTimestamp

type DTTimestamp struct{}

func (*DTTimestamp) Generate

func (dt *DTTimestamp) Generate() any

type DTVarchar

type DTVarchar struct {
	Length int
}

func (*DTVarchar) Generate

func (dt *DTVarchar) Generate() any

type DatabaseType

type DatabaseType interface {
	Generate() any
}

func ParseDatabaseType

func ParseDatabaseType(column *tblsschema.Column) (DatabaseType, error)

type Populator

type Populator interface {
	Insert(ctx context.Context, tableName string, numberRecord int) error
	InsertBatch(ctx context.Context, tableName string, numberRecord int) error
}

func NewPopulator

func NewPopulator(
	dbDialect string,
	dbURL string,
	verbose bool,
	dryRun bool,
) (Populator, error)

Jump to

Keyboard shortcuts

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