package staters

// |@@| C

import (
	"context"
	"gardening/src/lib/sql_db"
)

type BaseStater struct {
	SqlDb *sql_db.SqlDb
}

func (this *BaseStater) GoToState(ctx context.Context) {
	if this.SqlDb.Sql.IsInMemory(ctx) {
		this.SqlDb.LoadSchema(ctx)
	} else {
		this.SqlDb.DestroyDb(ctx)
		this.SqlDb.CreateEmptyDb(ctx)
		this.SqlDb.LoadSchema(ctx)
	}
}
