package db

import (
	"database/sql"

	_ "github.com/glebarez/go-sqlite"
)

type MasterMenuUserGroupStore struct {
	Db *sql.DB
}

func NewMasterMenuUserGroupStore(dbName string) (MasterMenuUserGroupStore, error) {
	Db, err := getConnection(dbName)
	if err != nil {
		return MasterMenuUserGroupStore{}, err
	}

	if err := createMigrations(dbName, Db); err != nil {
		return MasterMenuUserGroupStore{}, err
	}

	return MasterMenuUserGroupStore{
		Db,
	}, nil
}
