Skip to content

Commit

Permalink
fix(Tool sync cosmos from json): Use connection env var
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Aug 21, 2024
1 parent c6c18d3 commit bec3051
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/Propulsion.Tool/Sync.fs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ and [<NoEquality; NoComparison; RequireSubcommand>] CosmosParameters =
| [<CliPrefix(CliPrefix.None); Last>] From of ParseResults<SourceParameters>
interface IArgParserTemplate with
member a.Usage = a |> function
| Connection _ -> "specify a connection string for the destination Cosmos account. Default (if Cosmos): Same as Source"
| Connection _ -> $"""specify a connection string for the destination Cosmos account
Default (From Cosmos): Same as Source.
Default (From Json): optional if environment variable {Args.Configuration.Cosmos.CONNECTION} specified"""
| Database _ -> "specify a database name for store. Default (if Cosmos): Same as Source"
| Container _ -> "specify a container name for store."
| LeaseContainerId _ -> "store leases in Sync target DB (default: use `-aux` adjacent to the Source Container). Enables the Source to be read via a ReadOnly connection string."
Expand All @@ -130,7 +132,7 @@ and CosmosArguments(c: Args.Configuration, p: ParseResults<CosmosParameters>) =
let source = SourceArguments(c, p.GetResult CosmosParameters.From)
let connection = match source.Store with
| Cosmos c -> p.GetResult(Connection, fun () -> c.Connection)
| Json _ -> p.GetResult Connection
| Json _ -> p.GetResult(Connection, fun () -> c.CosmosConnection)
| x -> p.Raise $"unexpected subcommand %A{x}"
let connector =
let timeout = p.GetResult(Timeout, 5) |> TimeSpan.seconds
Expand Down

0 comments on commit bec3051

Please sign in to comment.