Documentation ¶
Index ¶
- func DefaultIgnoreInTestsTransformer(_ reflect.StructField) bool
- func DefaultNameTransformer(field reflect.StructField) (string, error)
- func DefaultResolverTransformer(_ reflect.StructField, path string) schema.ColumnResolver
- func DefaultTypeTransformer(v reflect.StructField) (schema.ValueType, error)
- func TransformWithStruct(st any, opts ...StructTransformerOption) schema.Transform
- type IgnoreInTestsTransformer
- type NameTransformer
- type ResolverTransformer
- type StructTransformerOption
- func WithIgnoreInTestsTransformer(transformer IgnoreInTestsTransformer) StructTransformerOption
- func WithNameTransformer(transformer NameTransformer) 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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultIgnoreInTestsTransformer ¶
func DefaultIgnoreInTestsTransformer(_ reflect.StructField) bool
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) (schema.ValueType, error)
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 WithNameTransformer ¶
func WithNameTransformer(transformer NameTransformer) StructTransformerOption
WithNameTransformer overrides how column name will be determined. DefaultNameTransformer is used as the default.
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) (schema.ValueType, error)