router-ui-backend/database/Database.go
2024-09-15 05:23:22 -07:00

17 lines
260 B
Go

package database
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
)
const database string = "database/main.db"
func OpenDatabase() (*sql.DB, error) {
db, err := sql.Open("sqlite3", database)
if err != nil {
return nil, err
}
return db, nil
}