sprechstunden-go/sqldb/sqldb.go

18 lines
259 B
Go
Raw Normal View History

2022-08-29 20:58:19 +00:00
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
}