1
0

Update module go-testfixtures/testfixtures/v3 to v3.1.2 (#457)

Update module go-testfixtures/testfixtures/v3 to v3.1.2

Reviewed-on: https://kolaente.dev/vikunja/api/pulls/457
This commit is contained in:
renovate
2020-04-27 09:10:08 +00:00
committed by konrad
parent 5606f987fa
commit 711124f5c0
11 changed files with 27 additions and 203 deletions

View File

@ -1,12 +1,17 @@
# Changelog
## v3.1.1 - 2019-01-11
## v3.1.2 - 2020-04-26
- Dump: Fix column order in generated YAML files
[#62](https://github.com/go-testfixtures/testfixtures/pull/62)
## v3.1.1 - 2020-01-11
- testfixtures now work with both `mssql` and `sqlserver` drivers.
Note that [the `mssql` one is deprecated](https://github.com/denisenkom/go-mssqldb#deprecated),
though. So try to migrate to `sqlserver` once possible.
## v3.1.0 - 2019-01-09
## v3.1.0 - 2020-01-09
- Using `sqlserver` driver instead of the deprecated `mssql`
([#58](https://github.com/go-testfixtures/testfixtures/pull/58)).

View File

@ -1,4 +1,4 @@
FROM golang:1.13.5-alpine
FROM golang:1.14-alpine
RUN apk update
RUN apk add alpine-sdk

View File

@ -97,7 +97,14 @@ func (d *Dumper) Dump() error {
func (d *Dumper) dumpTable(table string) error {
query := fmt.Sprintf("SELECT * FROM %s", d.helper.quoteKeyword(table))
rows, err := d.db.Query(query)
stmt, err := d.db.Prepare(query)
if err != nil {
return err
}
defer stmt.Close()
rows, err := stmt.Query()
if err != nil {
return err
}
@ -108,7 +115,7 @@ func (d *Dumper) dumpTable(table string) error {
return err
}
fixtures := make([]interface{}, 0, 10)
fixtures := make([]yaml.MapSlice, 0, 10)
for rows.Next() {
entries := make([]interface{}, len(columns))
entryPtrs := make([]interface{}, len(entries))
@ -119,9 +126,12 @@ func (d *Dumper) dumpTable(table string) error {
return err
}
entryMap := make(map[string]interface{}, len(entries))
entryMap := make([]yaml.MapItem, len(entries))
for i, column := range columns {
entryMap[column] = convertValue(entries[i])
entryMap[i] = yaml.MapItem{
Key: column,
Value: convertValue(entries[i]),
}
}
fixtures = append(fixtures, entryMap)
}