router-ui-backend/database/Database.go

17 lines
260 B
Go
Raw Normal View History

2024-09-15 12:23:22 +00:00
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
}