Versions in this module Expand all Collapse all v0 v0.2.0 Oct 12, 2022 v0.1.0 Sep 13, 2022 Changes in this version + const TypeBool + const TypeByteSlice + const TypeDuration + const TypeFloat32 + const TypeFloat64 + const TypeIP + const TypeIPNet + const TypeInt + const TypeInt32 + const TypeInt64 + const TypeInterface + const TypeMapInterface + const TypeMapString + const TypePGBool + const TypePGBpchar + const TypePGBytea + const TypePGCidr + const TypePGDate + const TypePGFloat4 + const TypePGFloat8 + const TypePGHstore + const TypePGInet + const TypePGInt2 + const TypePGInt4 + const TypePGInt8 + const TypePGInterval + const TypePGJSON + const TypePGJSONB + const TypePGNumeric + const TypePGPoint + const TypePGText + const TypePGTime + const TypePGTimestamp + const TypePGTimestamptz + const TypePGTimetz + const TypePGUuid + const TypePGVarchar + const TypeString + const TypeTime + func GoImport(pgType string, nullable, useSQLNull bool) string + func GoNullable(pgType string, useSQLNull bool, customTypes CustomTypeMapping) (string, error) + func GoSlice(pgType string, dimensions int) (string, error) + func GoType(pgType string) (string, error) + type Column struct + Dimensions int + GoName string + GoType string + Import string + IsArray bool + IsFK bool + IsPK bool + MaxLen int + Nullable bool + PGName string + PGType string + Relation *columnRelWrap + Type string + Values []string + func NewColumn(pgName string, pgType string, nullable, sqlNulls, array bool, dims int, ...) Column + func (c *Column) AddRelation(relation *Relation, relPK string) + type CustomType struct + GoImport string + GoType string + PGType string + type CustomTypeMapping map[string]CustomType + func ParseCustomTypes(raw []string) (CustomTypeMapping, error) + func (c CustomTypeMapping) Add(pgType, goType, goImport string) + func (c CustomTypeMapping) GoImport(pgType string) (string, bool) + func (c CustomTypeMapping) GoType(pgType string) (string, bool) + func (c CustomTypeMapping) Has(pgType string) bool + func (c CustomTypeMapping) Imports() []string + type Entity struct + Columns []Column + GoName string + GoNamePlural string + Imports []string + PGFullName string + PGName string + PGSchema string + Relations []Relation + ViewName string + func NewEntity(schema, pgName string, columns []Column, relations []Relation) Entity + func (e *Entity) AddColumn(column Column) + func (e *Entity) AddRelation(relation Relation) + func (e *Entity) GetPKs() []Column + func (e *Entity) HasMultiplePKs() bool + type Relation struct + FKFields []string + GoName string + GoType string + PKFields []string + TargetEntity *Entity + TargetPGFullName string + TargetPGName string + TargetPGSchema string + func NewRelation(sourceColumns []string, targetSchema, targetTable string, ...) Relation + func (r *Relation) AddEntity(entity *Entity)