town/signup/signup.go

21 lines
286 B
Go
Raw Normal View History

2023-02-20 08:43:14 +00:00
package signup
2023-02-26 08:57:46 +00:00
// TODO delete this file
2023-02-20 08:43:14 +00:00
import (
"database/sql"
2023-02-21 03:56:19 +00:00
_ "github.com/mattn/go-sqlite3"
2023-02-20 08:43:14 +00:00
)
2023-02-23 00:04:26 +00:00
const dsn = "/town/var/signups/signups.db?mode=rw"
2023-02-20 08:43:14 +00:00
2023-02-23 00:04:26 +00:00
func ConnectDB() (*sql.DB, error) {
db, err := sql.Open("sqlite3", dsn)
2023-02-20 08:43:14 +00:00
if err != nil {
return nil, err
}
2023-02-23 00:04:26 +00:00
return db, nil
2023-02-21 03:56:19 +00:00
}