Skip to content

Commit

Permalink
Self review
Browse files Browse the repository at this point in the history
  • Loading branch information
begelundmuller committed Sep 12, 2023
1 parent a3b249e commit 8fb5b66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions runtime/drivers/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ func parseSourceProperties(props map[string]any) (*sourceProperties, error) {
if err != nil {
return nil, err
}
if conf.SQL == "" {
return nil, fmt.Errorf("property 'sql' is mandatory for connector \"bigquery\"")
}
if conf.ProjectID == "" {
conf.ProjectID = bigquery.DetectProjectID
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/drivers/duckdb/transporter/motherduck_to_duckDB.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (t *motherduckToDuckDB) Transfer(ctx context.Context, srcProps, sinkProps m
}

if srcCfg.SQL == "" {
return fmt.Errorf("property \"query\" is mandatory for connector \"motherduck\"")
return fmt.Errorf("property \"sql\" is mandatory for connector \"motherduck\"")
}

userQuery := strings.TrimSpace(srcCfg.SQL)
Expand Down
5 changes: 4 additions & 1 deletion runtime/drivers/duckdb/transporter/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

type sourceProperties struct {
Database string `mapstructure:"database"`
Database string `mapstructure:"db"`
SQL string `mapstructure:"sql"`
}

Expand All @@ -19,6 +19,9 @@ func parseSourceProperties(props map[string]any) (*sourceProperties, error) {
if err := mapstructure.Decode(props, cfg); err != nil {
return nil, fmt.Errorf("failed to parse source properties: %w", err)
}
if cfg.SQL == "" {
return nil, fmt.Errorf("property 'sql' is mandatory")
}
return cfg, nil
}

Expand Down

0 comments on commit 8fb5b66

Please sign in to comment.