aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/datamaps/writer.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/datamaps/writer.go')
-rw-r--r--pkg/datamaps/writer.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/datamaps/writer.go b/pkg/datamaps/writer.go
index 8e721d0..defb656 100644
--- a/pkg/datamaps/writer.go
+++ b/pkg/datamaps/writer.go
@@ -12,15 +12,17 @@ import (
_ "github.com/mattn/go-sqlite3"
)
-func ExportMaster(opts *Options) error {
+// CreateMaster creates a master spreadsheet for a specific return given,
+// based on a datamap name - both of which already need to be in the database,
+// along with the data associated with the return. The datamap and return data
+// must already have been imported.
+func CreateMaster(opts *Options) error {
wb := xlsx.NewFile()
sh, err := wb.AddSheet("Master Data")
if err != nil {
return fmt.Errorf("cannot add 'Master Data' sheet to new XLSX file: %v", err)
}
- // SQLITE CODE
-
db, err := sql.Open("sqlite3", opts.DBPath)
if err != nil {
return fmt.Errorf("cannot open database %v", err)
@@ -103,7 +105,6 @@ func ExportMaster(opts *Options) error {
}
for masterRow := 0; masterRow < len(datamapKeys); masterRow++ {
- log.Printf("Writing to masterRow which is %d", masterRow)
r, err := sh.AddRowAtIndex(masterRow)
if err != nil {
return fmt.Errorf("cannot create row %d in output spreadsheet: %v", masterRow, err)