Skip to content

Commit

Permalink
Merge pull request #5 from ulule/feat/add-omit-reference-keys-to-config
Browse files Browse the repository at this point in the history
feat: add omit_reference_keys to config
  • Loading branch information
thoas authored Feb 10, 2021
2 parents 9205b2b + fbd5cda commit 0f359b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ type Column struct {
}

type Schema struct {
TableName string `json:"table_name"`
ReferenceKeys []string `json:"reference_keys"`
Queries []Query `json:"queries"`
Columns []Column `json:"columns"`
Table dialect.Table `json:"-"`
TableName string `json:"table_name"`
OmitReferenceKeys bool `json:"omit_reference_keys"`
ReferenceKeys []string `json:"reference_keys"`
Queries []Query `json:"queries"`
Columns []Column `json:"columns"`
Table dialect.Table `json:"-"`
}

type Config struct {
Expand Down
2 changes: 1 addition & 1 deletion etl/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (e *extractor) handleReferenceKeys(ctx context.Context, depth int, table di
schema = e.schema[table.Name]
)

if depth == 0 {
if depth == 0 && !schema.OmitReferenceKeys {
referenceKeys = table.ReferenceKeys
}

Expand Down

0 comments on commit 0f359b7

Please sign in to comment.