Documentation
¶
Index ¶
- Constants
- Variables
- type Datatype
- func (dt Datatype) GoTypeString() (s string)
- func (dt Datatype) HasGoUnsigned() bool
- func (dt Datatype) IsBinary() bool
- func (dt Datatype) IsInt() bool
- func (dt Datatype) IsNumeric() bool
- func (dt Datatype) IsSignable() bool
- func (dt Datatype) IsString() bool
- func (dt Datatype) IsTime() bool
- func (dt Datatype) MarshalYAML() (interface{}, error)
- func (dt Datatype) RequiresParams() bool
- func (dt Datatype) String() (s string)
- func (dt *Datatype) UnmarshalYAML(value *yaml.Node) (err error)
Constants ¶
const ( Integer = idInteger | metaNumeric | metaInteger | metaSignable | metaHasGoUnisgned TinyInt = idTinyInt | metaNumeric | metaInteger | metaSignable | metaHasGoUnisgned SmallInt = idSmallInt | metaNumeric | metaInteger | metaSignable | metaHasGoUnisgned MediumInt = idMediumInt | metaNumeric | metaInteger | metaSignable | metaHasGoUnisgned BigInt = idBigInt | metaNumeric | metaInteger | metaSignable | metaHasGoUnisgned Decimal = idDecimal | metaNumeric | metaSignable | metaRequiresParams Varchar = idVarchar | metaString Text = idText | metaString TinyText = idTinyText | metaString MediumText = idMediumText | metaString LongText = idLongText | metaString Char = idChar | metaString Blob = idBlob | metaBinary Enum = idEnum | metaString | metaRequiresParams Boolean = idBoolean Date = idDate | metaTime DateTime = idDateTime | metaTime Time = idTime | metaTime Timestamp = idTimestamp | metaTime Year = idYear | metaTime )
These are the actual Datatype constants with all the metadata and unique identifiers encoded into them
Variables ¶
var ErrUnknownDatatype = errors.New("invalid datatype")
ErrUnknownDatatype is the error returned by functions when an unknown or invalid datatype is used
Functions ¶
This section is empty.
Types ¶
type Datatype ¶
type Datatype uint64
Datatype is used to encode information about types for use in repository or validation The least-significant 8 bits are reserved for general metadata The next 16 bits are not currently used. They were historically reserved for DBMS support in the early concept stage. The next 8 bits are reserved for unique type identification The last 32 bits are not currently used
func FromString ¶
FromString returns the decoded Datatype, and an error if the in string is invalid or unknown
func (Datatype) GoTypeString ¶
func (Datatype) HasGoUnsigned ¶
HasGoUnsigned returns true if the Datatype has an unsigned variant Go type like int and uint
func (Datatype) IsSignable ¶
IsSignable returns true if the Datatype can be stored as either a signed or unsigned value
func (Datatype) MarshalYAML ¶
MarshalYAML provides an implementation for yaml/v2.Marshaler, returns a string representation of the Datatype
func (Datatype) RequiresParams ¶
RequiresParams returns true if the Datatype requires parameters in SQL syntax. The `(8, 5)` in SQL's `DECIMAL(8, 5)` for example
func (*Datatype) UnmarshalYAML ¶
UnmarshalYAML provides an implementation for yaml/v2.Unmarshaler to parse the yaml config