package config

import (
	"database/sql/driver"
)

// Cloud is the cloud DBaaS runs in. The laptop is "local"
type Cloud string

// Stage is the purpose of the dbaas in the development flow
type Stage string

const (
	// Gcp is the GCP cloud
	Gcp = Cloud("gcp")

	// Aws is the AWS cloud
	Aws = Cloud("aws")
)

const (
	// StageE2E is for e2e test
	StageE2E     = Stage("e2e")
	StageNightly = Stage("nightly")
)

// Scan is for gorm
func (u *Cloud) Scan(value interface{}) error {
	*u = Cloud(value.([]byte))
	return nil
}

// Value is for gorm
func (u Cloud) Value() (driver.Value, error) { return string(u), nil }

func (u Cloud) String() string {
	return string(u)
}
