Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // SupportedDbTypes represents the supported databases SupportedDbTypes = map[DBType]bool{ DBTypePostgresql: true, DBTypeMySQL: true, DBTypeSQLite: true, } )
Functions ¶
func SprintfSupportedDbTypes ¶
func SprintfSupportedDbTypes() string
SprintfSupportedDbTypes returns a slice of strings as names of the supported database types
func SprintfSupportedNullTypes ¶
func SprintfSupportedNullTypes() string
SprintfSupportedNullTypes returns a slice of strings as names of the supported null types
Types ¶
type DBType ¶
type DBType string
DBType represents a type of a database.
const ( DBTypePostgresql DBType = "pg" DBTypeMySQL DBType = "mysql" DBTypeSQLite DBType = "sqlite3" )
These database types are supported.
type FileNameFormat ¶
type FileNameFormat string
FileNameFormat represents a output filename format.
const ( FileNameFormatCamelCase FileNameFormat = "c" FileNameFormatSnakeCase FileNameFormat = "s" )
These are the FileNameFormat command line parameter.
func (*FileNameFormat) Set ¶
func (of *FileNameFormat) Set(s string) error
Set sets the datatype for the custom type for the flag package.
func (FileNameFormat) String ¶
func (of FileNameFormat) String() string
type NullType ¶
type NullType string
NullType represents a null type.
const ( NullTypeSQL NullType = "sql" NullTypeNative NullType = "native" NullTypePrimitive NullType = "primitive" )
These null types are supported. The types native and primitive map to the same underlying builtin golang type.
type OutputFormat ¶
type OutputFormat string
OutputFormat represents an output format option.
const ( OutputFormatCamelCase OutputFormat = "c" OutputFormatOriginal OutputFormat = "o" )
These are the OutputFormat command line parameter.
func (*OutputFormat) Set ¶
func (of *OutputFormat) Set(s string) error
Set sets the datatype for the custom type for the flag package.
func (OutputFormat) String ¶
func (of OutputFormat) String() string
String is the implementation of the Stringer interface needed for flag.Value interface.
type Settings ¶
type Settings struct { Verbose bool VVerbose bool Force bool // continue through errors DbType DBType User string Pswd string DbName string Schema string Host string Port string SSLMode string Socket string OutputFilePath string OutputFormat OutputFormat FileNameFormat FileNameFormat PackageName string Prefix string Suffix string Null NullType NoInitialism bool TagsNoDb bool TagsMastermindStructable bool TagsMastermindStructableOnly bool IsMastermindStructableRecorder bool // TODO not implemented yet TagsGorm bool }
Settings stores the supported settings / command line arguments.
func (*Settings) IsFileNameFormatSnakeCase ¶
IsFileNameFormatSnakeCase returns if the type given by the command line args is snake-case format.
func (*Settings) IsNullTypeSQL ¶
IsNullTypeSQL returns true if the type given by the command line args is of null type SQL
func (*Settings) IsOutputFormatCamelCase ¶
IsOutputFormatCamelCase returns if the type given by command line args is of camel-case format.
func (*Settings) ShouldInitialism ¶
ShouldInitialism returns whether column names should be converted to initialisms or not.