# Conflicts: # generator/template/model_template.go # generator/template/sql_builder_template.go # internal/jet/expression.go # postgres/cast.go # postgres/columns.go # postgres/expressions.go # postgres/insert_statement_test.go # postgres/literal.go # tests/postgres/alltypes_test.go # tests/postgres/generator_template_test.go # tests/postgres/scan_test.go # tests/postgres/select_test.go
32 lines
757 B
Go
32 lines
757 B
Go
package metadata
|
|
|
|
// Column struct
|
|
type Column struct {
|
|
Name string `sql:"primary_key"`
|
|
IsPrimaryKey bool
|
|
IsNullable bool
|
|
IsGenerated bool
|
|
HasDefault bool
|
|
DataType DataType
|
|
Comment string
|
|
}
|
|
|
|
// 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"
|
|
RangeType DataTypeKind = "range"
|
|
)
|
|
|
|
// DataType contains information about column data type
|
|
type DataType struct {
|
|
Name string
|
|
Kind DataTypeKind
|
|
IsUnsigned bool
|
|
Dimensions int // The number of array dimensions
|
|
}
|