package db

import (
	"database/sql"

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

type LandingPageStore struct {
	Db *sql.DB
}

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

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

	return LandingPageStore{
		Db,
	}, nil
}
