phoneof/database/conn.go
Elizabeth Hunt f163a24279
All checks were successful
continuous-integration/drone/push Build is passing
initial commit
2025-01-03 01:47:07 -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
}