diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-07-18 21:02:41 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-07-18 21:02:41 +0100 |
commit | 1db96177350b8d785be2728f3d44907c8998d7b0 (patch) | |
tree | 60290a3f40cbc2d03f636f2fe6f5fe33559a1558 /reader/reader.go | |
parent | 91929328acd4dbb6bf1eaf9178fe68e1433ad0be (diff) |
moved db stuff to new package
Diffstat (limited to 'reader/reader.go')
-rw-r--r-- | reader/reader.go | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/reader/reader.go b/reader/reader.go index d99f2a8..bdca4dc 100644 --- a/reader/reader.go +++ b/reader/reader.go @@ -1,7 +1,6 @@ package reader import ( - "database/sql" "encoding/csv" "errors" "fmt" @@ -41,22 +40,6 @@ type ExtractedCell struct { Value string } -func SetupDB(path string) (*sql.DB, error) { - db, err := sql.Open("sqlite3", path) - if err != nil { - return db, errors.New("Cannot open that damn database file") - } - stmt := `drop table if exists datamap; - create table datamap(id integer no null primary key, name text); - ` - _, err = db.Exec(stmt) - if err != nil { - log.Printf("%q: %s\n", err, stmt) - } - - return db, nil -} - //sheetInSlice is a helper which returns true // if a string is in a slice of strings. func sheetInSlice(list []string, key string) bool { |