AC-FuSa-Tools / nav

navigate kernel database
GNU General Public License v2.0
3 stars 4 forks source link

Move DB connection dial to the config package #25

Open Darth-Mera opened 1 year ago

Darth-Mera commented 1 year ago

Currently the DB connection is happening in main():

    t := connectToken{conf.ConfValues.DBDriver, conf.ConfValues.DBDSN}
    db := connectDb(&t)

It would make more sense if the db connection instance lived together with the configuration logic, and was just passed around the rest of the program as a pointer in the Config struct (there's a TODO in the code).