Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GoTypeMap = map[GoType]string{ GoInt: "int64", GoFloat64: "float64", GoBool: "bool", GoString: "string", GoTime: "time.Time", GoNullInt: "sql.NullInt64", GoNullFloat64: "sql.NullFloat64", GoNullBool: "sql.NullBool", GoNullString: "sql.NullString", }
map GoType constants to strings of actual types
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct { Name string EscapedName string RealName string Default sql.NullString Nullable bool Type GoType GoType string Primary bool AutoInc bool Comment string Format string }
represent individual field in the table
type Generator ¶
type Generator struct { Db *sql.DB Schema string Tables []*Table Imports map[string]bool Output *bytes.Buffer }
Gomgen generator is the primary interface for scanning, analyzing and generating models with gomgen
func NewGenerator ¶
create and initialize new Gomgen object
type Relation ¶
type Relation struct { Name string Table *Table Column *Field // null for many-to-many TargetEntity *Table TargetColumn *Field // null for many-to-many MiddleEntity *Table // connecting table MiddleSrcColumn *Field // point to this entity MiddleDstColumn *Field // point to target entity }
represent a relation between the tables
type RelationType ¶
type RelationType int
specify the relation type between the entities
const ( OneToOne RelationType = iota OneToMany ManyToMany )
Click to show internal directories.
Click to hide internal directories.