-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to skip unavailable databases. (#17)
* Upgrade baton-sdk to v0.2.35. * Generate capabilities. * Add option to skip unavailable databases.
- Loading branch information
Showing
87 changed files
with
6,508 additions
and
1,229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,17 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/conductorone/baton-sdk/pkg/field" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
var ( | ||
dsn = field.StringField("dsn", | ||
field.WithDescription("The connection string for connecting to SQL Server"), | ||
field.WithRequired(true)) | ||
skipUnavailableDatabases = field.BoolField("skip-unavailable-databases", | ||
field.WithDescription("Skip databases that are unavailable (offline, restoring, etc)")) | ||
) | ||
|
||
var cfg = field.Configuration{ | ||
Fields: []field.SchemaField{dsn}, | ||
} | ||
|
||
// validateConfig is run after the configuration is loaded, and should return an error if it isn't valid. | ||
func validateConfig(_ context.Context, v *viper.Viper) error { | ||
if v.GetString(dsn.FieldName) == "" { | ||
return fmt.Errorf("--dsn is required") | ||
} | ||
|
||
return nil | ||
Fields: []field.SchemaField{dsn, skipUnavailableDatabases}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.