2021-07-27 17:39:21 +02:00
|
|
|
package metadata
|
|
|
|
|
|
|
|
|
|
// Column struct
|
|
|
|
|
type Column struct {
|
|
|
|
|
Name string
|
|
|
|
|
IsPrimaryKey bool
|
|
|
|
|
IsNullable bool
|
2023-01-30 10:42:06 -05:00
|
|
|
IsGenerated bool
|
2021-07-27 17:39:21 +02:00
|
|
|
DataType DataType
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DataTypeKind is database type kind(base, enum, user-defined, array)
|
|
|
|
|
type DataTypeKind string
|
|
|
|
|
|
|
|
|
|
// DataTypeKind possible values
|
|
|
|
|
const (
|
|
|
|
|
BaseType DataTypeKind = "base"
|
|
|
|
|
EnumType DataTypeKind = "enum"
|
|
|
|
|
UserDefinedType DataTypeKind = "user-defined"
|
|
|
|
|
ArrayType DataTypeKind = "array"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// DataType contains information about column data type
|
|
|
|
|
type DataType struct {
|
|
|
|
|
Name string
|
|
|
|
|
Kind DataTypeKind
|
|
|
|
|
IsUnsigned bool
|
|
|
|
|
}
|