Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnInfo ¶
ColumnInfo metadata struct
func (ColumnInfo) GoBaseType ¶
func (c ColumnInfo) GoBaseType() string
GoBaseType returns model type for column info.
func (ColumnInfo) GoModelTag ¶
func (c ColumnInfo) GoModelTag(isPrimaryKey bool) string
GoModelTag returns model field tag for column
func (ColumnInfo) GoModelType ¶
func (c ColumnInfo) GoModelType() string
GoModelType returns model type for column info with optional pointer if column can be NULL.
func (ColumnInfo) SqlBuilderColumnType ¶
func (c ColumnInfo) SqlBuilderColumnType() string
SqlBuilderColumnType returns type of jet sql builder column
type EnumInfo ¶
type EnumInfo struct {
	Values []string
	// contains filtered or unexported fields
}
    EnumInfo struct
type SchemaInfo ¶
type SchemaInfo struct {
	DatabaseName string
	Name         string
	TableInfos   []metadata.MetaData
	EnumInfos    []metadata.MetaData
}
    SchemaInfo metadata struct
func GetSchemaInfo ¶
func GetSchemaInfo(db *sql.DB, databaseName, schemaName string) (schemaInfo SchemaInfo, err error)
GetSchemaInfo returns schema information from db connection.
type TableInfo ¶
type TableInfo struct {
	SchemaName string
	PrimaryKeys map[string]bool
	Columns     []ColumnInfo
	// contains filtered or unexported fields
}
    TableInfo metadata struct
func GetTableInfo ¶
func GetTableInfo(db *sql.DB, dbName, schemaName, tableName string) (tableInfo TableInfo, err error)
GetTableInfo returns table info metadata
func (TableInfo) GetImports ¶
GetImports returns model imports for table.
func (TableInfo) GoStructName ¶
GoStructName returns go struct name for sql builder
func (TableInfo) IsPrimaryKey ¶
IsPrimaryKey returns if column is a part of primary key
func (TableInfo) MutableColumns ¶
func (t TableInfo) MutableColumns() []ColumnInfo
MutableColumns returns list of mutable columns for table