package mysql

import (
	"gorm.io/driver/sqlite"
	"gorm.io/gorm"
)

type sqliteRepo struct {
	DbR *gorm.DB
	DbW *gorm.DB
}

func (d *sqliteRepo) i()               {}
func (d *sqliteRepo) GetDbR() *gorm.DB { return d.DbR }
func (d *sqliteRepo) GetDbW() *gorm.DB { return d.DbW }
func (d *sqliteRepo) DbRClose() error  { return nil }
func (d *sqliteRepo) DbWClose() error  { return nil }

func NewSQLiteRepoForTest() (Repo, error) {
	db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{})
	if err != nil {
		return nil, err
	}
	return &sqliteRepo{DbR: db, DbW: db}, nil
}
