Documentation
¶
Index ¶
- Variables
- func FormatCamelCase(dbColumnName string) string
- func FormatDisplayName(dbColumnName string) string
- func FormatFieldName(dbColumnName string) string
- func ValidateSQLCConfig(projectPath string) error
- type TypeMapper
- func (tm *TypeMapper) GenerateConversionFromDB(fieldName, sqlcType, goType string) string
- func (tm *TypeMapper) GenerateConversionToDB(sqlcType string, goType string, valueExpr string) string
- func (tm *TypeMapper) GenerateZeroCheck(goType string, valueExpr string) string
- func (tm *TypeMapper) GetDatabaseType() string
- func (tm *TypeMapper) MapSQLTypeToGo(sqlType string, nullable bool) (goType, sqlcType, packageName string, err error)
- type TypeOverride
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoTypeMapperFound = errors.New("no type mapper found for database type") ErrUnsupportedType = errors.New("unsupported database type") )
Functions ¶
func FormatCamelCase ¶
func FormatDisplayName ¶
func FormatFieldName ¶
func ValidateSQLCConfig ¶
Types ¶
type TypeMapper ¶
type TypeMapper struct {
DatabaseType string
TypeMap map[string]string
Overrides []TypeOverride
}
func NewTypeMapper ¶
func NewTypeMapper(databaseType string) *TypeMapper
func (*TypeMapper) GenerateConversionFromDB ¶
func (tm *TypeMapper) GenerateConversionFromDB(fieldName, sqlcType, goType string) string
func (*TypeMapper) GenerateConversionToDB ¶
func (tm *TypeMapper) GenerateConversionToDB( sqlcType string, goType string, valueExpr string, ) string
func (*TypeMapper) GenerateZeroCheck ¶
func (tm *TypeMapper) GenerateZeroCheck( goType string, valueExpr string, ) string
func (*TypeMapper) GetDatabaseType ¶
func (tm *TypeMapper) GetDatabaseType() string
func (*TypeMapper) MapSQLTypeToGo ¶
func (tm *TypeMapper) MapSQLTypeToGo( sqlType string, nullable bool, ) (goType, sqlcType, packageName string, err error)
Click to show internal directories.
Click to hide internal directories.