transform

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package transform handles custom type transformations.

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL