18 lines
260 B
Go
18 lines
260 B
Go
|
package invites
|
||
|
|
||
|
import (
|
||
|
"database/sql"
|
||
|
_ "github.com/mattn/go-sqlite3"
|
||
|
)
|
||
|
|
||
|
const dsn = "/town/var/invites/invites.db?mode=rw"
|
||
|
|
||
|
func ConnectDB() (*sql.DB, error) {
|
||
|
db, err := sql.Open("sqlite3", dsn)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
return db, nil
|
||
|
}
|