package db

import (
	"database/sql"

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

type LoginStore struct {
	Db *sql.DB
}

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

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

	return LoginStore{
		Db,
	}, nil
}
