18 lines
259 B
Go
18 lines
259 B
Go
|
package sqldb
|
||
|
|
||
|
import (
|
||
|
"database/sql"
|
||
|
|
||
|
_ "github.com/mattn/go-sqlite3"
|
||
|
)
|
||
|
|
||
|
// ConnectDB opens a connection to the database
|
||
|
func ConnectDB() *sql.DB {
|
||
|
db, err := sql.Open("sqlite3", "sprechstunden.db")
|
||
|
if err != nil {
|
||
|
panic(err.Error())
|
||
|
}
|
||
|
|
||
|
return db
|
||
|
}
|