Documentation
¶
Overview ¶
Package transform handles custom type transformations.
Index ¶
- type Transformer
- func (t *Transformer) ExtractCustomTypesFromSchema(input []byte) []string
- func (t *Transformer) FindCustomTypeMapping(customType string) *config.CustomTypeMapping
- func (t *Transformer) GetCustomTypes() []string
- func (t *Transformer) GetGoTypeForCustomType(customType string) (string, bool, error)
- func (t *Transformer) GetImportsForCustomType(customType string) (string, string, error)
- func (t *Transformer) IsCustomType(typeName string) bool
- func (t *Transformer) IsStandardSQLiteType(typeName string) bool
- func (t *Transformer) TransformSchema(input []byte) ([]byte, error)
- func (t *Transformer) ValidateCustomTypes(input []byte) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transformer ¶
type Transformer struct {
// contains filtered or unexported fields
}
Transformer handles conversion of custom types to SQLite-compatible types.
func New ¶
func New(mappings []config.CustomTypeMapping) *Transformer
New creates a new transformer with the given custom type mappings.
func (*Transformer) ExtractCustomTypesFromSchema ¶
func (t *Transformer) ExtractCustomTypesFromSchema(input []byte) []string
ExtractCustomTypesFromSchema scans schema SQL and returns a list of custom types found.
func (*Transformer) FindCustomTypeMapping ¶
func (t *Transformer) FindCustomTypeMapping(customType string) *config.CustomTypeMapping
FindCustomTypeMapping looks up a custom type mapping by the custom type name.
func (*Transformer) GetCustomTypes ¶
func (t *Transformer) GetCustomTypes() []string
GetCustomTypes returns all custom type names.
func (*Transformer) GetGoTypeForCustomType ¶
func (t *Transformer) GetGoTypeForCustomType(customType string) (string, bool, error)
GetGoTypeForCustomType returns the Go type name for a custom type.
func (*Transformer) GetImportsForCustomType ¶
func (t *Transformer) GetImportsForCustomType(customType string) (string, string, error)
GetImportsForCustomType returns the Go import path for a custom type.
func (*Transformer) IsCustomType ¶
func (t *Transformer) IsCustomType(typeName string) bool
IsCustomType checks if a given type is a custom type.
func (*Transformer) IsStandardSQLiteType ¶
func (t *Transformer) IsStandardSQLiteType(typeName string) bool
IsStandardSQLiteType checks if a type is a standard SQLite type
func (*Transformer) TransformSchema ¶
func (t *Transformer) TransformSchema(input []byte) ([]byte, error)
TransformSchema converts custom types in schema SQL to SQLite-compatible types.
func (*Transformer) ValidateCustomTypes ¶
func (t *Transformer) ValidateCustomTypes(input []byte) []string
ValidateCustomTypes checks that all custom types used in the schema have mappings.