2023-02-20 08:43:14 +00:00
|
|
|
package signup
|
|
|
|
|
|
|
|
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
|
|
|
}
|