Skip to content

Commit

Permalink
Fix Cadence CLI (uber#5005)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaddoll authored Sep 29, 2022
1 parent 23abf96 commit 832f71a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/cli/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ func getDBFlags() []cli.Flag {
Name: FlagDBRegion,
Usage: "persistence region",
},
cli.IntFlag{
Name: FlagDBShard,
Usage: "number of db shards in a sharded SQL database",
},
cli.StringFlag{
Name: FlagUsername,
Usage: "persistence username",
Expand Down Expand Up @@ -301,6 +305,9 @@ func overrideSQLDataStore(c *cli.Context, cfg *config.SQL) {
if c.IsSet(FlagDBType) || cfg.PluginName == "" {
cfg.PluginName = c.String(FlagDBType)
}
if c.IsSet(FlagDBShard) || cfg.NumShards == 0 {
cfg.NumShards = c.Int(FlagDBShard)
}
if c.IsSet(FlagUsername) || cfg.User == "" {
cfg.User = c.String(FlagUsername)
}
Expand Down
1 change: 1 addition & 0 deletions tools/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const (
FlagDBAddress = "db_address"
FlagDBPort = "db_port"
FlagDBRegion = "db_region"
FlagDBShard = "db_shard"
FlagHistoryAddressWithAlias = FlagHistoryAddress + ", had"
FlagProtoVersion = "protocol_version"
FlagDomainID = "domain_id"
Expand Down

0 comments on commit 832f71a

Please sign in to comment.