aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/datamaps/reader.go
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-07-26 19:20:36 +0100
committerMatthew Lemon <matt@matthewlemon.com>2020-07-26 19:20:36 +0100
commitaafbec18d3619d15b776705f446a894cdfa7861f (patch)
tree493f44d8638785af13b6b6a50368ee78033d9e3a /pkg/datamaps/reader.go
parent73e42a5e67c5d166a36bfe1473ef1ec05a761168 (diff)
passing test - can create a []DatamapLine slices from a datamap in the database
Diffstat (limited to 'pkg/datamaps/reader.go')
-rw-r--r--pkg/datamaps/reader.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/datamaps/reader.go b/pkg/datamaps/reader.go
index ef4ef1a..050853a 100644
--- a/pkg/datamaps/reader.go
+++ b/pkg/datamaps/reader.go
@@ -149,6 +149,8 @@ func ReadXLSX(ssheet string) FileData {
func DMLFromDB(name string, db *sql.DB) []DatamapLine {
+ var out []DatamapLine
+
query := `
select
key, sheet, cellref
@@ -170,9 +172,12 @@ func DMLFromDB(name string, db *sql.DB) []DatamapLine {
if err := rows.Scan(&key, &sheet, &cellref); err != nil {
log.Fatal(err)
}
- log.Printf("key %s\nsheet %s\ncellref %v", key, sheet, cellref)
+
+ // log.Printf("key %s\nsheet %s\ncellref %v", key, sheet, cellref)
+ out = append(out, DatamapLine{Key: key, Sheet: sheet, Cellref: cellref})
}
- return make([]DatamapLine, 0)
+
+ return out
}
// func ExtractDBDM(name string, file string) ExtractedData {