package db

import (
	"database/sql"

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

type XsampleStore struct {
	Db *sql.DB
}

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

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

	return XsampleStore{
		Db,
	}, nil
}
