Documentation ¶
Index ¶
- Variables
- func CheckError(err error)
- func CloseDB()
- func ConnectDB(userName, password, dbname string)
- func ConnectOracleDB(user, password, server, service string, port int)
- func ConnectPostgresDB(user, password, dbname, host string, port int)
- func GetCSharpDataTypeForMySql(dataType string, numericPrecision int) string
- func GetCSharpDataTypeForOracle(dataType string, numericPrecision int) string
- func GetCSharpDataTypeForPostgres(dataType string, numericPrecision int) string
- func GetCSharpFirstUnitTestValueForMySql(dataType string) string
- func GetCSharpFirstUnitTestValueForOracle(dataType string) string
- func GetCSharpFirstUnitTestValueForPostgres(dataType string) string
- func GetCSharpSecondUnitTestValueForMySql(dataType string) string
- func GetCSharpSecondUnitTestValueForOracle(dataType string) string
- func GetCSharpSecondUnitTestValueForPostgres(dataType string) string
- func GetColumnNames(schema, tableName string) []string
- func GetGoDataTypeForMySql(dataType string, numericPrecision int) string
- func GetGoDataTypeForOracle(dataType string) string
- func GetGoDataTypeForPostgres(dataType string) string
- func GetGoFirstUnitTestValueForMySql(dataType string, numericPrecision int) string
- func GetGoFirstUnitTestValueForOracle(dataType string) string
- func GetGoFirstUnitTestValueForPostgres(dataType string) string
- func GetGoSecondUnitTestValueForMySql(dataType string, numericPrecision int) string
- func GetGoSecondUnitTestValueForOracle(dataType string) string
- func GetGoSecondUnitTestValueForPostgres(dataType string) string
- func GetJavaDataTypeForMySql(dataType string, numericPrecision int) string
- func GetJavaDataTypeForOracle(dataType string, numericPrecision int) string
- func GetJavaDataTypeForPostgres(dataType string, numericPrecision int) string
- func GetJavaFirstUnitTestValueForMySql(dataType string) string
- func GetJavaFirstUnitTestValueForOracle(dataType string) string
- func GetJavaFirstUnitTestValueForPostgres(dataType string) string
- func GetJavaSecondUnitTestValueForMySql(dataType string) string
- func GetJavaSecondUnitTestValueForOracle(dataType string) string
- func GetJavaSecondUnitTestValueForPostgres(dataType string) string
- func GetJavascriptDataTypeForMySql(dataType string, numericPrecision int) string
- func GetJavascriptDataTypeForOracle(dataType string, numericPrecision int) string
- func GetJavascriptDataTypeForPostgres(dataType string, numericPrecision int) string
- func GetJavascriptDefaultValueForMySql(dataType string, numericPrecision int) string
- func GetJavascriptDefaultValueForOracle(dataType string, numericPrecision int) string
- func GetJavascriptDefaultValueForPostgres(dataType string, numericPrecision int) string
- func GetPkColumnName(columnName string, keys []ForeignKey) string
- func GetPkTableName(columnName string, keys []ForeignKey) string
- func GetPostgresPrimaryKeys(tableName, schema string) []string
- func GetTableNames(schema string) []string
- func GetTableNamesOracle() []string
- func GetTableNamesPostgres(schema string) []string
- func IsColumnForeignKey(columnName string, keys []ForeignKey) bool
- func MakeTitle(s string) string
- type Actor
- type Column
- func GetColumn(schema, columnName, tableName string) Column
- func GetColumnPostgres(schema, columnName, tableName, database string, primaryKeys []string) Column
- func GetColumnsOracle(tableName, schema string, primaryKeys []OraclePrimaryKey, fks []ForeignKey) []Column
- func GetPostgresColumns(tableName, schema, database string, fks []ForeignKey) []Column
- func NewColumn(columnName, databaseType, tableName string) Column
- func (c *Column) GetAspNetRouteConstraintType() string
- func (c *Column) GetCSharpDataType() string
- func (c *Column) GetCSharpFirstUnitTestValue() string
- func (c *Column) GetCSharpFirstUnitTestValueFromFile(valuesFile string) string
- func (c *Column) GetCSharpSecondUnitTestValue() string
- func (c *Column) GetCSharpSecondUnitTestValueFromFile(valuesFile string) string
- func (c *Column) GetCamelCaseColumnName() string
- func (c *Column) GetGoDataType() string
- func (c *Column) GetGoFirstUnitTestValue() string
- func (c *Column) GetGoSecondUnitTestValue() string
- func (c *Column) GetJavaDataType() string
- func (c *Column) GetJavaFirstUnitTestValue() string
- func (c *Column) GetJavaFirstUnitTestValueFromFile(valuesFile string) string
- func (c *Column) GetJavaSecondUnitTestValue() string
- func (c *Column) GetJavaSecondUnitTestValueFromFile(valuesFile string) string
- func (c *Column) GetJavascriptDataType() string
- func (c *Column) GetJavascriptDefaultValue() string
- func (c *Column) GetPascalCaseColumnName() string
- func (c *Column) GetPascalCaseTableName() string
- func (c *Column) GetSetString() string
- func (c *Column) GetSetStringJson() string
- func (c *Column) GetTitleCaseColumnName() string
- func (c *Column) GetTitleCaseTableName() string
- func (c *Column) IsBinary() bool
- func (c *Column) IsGoIntFamilyType() bool
- func (c *Column) Test() string
- type ForeignKey
- func GetForeignKeys(database, tableName string) []ForeignKey
- func GetOracleForeignKeys(tableName, schema string) []ForeignKey
- func GetOracleReferencedForeignKeys(tableName, schema string) []ForeignKey
- func GetPostgresForeignKeys(schema, database, tableName string, primaryKeys []string) []ForeignKey
- func GetPostgresReferencedForeignKeys(schema, database, tableName string, primaryKeys []string) []ForeignKey
- func GetReferencedForeignKeys(database, tableName string) []ForeignKey
- func NewForeignKey(constraintName, fkTableName, fkColumnName, pkTableName, pkColumnName string) ForeignKey
- func (f *ForeignKey) GetCamelCaseFKColumnName() string
- func (f *ForeignKey) GetCamelCaseFKTableName() string
- func (f *ForeignKey) GetCamelCaseFKTableNamePlural() string
- func (f *ForeignKey) GetCamelCasePKColumnName() string
- func (f *ForeignKey) GetCamelCasePKTableName() string
- func (f *ForeignKey) GetCamelCasePKTableNamePlural() string
- func (f *ForeignKey) GetPascalCaseFKColumnName() string
- func (f *ForeignKey) GetPascalCaseFKTableName() string
- func (f *ForeignKey) GetPascalCaseFKTableNamePlural() string
- func (f *ForeignKey) GetPascalCasePKColumnName() string
- func (f *ForeignKey) GetPascalCasePKTableName() string
- func (f *ForeignKey) GetPascalCasePKTableNamePlural() string
- type GuiEdit
- type GuiList
- type GuiListColumn
- type GuiListTable
- type GuiListTables
- type IntegrationTestSettings
- type MySqlColumn
- type MySqlForeignKey
- type OracleColumn
- type OraclePrimaryKey
- type PostgresColumn
- type PostgresPrimaryKey
- type Table
- func (t *Table) AddColumn(column Column)
- func (t *Table) GetCSharpFirstPrimaryUnitTestValue() string
- func (t *Table) GetCSharpSecondPrimaryUnitTestValue() string
- func (t *Table) GetCamelCaseTableName() string
- func (t *Table) GetCamelCaseTableNameEF() string
- func (t *Table) GetCamelCaseTableNamePlural() string
- func (t *Table) GetColumnListWithCSharpTypes() string
- func (t *Table) GetFirstPrimaryColumn() Column
- func (t *Table) GetFkTableNameForColumn(columnName string) string
- func (t *Table) GetJavaFirstPrimaryUnitTestValue() string
- func (t *Table) GetJavaSecondPrimaryUnitTestValue() string
- func (t *Table) GetNullableColumns() []Column
- func (t *Table) GetPascalCaseTableName() string
- func (t *Table) GetPascalCaseTableNameEF() string
- func (t *Table) GetPascalCaseTableNamePlural() string
- func (t *Table) GetPrimaryColumns() []Column
- func (t *Table) GetTableName() string
- func (t *Table) HasAutoIncrementColumn() bool
- func (t *Table) HasCompositePrimaryKey() bool
- func (t *Table) HasDateColumn() bool
- func (t *Table) HasJavascriptNumberColumn() bool
- func (t *Table) HasJavascriptStringColumn() bool
- type Tag
- type Template
- type Templates
- type UnitTestValue
- type UnitTestValueColumn
- type UnitTestValueTable
- type UnitTestValueTables
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *sql.DB
Functions ¶
func CheckError ¶
func CheckError(err error)
func ConnectOracleDB ¶
func ConnectPostgresDB ¶
func GetColumnNames ¶
func GetGoDataTypeForMySql ¶
func GetGoDataTypeForOracle ¶
func GetJavaDataTypeForMySql ¶
func GetPkColumnName ¶
func GetPkColumnName(columnName string, keys []ForeignKey) string
func GetPkTableName ¶
func GetPkTableName(columnName string, keys []ForeignKey) string
func GetPostgresPrimaryKeys ¶
func GetTableNames ¶
func GetTableNamesOracle ¶
func GetTableNamesOracle() []string
func GetTableNamesPostgres ¶
func IsColumnForeignKey ¶
func IsColumnForeignKey(columnName string, keys []ForeignKey) bool
Types ¶
type Column ¶
type Column struct {
ColumnName, DataType, DatabaseType, TableName, PkTableName, PkColumnName string
IsPrimaryKey, IsNullable, IsAutoIncrement, IsForeignKey bool
OrdinalPosition, NumericPrecision, NumericScale, CharacterMaximumLength int
}
func GetColumnPostgres ¶
func GetColumnsOracle ¶
func GetColumnsOracle(tableName, schema string, primaryKeys []OraclePrimaryKey, fks []ForeignKey) []Column
func GetPostgresColumns ¶
func GetPostgresColumns(tableName, schema, database string, fks []ForeignKey) []Column
func (*Column) GetAspNetRouteConstraintType ¶
func (*Column) GetCSharpDataType ¶
func (*Column) GetCSharpFirstUnitTestValue ¶
func (*Column) GetCSharpFirstUnitTestValueFromFile ¶
func (*Column) GetCSharpSecondUnitTestValue ¶
func (*Column) GetCSharpSecondUnitTestValueFromFile ¶
func (*Column) GetCamelCaseColumnName ¶
func (*Column) GetGoDataType ¶
func (*Column) GetGoFirstUnitTestValue ¶
func (*Column) GetGoSecondUnitTestValue ¶
func (*Column) GetJavaDataType ¶
func (*Column) GetJavaFirstUnitTestValue ¶
func (*Column) GetJavaFirstUnitTestValueFromFile ¶
func (*Column) GetJavaSecondUnitTestValue ¶
func (*Column) GetJavaSecondUnitTestValueFromFile ¶
func (*Column) GetJavascriptDataType ¶
func (*Column) GetJavascriptDefaultValue ¶
func (*Column) GetPascalCaseColumnName ¶
func (*Column) GetPascalCaseTableName ¶
func (*Column) GetSetString ¶
func (*Column) GetSetStringJson ¶
func (*Column) GetTitleCaseColumnName ¶ added in v0.0.12
func (*Column) GetTitleCaseTableName ¶ added in v0.0.12
func (*Column) IsGoIntFamilyType ¶ added in v0.0.9
type ForeignKey ¶
type ForeignKey struct {
ConstraintName, FkTableName, FkColumnName, PkTableName, PkColumnName, Relation string
FkColumn, PkColumn Column
}
func GetForeignKeys ¶
func GetForeignKeys(database, tableName string) []ForeignKey
func GetOracleForeignKeys ¶
func GetOracleForeignKeys(tableName, schema string) []ForeignKey
func GetOracleReferencedForeignKeys ¶
func GetOracleReferencedForeignKeys(tableName, schema string) []ForeignKey
func GetPostgresForeignKeys ¶
func GetPostgresForeignKeys(schema, database, tableName string, primaryKeys []string) []ForeignKey
func GetPostgresReferencedForeignKeys ¶
func GetPostgresReferencedForeignKeys(schema, database, tableName string, primaryKeys []string) []ForeignKey
func GetReferencedForeignKeys ¶
func GetReferencedForeignKeys(database, tableName string) []ForeignKey
func NewForeignKey ¶
func NewForeignKey(constraintName, fkTableName, fkColumnName, pkTableName, pkColumnName string) ForeignKey
func (*ForeignKey) GetCamelCaseFKColumnName ¶
func (f *ForeignKey) GetCamelCaseFKColumnName() string
func (*ForeignKey) GetCamelCaseFKTableName ¶
func (f *ForeignKey) GetCamelCaseFKTableName() string
func (*ForeignKey) GetCamelCaseFKTableNamePlural ¶
func (f *ForeignKey) GetCamelCaseFKTableNamePlural() string
func (*ForeignKey) GetCamelCasePKColumnName ¶
func (f *ForeignKey) GetCamelCasePKColumnName() string
func (*ForeignKey) GetCamelCasePKTableName ¶
func (f *ForeignKey) GetCamelCasePKTableName() string
func (*ForeignKey) GetCamelCasePKTableNamePlural ¶
func (f *ForeignKey) GetCamelCasePKTableNamePlural() string
func (*ForeignKey) GetPascalCaseFKColumnName ¶
func (f *ForeignKey) GetPascalCaseFKColumnName() string
func (*ForeignKey) GetPascalCaseFKTableName ¶
func (f *ForeignKey) GetPascalCaseFKTableName() string
func (*ForeignKey) GetPascalCaseFKTableNamePlural ¶
func (f *ForeignKey) GetPascalCaseFKTableNamePlural() string
func (*ForeignKey) GetPascalCasePKColumnName ¶
func (f *ForeignKey) GetPascalCasePKColumnName() string
func (*ForeignKey) GetPascalCasePKTableName ¶
func (f *ForeignKey) GetPascalCasePKTableName() string
func (*ForeignKey) GetPascalCasePKTableNamePlural ¶
func (f *ForeignKey) GetPascalCasePKTableNamePlural() string
type GuiEdit ¶
type GuiEdit struct {
Columns []GuiListColumn `json:"columns"`
}
type GuiList ¶
type GuiList struct { FirstColumn GuiListColumn `json:"firstColumn"` Columns []GuiListColumn `json:"columns"` }
type GuiListColumn ¶
type GuiListColumn struct { ColumnName string `json:"columnName"` Title string `json:"title"` Value string `json:"value"` GuiControl string `json:"guiControl"` SelectOptions string `json:"selectOptions"` SelectKey string `json:"selectKey"` SelectValue string `json:"selectValue"` SelectTableName string `json:"selectTableName"` }
type GuiListTable ¶
type GuiListTable struct { TableName string `json:"tableName"` AllowAttachedFiles bool `json:"allowAttachedFiles"` GuiList GuiList `json:"list"` GuiEdit GuiEdit `json:"edit"` }
func (*GuiListTable) GetEditGuiControlForColumn ¶
func (t *GuiListTable) GetEditGuiControlForColumn(columnName string) string
func (*GuiListTable) GetEditSelectKeyForColumn ¶
func (t *GuiListTable) GetEditSelectKeyForColumn(columnName string) string
func (*GuiListTable) GetEditSelectValueForColumn ¶
func (t *GuiListTable) GetEditSelectValueForColumn(columnName string) string
func (*GuiListTable) HasGuiControl ¶
func (t *GuiListTable) HasGuiControl(controlName string) bool
type GuiListTables ¶
type GuiListTables struct {
Tables []GuiListTable `json:"tables"`
}
func ReadGuiTables ¶
func ReadGuiTables(templateFile string) GuiListTables
type IntegrationTestSettings ¶
type IntegrationTestSettings struct {
PostgresUser, PostgresPassword, PostgresDbName, PostgresHost string
PostgresPort int
MySqlUser, MySqlPassword, MySqlDB string
}
func ReadIntegrationTestSettings ¶
func ReadIntegrationTestSettings(contextFile string) IntegrationTestSettings
type MySqlColumn ¶
type MySqlForeignKey ¶
type MySqlForeignKey struct {
TableName, ColumnName, ConstraintName, ReferencedColumnName, ReferencedTableName string
}
type OracleColumn ¶
type OracleColumn struct {
ColumnName, Nullable, DataType, IdentityColumn, DataDefault sql.NullString
DataPrecision, DataLength, DataScale sql.NullInt64
}
type OraclePrimaryKey ¶
type OraclePrimaryKey struct {
TableName, TableSchema, ConstraintName, Status, ColumnName string
OrdinalPosition int
}
func GetOraclePrimaryKeys ¶
func GetOraclePrimaryKeys(tableName, schema string) []OraclePrimaryKey
type PostgresColumn ¶
type PostgresPrimaryKey ¶
type Table ¶
type Table struct {
TableName, DatabaseType string
Columns []Column
ForeignKeys []ForeignKey
ReferencedForeignKeys []ForeignKey
GuiListTable GuiListTable
}
func GetOracleTables ¶
func GetPostgresTables ¶
func ReadTables ¶
func (*Table) GetCSharpFirstPrimaryUnitTestValue ¶
func (*Table) GetCSharpSecondPrimaryUnitTestValue ¶
func (*Table) GetCamelCaseTableName ¶
func (*Table) GetCamelCaseTableNameEF ¶
func (*Table) GetCamelCaseTableNamePlural ¶
func (*Table) GetColumnListWithCSharpTypes ¶
func (*Table) GetFirstPrimaryColumn ¶
func (*Table) GetFkTableNameForColumn ¶
func (*Table) GetJavaFirstPrimaryUnitTestValue ¶
func (*Table) GetJavaSecondPrimaryUnitTestValue ¶
func (*Table) GetNullableColumns ¶
func (*Table) GetPascalCaseTableName ¶
func (*Table) GetPascalCaseTableNameEF ¶
func (*Table) GetPascalCaseTableNamePlural ¶
func (*Table) GetPrimaryColumns ¶
func (*Table) GetTableName ¶
func (*Table) HasAutoIncrementColumn ¶
func (*Table) HasCompositePrimaryKey ¶
func (*Table) HasDateColumn ¶
func (*Table) HasJavascriptNumberColumn ¶
func (*Table) HasJavascriptStringColumn ¶
type Template ¶
type Template struct { TemplateFile string `json:"templateFile"` GeneratedFileName string `json:"generatedFileName"` GeneratedFolderName string `json:"generatedFolderName"` OutputPath string `json:"outputPath"` AppendFile bool `json:"appendFile"` OverwriteFile bool `json:"overwriteFile"` UnitTestJsonJava string `json:"unitTestJsonJava"` UnitTestJsonCSharp string `json:"UnitTestJsonCSharp"` ForeignKeyMapping string `json:"foreignKeyMapping"` MinimumGeneratedFileLength int `json:"minimumGeneratedFileLength"` CopyOnly bool `json:"copyOnly"` }
func NewTemplate ¶
type Templates ¶
type Templates struct { Templates []Template `json:"templates"` Tags []Tag `json:"tags"` IgnoreTables []string `json:"ignoreTables"` IncludeTables []string `json:"includeTables"` }
func ReadTemplates ¶
type UnitTestValue ¶
type UnitTestValueColumn ¶
type UnitTestValueColumn struct { ColumnName string `json:"columnName"` UnitTestValues []UnitTestValue `json:"unitTestValues"` }
type UnitTestValueTable ¶
type UnitTestValueTable struct { TableName string `json:"tableName"` Columns []UnitTestValueColumn `json:"columns"` }
type UnitTestValueTables ¶
type UnitTestValueTables struct {
Tables []UnitTestValueTable `json:"tables"`
}
func ReadUnitTestValues ¶
func ReadUnitTestValues(unitTestFile string) UnitTestValueTables
Click to show internal directories.
Click to hide internal directories.