Documentation ¶
Index ¶
- func Load(data []byte, db *sql.DB, driver string, doOneTransactionPerRow bool, ...) error
- func LoadFile(filename string, db *sql.DB, driver string, allowUpsert ...bool) error
- func LoadFiles(filenames []string, db *sql.DB, driver string, allowUpsert ...bool) error
- func NewFileError(filename string, cause error) error
- func NewProcessingError(row int, cause error) error
- type Row
- func (row *Row) GetInsertColumns() []string
- func (row *Row) GetInsertColumnsLength() int
- func (row *Row) GetInsertPlaceholders(driver string) []string
- func (row *Row) GetInsertValues() []interface{}
- func (row *Row) GetInsertValuesLength() int
- func (row *Row) GetPKValues() []interface{}
- func (row *Row) GetUpdateColumns() []string
- func (row *Row) GetUpdateColumnsLength() int
- func (row *Row) GetUpdatePlaceholders(driver string) []string
- func (row *Row) GetUpdateValues() []interface{}
- func (row *Row) GetUpdateValuesLength() int
- func (row *Row) GetWhere(driver string, i int) string
- func (row *Row) Init()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
func Load(data []byte, db *sql.DB, driver string, doOneTransactionPerRow bool, allowUpsert bool) error
Load processes a YAML fixture and inserts/updates the database accordingly
func NewProcessingError ¶
NewProcessingError ...
Types ¶
type Row ¶
type Row struct { Table string PK map[string]interface{} Fields map[string]interface{} // contains filtered or unexported fields }
Row represents a single database row
func (*Row) GetInsertColumns ¶
GetInsertColumns returns a slice of column names for INSERT query
func (*Row) GetInsertColumnsLength ¶
GetInsertColumnsLength returns number of columns for INSERT query
func (*Row) GetInsertPlaceholders ¶
GetInsertPlaceholders returns a slice of placeholders for INSERT query
func (*Row) GetInsertValues ¶
func (row *Row) GetInsertValues() []interface{}
GetInsertValues returns a slice of values for INSERT query
func (*Row) GetInsertValuesLength ¶
GetInsertValuesLength returns number of values for INSERT query
func (*Row) GetPKValues ¶
func (row *Row) GetPKValues() []interface{}
GetPKValues returns a slice of primary key values
func (*Row) GetUpdateColumns ¶
GetUpdateColumns returns a slice of column names for UPDATE query
func (*Row) GetUpdateColumnsLength ¶
GetUpdateColumnsLength returns number of columns for UDPATE query
func (*Row) GetUpdatePlaceholders ¶
GetUpdatePlaceholders returns a slice of placeholders for UPDATE query
func (*Row) GetUpdateValues ¶
func (row *Row) GetUpdateValues() []interface{}
GetUpdateValues returns a slice of values for UPDATE query
func (*Row) GetUpdateValuesLength ¶
GetUpdateValuesLength returns number of values for UDPATE query