Documentation
¶
Index ¶
- Constants
- Variables
- func Must[T any](v T, err error) T
- type CaseStrategy
- type Column
- func (c *Column) Field() string
- func (c *Column) FieldType() string
- func (c *Column) Name() string
- func (c *Column) PrimaryKey() bool
- func (c *Column) SetField(field string)
- func (c *Column) SetFieldType(fieldType string)
- func (c *Column) SetName(name string)
- func (c *Column) SetPrimaryKey(pKey bool)
- func (c *Column) SetStrategy(strategy FieldStrategy)
- func (c *Column) Strategy() FieldStrategy
- func (c *Column) UsingMethodStrategy() bool
- func (c *Column) UsingStructFieldStrategy() bool
- type ColumnConfiguration
- type ColumnPredicate
- type Configuration
- type EvaluationResult
- type FieldStrategy
- type JSONLoader
- type Loader
- type QueryOption
- type QueryOptions
- type ReflectConfiguration
- func (c *ReflectConfiguration) CamelCaseColumnName() bool
- func (c *ReflectConfiguration) CamelCaseTableName() bool
- func (c *ReflectConfiguration) HasColumnNameMappings() bool
- func (c *ReflectConfiguration) HasColumnNameStrategy() bool
- func (c *ReflectConfiguration) HasFieldExclusionPattern() bool
- func (c *ReflectConfiguration) HasFieldExclusions() bool
- func (c *ReflectConfiguration) HasMethodExclusionPattern() bool
- func (c *ReflectConfiguration) HasMethodExclusions() bool
- func (c *ReflectConfiguration) HasTableAliasLength() bool
- func (c *ReflectConfiguration) HasTableAliasStrategy() bool
- func (c *ReflectConfiguration) HasTableName() bool
- func (c *ReflectConfiguration) HasTableNameStrategy() bool
- func (c *ReflectConfiguration) HasTag() bool
- func (c *ReflectConfiguration) LowercaseColumnName() bool
- func (c *ReflectConfiguration) LowercaseTableAlias() bool
- func (c *ReflectConfiguration) PluralTableName() bool
- func (c *ReflectConfiguration) ScreamingSnakeCaseColumnName() bool
- func (c *ReflectConfiguration) ScreamingSnakeCaseTableName() bool
- func (c *ReflectConfiguration) SnakeCaseColumnName() bool
- func (c *ReflectConfiguration) SnakeCaseTableName() bool
- func (c *ReflectConfiguration) UppercaseColumnName() bool
- func (c *ReflectConfiguration) UppercaseTableAlias() bool
- type ReflectOption
- type Table
- func (t *Table) AddColumn(column Column) error
- func (t *Table) AddColumns(columns ...Column) error
- func (t *Table) Alias() string
- func (t *Table) ColumnName(field string) (string, error)
- func (t *Table) ColumnNames() []string
- func (t *Table) Columns() (columns []Column)
- func (t *Table) DeleteQuery(options ...QueryOption) (string, error)
- func (t *Table) DeleteQueryWithArgs(obj any, options ...QueryOption) (string, []any, error)
- func (t *Table) Evaluate(obj any) (EvaluationResult, error)
- func (t *Table) FieldName(name string) (string, error)
- func (t Table) FindColumns(p ColumnPredicate) []Column
- func (t *Table) InsertQuery(options ...QueryOption) (string, error)
- func (t *Table) InsertQueryWithArgs(obj any, options ...QueryOption) (string, []any, error)
- func (t *Table) MustDeleteQuery(options ...QueryOption) string
- func (t *Table) MustEvaluate(obj any) EvaluationResult
- func (t *Table) MustInsertQuery(options ...QueryOption) string
- func (t *Table) MustSelectQuery(options ...QueryOption) string
- func (t *Table) MustUpdateQuery(options ...QueryOption) string
- func (t *Table) Name() string
- func (t *Table) SelectQuery(options ...QueryOption) (string, error)
- func (t *Table) SelectQueryWithArgs(obj any, options ...QueryOption) (string, []any, error)
- func (t *Table) SetAlias(alias string)
- func (t *Table) SetName(name string)
- func (t *Table) SetType(entity any)
- func (t *Table) SetTypeName(typeName string)
- func (t *Table) TypeName() string
- func (t *Table) UpdateQuery(options ...QueryOption) (string, error)
- func (t *Table) UpdateQueryWithArgs(obj any, options ...QueryOption) (string, []any, error)
- type TableConfiguration
- type YAMLLoader
Constants ¶
const ( // SnakeCaseStrategy is the snake case strategy. SnakeCaseStrategy CaseStrategy = "snake" // ScreamingSnakeCaseStrategy is the screaming (uppercase) snake case strategy. ScreamingSnakeCaseStrategy CaseStrategy = "screaming_snake" // CamelCaseStrategy is the camel case strategy. CamelCaseStrategy CaseStrategy = "camel" // LowerCaseStrategy is the lowercase strategy. LowerCaseStrategy CaseStrategy = "lower" // UpperCaseStrategy is the uppercase strategy. UpperCaseStrategy CaseStrategy = "upper" // DefaultTableAliasLength is the default table alias length. DefaultTableAliasLength = 1 // DefaultTableNameStrategy is the default table name strategy. DefaultTableNameStrategy = SnakeCaseStrategy // DefaultTableAliasStrategy is the default table alias strategy. DefaultTableAliasStrategy = UpperCaseStrategy // DefaultColumnNameStrategy is the default column name strategy. DefaultColumnNameStrategy = SnakeCaseStrategy )
const DefaultPlaceholder = "?"
DefaultPlaceholder represents the default placeholder value used for query generation.
Variables ¶
var ( // WithTableName specifies the table name, effectively overriding any // table name inference. WithTableName = func(name string) ReflectOption { return func(c *ReflectConfiguration) { c.TableName = &name c.IsInferredTableName = false } } // WithTableAlias specifies the table alias, effectively overriding any // table alias inference. WithTableAlias = func(alias string) ReflectOption { return func(c *ReflectConfiguration) { c.TableAlias = &alias c.IsInferredTableAlias = false } } // WithInferredTableName indicates tha the table name should be inferred // based on the provided strategy and plurality. WithInferredTableName = func(strategy CaseStrategy, plural bool) ReflectOption { return func(c *ReflectConfiguration) { c.IsInferredTableName = true c.TableNameStrategy = &strategy c.IsTableNamePlural = plural } } // WithInferredTableAlias indicates that the table alias should be inferred // based on the provided strategy and length. WithInferredTableAlias = func(strategy CaseStrategy, length int) ReflectOption { return func(c *ReflectConfiguration) { if length < 1 { length = DefaultTableAliasLength } c.IsInferredTableAlias = true c.TableAliasStrategy = &strategy c.TableAliasLength = &length } } // WithInferredColumnNames indicates that the column names should be inferred // based on the provided strategy. WithInferredColumnNames = func(strategy CaseStrategy) ReflectOption { return func(c *ReflectConfiguration) { c.IsInferredColumnNames = true c.ColumnNameStrategy = &strategy } } // WithTag specifies the struct tag to use for field reflection. WithTag = func(tag string) ReflectOption { return func(c *ReflectConfiguration) { c.Tag = &tag } } // WithoutMethods specifies the methods by name to exclude from reflection. WithoutMethods = func(methods ...string) ReflectOption { return func(c *ReflectConfiguration) { if c.MethodExclusions == nil { c.MethodExclusions = []string{} } c.MethodExclusions = methods } } // WithoutMatchingMethods specifies a regular expression used to match against // method names, where matches are excluded from reflection. WithoutMatchingMethods = func(pattern string) ReflectOption { return func(c *ReflectConfiguration) { c.MethodExclusionPattern = &pattern } } // WithoutFields specifies the struct fields by name to exclude from reflection. WithoutFields = func(fields ...string) ReflectOption { return func(c *ReflectConfiguration) { if c.FieldExclusions == nil { c.FieldExclusions = []string{} } c.FieldExclusions = fields } } // WithoutMatchingFields specifies a regular expression used to match against // struct field names, where matches are excluded from reflection. WithoutMatchingFields = func(pattern string) ReflectOption { return func(c *ReflectConfiguration) { c.FieldExclusionPattern = &pattern } } // WithPrimaryKeyColumn specifies the name of the column that acts as // the primary key. WithPrimaryKeyColumn = func(name string) ReflectOption { return func(c *ReflectConfiguration) { if c.PrimaryKeyColumns == nil { c.PrimaryKeyColumns = []string{} } c.PrimaryKeyColumns = []string{name} } } // WithPrimaryKeyColumns specifies the names of the column that acts together as // the primary key. WithPrimaryKeyColumns = func(names ...string) ReflectOption { return func(c *ReflectConfiguration) { if c.PrimaryKeyColumns == nil { c.PrimaryKeyColumns = []string{} } pks := append([]string{}, names...) c.PrimaryKeyColumns = pks } } // WithColumnNameMapping specifies a single column mapping between the provided // field name and column name. Both the field name and column name are case // sensitive, and the name provided will be used regardless of other options specified. WithColumnNameMapping = func(field, name string) ReflectOption { return func(c *ReflectConfiguration) { if c.ColumnNameMappings == nil { c.ColumnNameMappings = make(map[string]string) } c.ColumnNameMappings[field] = name } } )
var ( // ErrMissingTypeName represents an error encountered when evaluation is attempted but the // table does not have a type name configured. ErrMissingTypeName = errors.New("morph: must have table type name to evaluate") // ErrMissingTableName represents an error encountered when evaluation is attempted but the // table does not have a table name configured. ErrMissingTableName = errors.New("morph: must have table name to evaluate") // ErrMissingTableAlias represents an error encountered when evaluation is attempted but the // table does not have a table alias configured. ErrMissingTableAlias = errors.New("morph: must have table alias to evaluate") // ErrMissingColumns represents an error encountered when evaluation is attempted but the // table does not have any columns configured. ErrMissingColumns = errors.New("morph: must have columns to evaluate") // ErrMismatchingTypeName represents an error encountered when evaluation is attempted but the // table type name does not match the type name of the object being evaluated. ErrMismatchingTypeName = errors.New("morph: must have matching type names to evaluate") // ErrMissingPrimaryKey represents an error encountered when a table does not have any primary key columns. ErrMissingPrimaryKey = errors.New("morph: table must have at least one primary key column") // ErrMissingNonPrimaryKey represents an error encountered when a table does not have any non-primary key columns. ErrMissingNonPrimaryKey = errors.New("morph: table must have at least one non-primary key column") )
Defines the various errors that can occur when interacting with tables.
var DefaultQueryOptions = []QueryOption{WithDefaultPlaceholder()}
DefaultQueryOptions represents the default query options used for query generation.
var ( // DefaultReflectOptions represents the default reflection options used for reflection. DefaultReflectOptions = []ReflectOption{ WithInferredTableName(DefaultTableNameStrategy, true), WithInferredTableAlias(DefaultTableAliasStrategy, DefaultTableAliasLength), WithInferredColumnNames(DefaultColumnNameStrategy), WithoutMatchingMethods("^Set.*"), WithPrimaryKeyColumn("id"), } )
var ( // ErrNotStruct is returned when the input being reflected is not a struct. // A struct is required to reflect the fields and methods to construct the // table metadata. ErrNotStruct = errors.New("morph: input must be a struct or pointer to a struct") )
var Loaders = map[string]Loader{ "yaml": YAMLLoader{}, "yml": YAMLLoader{}, "json": JSONLoader{}, }
Loaders is the collection of loaders by file extension.
Functions ¶
Types ¶
type CaseStrategy ¶ added in v1.1.0
type CaseStrategy string
CaseStrategy is an enumeration of the available case strategies.
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
Column represents a mapping between an entity field and a database column.
func (*Column) FieldType ¶ added in v1.1.0
FieldType retrieves the field type associated to the column.
func (*Column) PrimaryKey ¶ added in v1.1.0
PrimaryKey indicates if the column plays a role in the primary key for a table. Tables with composite primary keys will have multiple columns that indicate a true value for this method.
func (*Column) SetFieldType ¶ added in v1.1.0
SetFieldType modifies the field type associated to the column.
func (*Column) SetPrimaryKey ¶ added in v1.1.0
func (*Column) SetStrategy ¶ added in v1.1.0
func (c *Column) SetStrategy(strategy FieldStrategy)
SetStrategy modifies the field strategy associated to the column.
func (*Column) Strategy ¶ added in v1.1.0
func (c *Column) Strategy() FieldStrategy
Strategy retrieves the field strategy associated to the column.
func (*Column) UsingMethodStrategy ¶ added in v1.1.0
UsingMethodStrategy determines if the column is using the method field strategy.
func (*Column) UsingStructFieldStrategy ¶ added in v1.1.0
UsingStructFieldStrategy determines if the column is using the struct field strategy.
type ColumnConfiguration ¶
type ColumnConfiguration struct { Name string `json:"name" yaml:"name"` Field string `json:"field" yaml:"field"` FieldType string `json:"fieldType" yaml:"fieldType"` FieldStrategy FieldStrategy `json:"fieldStrategy" yaml:"fieldStrategy"` PrimaryKey bool `json:"primaryKey" yaml:"primaryKey"` }
ColumnConfiguration represents the configuration used to construct a single column mapping.
type ColumnPredicate ¶ added in v1.1.0
ColumnPredicate represents a condition used to match columns within find operations.
type Configuration ¶
type Configuration struct {
Tables []TableConfiguration `json:"tables" yaml:"tables"`
}
Configuration represents the configuration used to construct the table and column mappings.
func Load ¶
func Load(path string) (Configuration, error)
Load loads the configuration from the provided file.
func (Configuration) AsMetadata ¶
func (c Configuration) AsMetadata() []Table
AsMetadata converts the configuration to metadata mappings.
type EvaluationResult ¶ added in v1.1.0
EvaluationResult represents the result of evaluating a table against an object.
func (EvaluationResult) Empties ¶ added in v1.1.0
func (r EvaluationResult) Empties() []string
Empties retrieves all of the keys in the result that have nil values.
func (EvaluationResult) NonEmpties ¶ added in v1.1.0
func (r EvaluationResult) NonEmpties() []string
NonEmpties retrieves all of the keys in the result that have non-nil values.
type FieldStrategy ¶ added in v1.1.0
type FieldStrategy string
const ( FieldStrategyStructField FieldStrategy = "struct_field" FieldStrategyMethod FieldStrategy = "method" )
type JSONLoader ¶
type JSONLoader struct{}
func (JSONLoader) Load ¶
func (l JSONLoader) Load(path string) (c Configuration, err error)
Load loads the configuration from the JSON file provided.
type Loader ¶
type Loader interface {
Load(path string) (Configuration, error)
}
Loader loads the cofiguration from the provided file.
type QueryOption ¶ added in v1.1.0
type QueryOption func(*QueryOptions)
QueryOption represents a function that modifies the query options.
func WithDefaultPlaceholder ¶ added in v1.1.0
func WithDefaultPlaceholder() QueryOption
func WithNamedParameters ¶ added in v1.1.0
func WithNamedParameters() QueryOption
WithNamedParameters sets the query to use named parameters.
func WithPlaceholder ¶ added in v1.1.0
func WithPlaceholder(p string, o bool) QueryOption
WithPlaceholder sets the placeholder value and whether the parameter should have a sequence number appended to it.
func WithoutEmptyValues ¶ added in v1.1.0
func WithoutEmptyValues(obj any) QueryOption
WithoutEmptyValues indicates that columns with no value should be omitted from the query.
type QueryOptions ¶ added in v1.1.0
type QueryOptions struct { Placeholder string Ordered bool Named bool OmitEmpty bool // contains filtered or unexported fields }
QueryOptions represents the options available for generating a query.
type ReflectConfiguration ¶ added in v1.1.0
type ReflectConfiguration struct { TableName *string TableAlias *string IsInferredTableName bool IsInferredTableAlias bool IsInferredColumnNames bool TableNameStrategy *CaseStrategy TableAliasStrategy *CaseStrategy ColumnNameStrategy *CaseStrategy Tag *string MethodExclusions []string FieldExclusions []string MethodExclusionPattern *string FieldExclusionPattern *string IsTableNamePlural bool TableAliasLength *int PrimaryKeyColumns []string ColumnNameMappings map[string]string }
ReflectConfiguration is the configuration leveraged when constructing tables via reflection.
func (*ReflectConfiguration) CamelCaseColumnName ¶ added in v1.1.0
func (c *ReflectConfiguration) CamelCaseColumnName() bool
CamelCaseColumnName indicates if the column name strategy is camel case.
func (*ReflectConfiguration) CamelCaseTableName ¶ added in v1.1.0
func (c *ReflectConfiguration) CamelCaseTableName() bool
CamelCaseTableName indicates if the table name strategy is camel case.
func (*ReflectConfiguration) HasColumnNameMappings ¶ added in v1.2.0
func (c *ReflectConfiguration) HasColumnNameMappings() bool
HasColumnNameMappings indicates if any explicit column name mappings have been set.
func (*ReflectConfiguration) HasColumnNameStrategy ¶ added in v1.1.0
func (c *ReflectConfiguration) HasColumnNameStrategy() bool
HasColumnNameStrategy indicates if the column name strategy is set.
func (*ReflectConfiguration) HasFieldExclusionPattern ¶ added in v1.1.0
func (c *ReflectConfiguration) HasFieldExclusionPattern() bool
HasFieldExclusionPattern indicates if the field exclusion pattern is set.
func (*ReflectConfiguration) HasFieldExclusions ¶ added in v1.1.0
func (c *ReflectConfiguration) HasFieldExclusions() bool
HasFieldExclusions indicates if field exclusions are set.
func (*ReflectConfiguration) HasMethodExclusionPattern ¶ added in v1.1.0
func (c *ReflectConfiguration) HasMethodExclusionPattern() bool
HasMethodExclusionPattern indicates if the method exclusion pattern is set.
func (*ReflectConfiguration) HasMethodExclusions ¶ added in v1.1.0
func (c *ReflectConfiguration) HasMethodExclusions() bool
HasMethodExclusions indicates if method exclusions are set.
func (*ReflectConfiguration) HasTableAliasLength ¶ added in v1.1.0
func (c *ReflectConfiguration) HasTableAliasLength() bool
HasTableAliasLength indicates if the table alias length is set.
func (*ReflectConfiguration) HasTableAliasStrategy ¶ added in v1.1.0
func (c *ReflectConfiguration) HasTableAliasStrategy() bool
HasTableAliasStrategy indicates if the table alias strategy is set.
func (*ReflectConfiguration) HasTableName ¶ added in v1.1.0
func (c *ReflectConfiguration) HasTableName() bool
HasTableName indicates if the table name is set.
func (*ReflectConfiguration) HasTableNameStrategy ¶ added in v1.1.0
func (c *ReflectConfiguration) HasTableNameStrategy() bool
HasTableNameStrategy indicates if the table name strategy is set.
func (*ReflectConfiguration) HasTag ¶ added in v1.1.0
func (c *ReflectConfiguration) HasTag() bool
HasTag indicates if the tag is set.
func (*ReflectConfiguration) LowercaseColumnName ¶ added in v1.2.0
func (c *ReflectConfiguration) LowercaseColumnName() bool
LowercaseColumnName indicates if the column name strategy is uppercase.
func (*ReflectConfiguration) LowercaseTableAlias ¶ added in v1.1.0
func (c *ReflectConfiguration) LowercaseTableAlias() bool
LowercaseTableAlias indicates if the table alias strategy is lowercase.
func (*ReflectConfiguration) PluralTableName ¶ added in v1.1.0
func (c *ReflectConfiguration) PluralTableName() bool
PluralTableName indicates if the table name is plural.
func (*ReflectConfiguration) ScreamingSnakeCaseColumnName ¶ added in v1.2.0
func (c *ReflectConfiguration) ScreamingSnakeCaseColumnName() bool
ScreamingSnakeCaseColumnName indicates if the column name strategy is scream snake case.
func (*ReflectConfiguration) ScreamingSnakeCaseTableName ¶ added in v1.2.0
func (c *ReflectConfiguration) ScreamingSnakeCaseTableName() bool
ScreamingSnakeCaseTableName indicates if the table name strategy is screaming snake case.
func (*ReflectConfiguration) SnakeCaseColumnName ¶ added in v1.1.0
func (c *ReflectConfiguration) SnakeCaseColumnName() bool
SnakeCaseColumnName indicates if the column name strategy is snake case.
func (*ReflectConfiguration) SnakeCaseTableName ¶ added in v1.1.0
func (c *ReflectConfiguration) SnakeCaseTableName() bool
SnakeCaseTableName indicates if the table name strategy is snake case.
func (*ReflectConfiguration) UppercaseColumnName ¶ added in v1.2.0
func (c *ReflectConfiguration) UppercaseColumnName() bool
UppercaseColumnName indicates if the column name strategy is uppercase.
func (*ReflectConfiguration) UppercaseTableAlias ¶ added in v1.1.0
func (c *ReflectConfiguration) UppercaseTableAlias() bool
UppercaseTableAlias indicates if the table alias strategy is uppercase.
type ReflectOption ¶ added in v1.1.0
type ReflectOption func(*ReflectConfiguration)
ReflectOption is a function that configures the reflection configuration.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table represents a mapping between an entity and a database table.
func Reflect ¶ added in v1.1.0
func Reflect(obj any, options ...ReflectOption) (Table, error)
Reflect observes the provided object and generates metadata from it using the provided options.
func (*Table) AddColumns ¶
AddColumns adds all of the provided columns to the table.
func (*Table) ColumnName ¶
ColumnName retrieves the column name associated to the provide field name.
func (*Table) ColumnNames ¶
ColumnNames retrieves all of the column names for the table.
func (*Table) DeleteQuery ¶ added in v1.1.0
func (t *Table) DeleteQuery(options ...QueryOption) (string, error)
DeleteQuery generates a DELETE query for the table.
func (*Table) DeleteQueryWithArgs ¶ added in v1.3.0
DeleteQueryWithArgs generates a DELETE query for the table along with arguments derived from the provided object.
func (*Table) Evaluate ¶ added in v1.1.0
func (t *Table) Evaluate(obj any) (EvaluationResult, error)
Evaluate applies the table to the provided object to produce a result containing the column names and their respective values. The result can then be subsequently used to execute queries.
func (*Table) FieldName ¶
FieldName retrieves the field name associated to the provided column name.
func (Table) FindColumns ¶ added in v1.1.0
func (t Table) FindColumns(p ColumnPredicate) []Column
FindColumn retrieves the columns that matches the provided predicate.
func (*Table) InsertQuery ¶ added in v1.1.0
func (t *Table) InsertQuery(options ...QueryOption) (string, error)
InsertQuery generates an INSERT query for the table.
func (*Table) InsertQueryWithArgs ¶ added in v1.3.0
InsertQueryWithArgs generates an INSERT query for the table along with arguments derived from the provided object.
func (*Table) MustDeleteQuery ¶ added in v1.3.0
func (t *Table) MustDeleteQuery(options ...QueryOption) string
MustDeleteQuery performs the same operation as DeleteQuery but panics if an error occurs.
func (*Table) MustEvaluate ¶ added in v1.1.0
func (t *Table) MustEvaluate(obj any) EvaluationResult
MustEvaluate performs the same operation as Evaluate but panics if an error occurs.
func (*Table) MustInsertQuery ¶ added in v1.3.0
func (t *Table) MustInsertQuery(options ...QueryOption) string
MustInsertQuery performs the same operation as InsertQuery but panics if an error occurs.
func (*Table) MustSelectQuery ¶ added in v1.4.0
func (t *Table) MustSelectQuery(options ...QueryOption) string
MustSelectQuery performs the same operation as SelectQuery but panics if an error occurs.
func (*Table) MustUpdateQuery ¶ added in v1.3.0
func (t *Table) MustUpdateQuery(options ...QueryOption) string
MustUpdateQuery performs the same operation as UpdateQuery but panics if an error occurs.
func (*Table) SelectQuery ¶ added in v1.4.0
func (t *Table) SelectQuery(options ...QueryOption) (string, error)
SelectQuery generates a SELECT query for the table.
func (*Table) SelectQueryWithArgs ¶ added in v1.4.0
SelectQueryWithArgs generates a SELECT query for the table along with arguments derived from the provided object.
func (*Table) SetTypeName ¶
SetTypeName modifies the entity type name for the table.
func (*Table) UpdateQuery ¶ added in v1.1.0
func (t *Table) UpdateQuery(options ...QueryOption) (string, error)
UpdateQuery generates an UPDATE query for the table.
func (*Table) UpdateQueryWithArgs ¶ added in v1.3.0
UpdateQueryWithArgs generates an UPDATE query for the table along with arguments derived from the provided object.
type TableConfiguration ¶
type TableConfiguration struct { TypeName string `json:"typeName" yaml:"typeName"` Name string `json:"name" yaml:"name"` Alias string `json:"alias" yaml:"alias"` Columns []ColumnConfiguration `json:"columns" yaml:"columns"` }
TableConfiguration represents the configuration used to construct a single table mapping.
type YAMLLoader ¶
type YAMLLoader struct{}
func (YAMLLoader) Load ¶
func (l YAMLLoader) Load(path string) (c Configuration, err error)
Load loads the configuration from the YAML file provided.