whois/database/conn.go
Elizabeth Hunt d25ec27fb1
Some checks failed
continuous-integration/drone/push Build is failing
initial commit by simponic-infra
2025-01-05 16:39:13 -08:00

18 lines
334 B
Go

package database
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
"log"
)
func MakeConn(databasePath *string) *sql.DB {
log.Println("opening database at", *databasePath, "with foreign keys enabled")
dbConn, err := sql.Open("sqlite3", *databasePath+"?_foreign_keys=on")
if err != nil {
panic(err)
}
return dbConn
}