aboutsummaryrefslogtreecommitdiffstats
path: root/db/setup.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--db/setup.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/db/setup.go b/db/setup.go
deleted file mode 100644
index 5cd1041..0000000
--- a/db/setup.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package db
-
-import (
- "database/sql"
- "errors"
- "log"
- "os"
-
- _ "github.com/mattn/go-sqlite3"
-)
-
-func SetupDB(path string) (*sql.DB, error) {
- os.Create(path)
- 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
-}