package database import ( "log" "git.runcible.io/androiddrew/flux-feed/config" "github.com/jmoiron/sqlx" ) func NewSqlx(cfg config.Database) *sqlx.DB { var dsn string // TODO add additional database driver support switch cfg.DatabaseDriver { case "libsql": if cfg.DatabaseDriver == "local" { dsn = cfg.DatabasePath } default: log.Fatal("Must choose a database driver") } db := sqlx.MustConnect(cfg.DatabaseDriver, dsn) return db }