//
// Code generated by go-jet DO NOT EDIT.
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//

package model

import "errors"

type Fieldtype string

const (
	Fieldtype_EsriFieldTypeSmallInteger Fieldtype = "esriFieldTypeSmallInteger"
	Fieldtype_EsriFieldTypeInteger      Fieldtype = "esriFieldTypeInteger"
	Fieldtype_EsriFieldTypeSingle       Fieldtype = "esriFieldTypeSingle"
	Fieldtype_EsriFieldTypeDouble       Fieldtype = "esriFieldTypeDouble"
	Fieldtype_EsriFieldTypeString       Fieldtype = "esriFieldTypeString"
	Fieldtype_EsriFieldTypeDate         Fieldtype = "esriFieldTypeDate"
	Fieldtype_EsriFieldTypeOID          Fieldtype = "esriFieldTypeOID"
	Fieldtype_EsriFieldTypeGeometry     Fieldtype = "esriFieldTypeGeometry"
	Fieldtype_EsriFieldTypeBlob         Fieldtype = "esriFieldTypeBlob"
	Fieldtype_EsriFieldTypeRaster       Fieldtype = "esriFieldTypeRaster"
	Fieldtype_EsriFieldTypeGUID         Fieldtype = "esriFieldTypeGUID"
	Fieldtype_EsriFieldTypeGlobalID     Fieldtype = "esriFieldTypeGlobalID"
	Fieldtype_EsriFieldTypeXML          Fieldtype = "esriFieldTypeXML"
	Fieldtype_EsriFieldTypeBigInteger   Fieldtype = "esriFieldTypeBigInteger"
)

var FieldtypeAllValues = []Fieldtype{
	Fieldtype_EsriFieldTypeSmallInteger,
	Fieldtype_EsriFieldTypeInteger,
	Fieldtype_EsriFieldTypeSingle,
	Fieldtype_EsriFieldTypeDouble,
	Fieldtype_EsriFieldTypeString,
	Fieldtype_EsriFieldTypeDate,
	Fieldtype_EsriFieldTypeOID,
	Fieldtype_EsriFieldTypeGeometry,
	Fieldtype_EsriFieldTypeBlob,
	Fieldtype_EsriFieldTypeRaster,
	Fieldtype_EsriFieldTypeGUID,
	Fieldtype_EsriFieldTypeGlobalID,
	Fieldtype_EsriFieldTypeXML,
	Fieldtype_EsriFieldTypeBigInteger,
}

func (e *Fieldtype) Scan(value interface{}) error {
	var enumValue string
	switch val := value.(type) {
	case string:
		enumValue = val
	case []byte:
		enumValue = string(val)
	default:
		return errors.New("jet: Invalid scan value for AllTypesEnum enum. Enum value has to be of type string or []byte")
	}

	switch enumValue {
	case "esriFieldTypeSmallInteger":
		*e = Fieldtype_EsriFieldTypeSmallInteger
	case "esriFieldTypeInteger":
		*e = Fieldtype_EsriFieldTypeInteger
	case "esriFieldTypeSingle":
		*e = Fieldtype_EsriFieldTypeSingle
	case "esriFieldTypeDouble":
		*e = Fieldtype_EsriFieldTypeDouble
	case "esriFieldTypeString":
		*e = Fieldtype_EsriFieldTypeString
	case "esriFieldTypeDate":
		*e = Fieldtype_EsriFieldTypeDate
	case "esriFieldTypeOID":
		*e = Fieldtype_EsriFieldTypeOID
	case "esriFieldTypeGeometry":
		*e = Fieldtype_EsriFieldTypeGeometry
	case "esriFieldTypeBlob":
		*e = Fieldtype_EsriFieldTypeBlob
	case "esriFieldTypeRaster":
		*e = Fieldtype_EsriFieldTypeRaster
	case "esriFieldTypeGUID":
		*e = Fieldtype_EsriFieldTypeGUID
	case "esriFieldTypeGlobalID":
		*e = Fieldtype_EsriFieldTypeGlobalID
	case "esriFieldTypeXML":
		*e = Fieldtype_EsriFieldTypeXML
	case "esriFieldTypeBigInteger":
		*e = Fieldtype_EsriFieldTypeBigInteger
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Fieldtype enum")
	}

	return nil
}

func (e Fieldtype) String() string {
	return string(e)
}
