Documentation ¶
Index ¶
- Constants
- func Apply(tables schema.Tables, extraTransformers ...schema.Transform) error
- func DefaultIgnoreInTestsTransformer(_ reflect.StructField) bool
- func DefaultJSONColumnSchemaNameTransformer(field reflect.StructField) (string, error)
- func DefaultNameTransformer(field reflect.StructField) (string, error)
- func DefaultResolverTransformer(_ reflect.StructField, path string) schema.ColumnResolver
- func DefaultTypeTransformer(v reflect.StructField) (arrow.DataType, error)
- func SetParents(tables schema.Tables, parent *schema.Table)
- func TransformTables(tables schema.Tables) error
- func TransformWithStruct(st any, opts ...StructTransformerOption) schema.Transform
- type IgnoreInTestsTransformer
- type NameTransformer
- type ResolverTransformer
- type StructTransformerOption
- func WithIgnoreInTestsTransformer(transformer IgnoreInTestsTransformer) StructTransformerOption
- func WithJSONSchemaNameTransformer(transformer NameTransformer) StructTransformerOption
- func WithMaxJSONTypeSchemaDepth(maxDepth int) StructTransformerOption
- func WithNameTransformer(transformer NameTransformer) StructTransformerOption
- func WithPrimaryKeyComponents(fields ...string) StructTransformerOption
- func WithPrimaryKeys(fields ...string) StructTransformerOption
- func WithResolverTransformer(transformer ResolverTransformer) StructTransformerOption
- func WithSkipFields(fields ...string) StructTransformerOption
- func WithTypeTransformer(transformer TypeTransformer) StructTransformerOption
- func WithUnwrapAllEmbeddedStructs() StructTransformerOption
- func WithUnwrapStructFields(fields ...string) StructTransformerOption
- type TypeTransformer
Constants ¶
const DefaultMaxJSONTypeSchemaDepth = 4
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply applies the given transformers to the given Tables, and recursively on the relations. This is useful for applying transformers that are not defined in the table definitions. To apply the table-definition transformers, use TransformTables.
func DefaultIgnoreInTestsTransformer ¶
func DefaultIgnoreInTestsTransformer(_ reflect.StructField) bool
func DefaultJSONColumnSchemaNameTransformer ¶ added in v4.72.2
func DefaultJSONColumnSchemaNameTransformer(field reflect.StructField) (string, error)
func DefaultNameTransformer ¶
func DefaultNameTransformer(field reflect.StructField) (string, error)
func DefaultResolverTransformer ¶
func DefaultResolverTransformer(_ reflect.StructField, path string) schema.ColumnResolver
func DefaultTypeTransformer ¶
func DefaultTypeTransformer(v reflect.StructField) (arrow.DataType, error)
func SetParents ¶
Set parent links on relational tables
func TransformTables ¶
TransformTables runs given Tables' transformers as defined in the table definitions, and recursively on the relations. To apply additional transformers, use Apply.
func TransformWithStruct ¶
func TransformWithStruct(st any, opts ...StructTransformerOption) schema.Transform
Types ¶
type IgnoreInTestsTransformer ¶
type IgnoreInTestsTransformer func(field reflect.StructField) bool
type NameTransformer ¶
type NameTransformer func(reflect.StructField) (string, error)
type ResolverTransformer ¶
type ResolverTransformer func(field reflect.StructField, path string) schema.ColumnResolver
type StructTransformerOption ¶
type StructTransformerOption func(*structTransformer)
func WithIgnoreInTestsTransformer ¶
func WithIgnoreInTestsTransformer(transformer IgnoreInTestsTransformer) StructTransformerOption
WithIgnoreInTestsTransformer overrides how column ignoreInTests will be determined. DefaultIgnoreInTestsTransformer is used as the default.
func WithJSONSchemaNameTransformer ¶ added in v4.72.2
func WithJSONSchemaNameTransformer(transformer NameTransformer) StructTransformerOption
WithJSONSchemaNameTransformer overrides how column name will be determined. DefaultJSONColumnSchemaNameTransformer is used as the default.
func WithMaxJSONTypeSchemaDepth ¶ added in v4.57.0
func WithMaxJSONTypeSchemaDepth(maxDepth int) StructTransformerOption
WithMaxJSONTypeSchemaDepth allows to specify the maximum depth of JSON type schema
func WithNameTransformer ¶
func WithNameTransformer(transformer NameTransformer) StructTransformerOption
WithNameTransformer overrides how column name will be determined. DefaultNameTransformer is used as the default.
func WithPrimaryKeyComponents ¶ added in v4.29.0
func WithPrimaryKeyComponents(fields ...string) StructTransformerOption
WithPrimaryKeyComponents allows to specify what struct fields should be used as primary key components
func WithPrimaryKeys ¶
func WithPrimaryKeys(fields ...string) StructTransformerOption
WithPrimaryKeys allows to specify what struct fields should be used as primary keys
func WithResolverTransformer ¶
func WithResolverTransformer(transformer ResolverTransformer) StructTransformerOption
WithResolverTransformer overrides how column resolver will be determined. DefaultResolverTransformer is used as the default.
func WithSkipFields ¶
func WithSkipFields(fields ...string) StructTransformerOption
WithSkipFields allows to specify what struct fields should be skipped.
func WithTypeTransformer ¶
func WithTypeTransformer(transformer TypeTransformer) StructTransformerOption
WithTypeTransformer overrides how column type will be determined. DefaultTypeTransformer is used as the default.
func WithUnwrapAllEmbeddedStructs ¶
func WithUnwrapAllEmbeddedStructs() StructTransformerOption
WithUnwrapAllEmbeddedStructs instructs codegen to unwrap all embedded fields (1 level deep only)
func WithUnwrapStructFields ¶
func WithUnwrapStructFields(fields ...string) StructTransformerOption
WithUnwrapStructFields allows to unwrap specific struct fields (1 level deep only)
type TypeTransformer ¶
type TypeTransformer func(reflect.StructField) (arrow.DataType, error)