package
0.9.30
Repository: https://github.com/sfagnum/gen.git
Documentation: pkg.go.dev

# Functions

BuildDefaultTableDDL create a ddl mock using the ColumnMeta data.
BytesToString convert []uint8 to string.
CheckForDupeTable check for duplicate table name, returns available name.
Copy a src struct into a destination struct.
CRLFNewlines transforms \n to \r\n (windows).
Exists reports whether the named file or directory exists.
FindInSlice takes a slice and looks for an element in it.
FindPrimaryKeyFromInformationSchema fetch primary key info from information_schema.
FmtFieldName formats a string as a struct key Example: fmtFieldName("foo_id") Output: FooID.
FormatSource format source code contents.
GenerateDeleteSQL generate sql for a delete.
GenerateInsertSQL generate sql for a insert.
GenerateModelInfo generates a struct for the given table.
GenerateSelectMultiSQL generate sql for selecting multiple records.
GenerateSelectOneSQL generate sql for selecting one record.
GenerateUpdateSQL generate sql for a update.
GetFieldLenFromInformationSchema fetch field length from database.
GetFunctionName get function name.
GetMappings get all mappings.
No description provided by the author
LoadMappings load sql mappings to load mapping json file.
LoadMeta loads the DbTableMeta data from the db connection for the table.
LoadMsSQLMeta fetch db meta data for MS SQL database.
LoadMysqlMeta fetch db meta data for MySQL database.
LoadPostgresMeta fetch db meta data for Postgres database.
LoadSqliteMeta fetch db meta data for Sqlite3 database.
LoadTableInfo load table info from db connection, and list of tables.
LoadTableInfoFromMSSqlInformationSchema fetch info from information_schema for ms sql database.
LoadTableInfoFromPostgresInformationSchema fetch info from information_schema for postgres database.
LoadUnknownMeta fetch db meta data for unknown database type.
NewConfig create a new code config.
NonPrimaryKeyNames return the list of primary key names.
NormalizeNewlines normalizes \r\n (windows) and \r (mac) into \n (unix).
ParseSQLType parse sql type and return raw type and length.
PrimaryKeyCount return the number of primary keys in table.
PrimaryKeyNames return the list of primary key names.
ProcessMappings process the json for mappings to load sql mappings.
Pwd template command to return the current working directory.
RegSplit split text based on regex.
RenameReservedName renames a reserved word.
Replace takes a template based name format and will render a name using it.
Spew func to return spewed string representation of struct.
SQLTypeToGoType map a sql type to a go type.
SQLTypeToMapping retrieve a SQLMapping based on a sql type.
SQLTypeToProtobufType map a sql type to a protobuf type.
ToJSON func to return json string representation of struct.
TrimSpaceNewlineInString replace spaces in string.

# Structs

Config for generating code.
FieldInfo codegen info for each column in sql table.
GenTemplate template info struct.
InformationSchema results from a query of the InformationSchema db table.
ModelInfo info for a sql table.
PostgresInformationSchema results from a query of the postgres InformationSchema db table.
SQLMapping mapping.
SQLMappings mappings for sql types to json, go etc.
State struct used for storing state in template parsing.
SwaggerInfoDetails swagger details.

# Interfaces

ColumnMeta meta data for a column.
DbTableMeta table meta data.

# Type aliases

TemplateLoader loader function to retrieve a template contents.