Skip to content

Commit

Permalink
Error on config
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Apr 22, 2024
1 parent 3825947 commit 019e095
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/config/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ func (b *BigQuery) DSN() string {

return dsn
}

func (c Config) ValidateBigQuery() error {
if c.SharedDestinationConfig.UppercaseEscapedNames {
return fmt.Errorf("uppercaseEscapedNames is not supported for BigQuery")
}

return nil
}
4 changes: 4 additions & 0 deletions lib/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ func (c Config) Validate() error {
}

switch c.Output {
case constants.BigQuery:
if err := c.ValidateBigQuery(); err != nil {
return err
}
case constants.MSSQL:
if err := c.ValidateMSSQL(); err != nil {
return err
Expand Down
4 changes: 4 additions & 0 deletions lib/config/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@ func (c Config) ValidateMSSQL() error {
return fmt.Errorf("invalid mssql port: %d", c.MSSQL.Port)
}

if c.SharedDestinationConfig.UppercaseEscapedNames {
return fmt.Errorf("uppercaseEscapedNames is not supported for MS SQL")
}

return nil
}

0 comments on commit 019e095

Please sign in to comment.