func (f BookTypeField) GreaterOrEqual(v BookType) generated.Where {
	return generated.Where{
		Field: string(f),
		Comp:  generated.CompGTE,
		Value: v,
	}
}
GreaterOrEqual returns a generated.Where for this field.
package enum
import (
	"database/sql/driver"
	"github.com/gnormal/postgres-go/generated"
	"github.com/pkg/errors"
)
type BookType uint16
const (
	UnknownBookType BookType = 0
	FictionBookType BookType = 1
	NonfictionBookType BookType = 2
)
func (e BookType) String() string {
	switch e {
	case FictionBookType:
		return "FICTION"
	case NonfictionBookType:
		return "NONFICTION"
	default:
		return "UnknownBookType"
	}
}
func (e BookType) MarshalText() ([]byte, error) {
	return []byte(e.String()), nil
}
func (e *BookType) UnmarshalText(text []byte) error {
	val, err := ParseBookType(string(text))
	if err != nil {
		return err
	}
	*e = val
	return nil
}
func ParseBookType(s string) (BookType, error) {
	switch s {
	case "FICTION":
		return FictionBookType, nil
	case "NONFICTION":
		return NonfictionBookType, nil
	default:
		return UnknownBookType, errors.New("invalid BookType")
	}
}
func (e BookType) Value() (driver.Value, error) {
	return e.String(), nil
}
func (e *BookType) Scan(src interface{}) error {
	buf, ok := src.([]byte)
	if !ok {
		return errors.New("invalid BookType")
	}
	return e.UnmarshalText(buf)
}
type BookTypeField string
func (f BookTypeField) Equals(v BookType) generated.Where {
	return generated.Where{
		Field: string(f),
		Comp:  generated.CompEqual,
		Value: v,
	}
}
func (f BookTypeField) GreaterThan(v BookType) generated.Where {
	return generated.Where{
		Field: string(f),
		Comp:  generated.CompGreater,
		Value: v,
	}
}
func (f BookTypeField) LessThan(v BookType) generated.Where {
	return generated.Where{
		Field: string(f),
		Comp:  generated.CompEqual,
		Value: v,
	}
}