@@ -106,6 +106,7 @@ and KafkaArguments(c: Args.Configuration, p: ParseResults<KafkaParameters>) =
106106 member val Topic = p.GetResult( Topic, fun () -> c.KafkaTopic)
107107 member val Source = SourceArguments( c, p.GetResult KafkaParameters.From)
108108and [<NoEquality; NoComparison; RequireSubcommand>] CosmosParameters =
109+ | [<AltCommandLine " -m" >] ConnectionMode of Microsoft.Azure.Cosmos.ConnectionMode
109110 | [<AltCommandLine " -s" >] Connection of string
110111 | [<AltCommandLine " -d" >] Database of string
111112 | [<AltCommandLine " -c" ; Mandatory>] Container of string
@@ -117,6 +118,7 @@ and [<NoEquality; NoComparison; RequireSubcommand>] CosmosParameters =
117118 | [<CliPrefix( CliPrefix.None); Last>] From of ParseResults < SourceParameters >
118119 interface IArgParserTemplate with
119120 member a.Usage = a |> function
121+ | ConnectionMode _ -> " override the connection mode. Default: Direct."
120122 | Connection _ -> $""" specify a connection string for the destination Cosmos account.
121123 Default (From Cosmos): Same as Source.
122124 Default (From Json): optional if environment variable {Args.Configuration.Cosmos.CONNECTION} specified"""
@@ -138,8 +140,9 @@ and CosmosArguments(c: Args.Configuration, p: ParseResults<CosmosParameters>) =
138140 | x -> p.Raise $" unexpected subcommand %A {x}"
139141 let connector =
140142 let retries = p.GetResult( Retries, 2 )
143+ let mode = p.TryGetResult ConnectionMode
141144 let maxRetryWaitTime = p.GetResult( RetriesWaitTime, 5 ) |> TimeSpan.seconds
142- Equinox.CosmosStore.CosmosStoreConnector( Equinox.CosmosStore.Discovery.ConnectionString connection, retries, maxRetryWaitTime)
145+ Equinox.CosmosStore.CosmosStoreConnector( Equinox.CosmosStore.Discovery.ConnectionString connection, retries, maxRetryWaitTime, ?mode = mode )
143146 let database = match source.Store with
144147 | Cosmos c -> p.GetResult( Database, fun () -> c.Database)
145148 | Json _ -> p.GetResult( Database, fun () -> c.CosmosDatabase)
0 commit comments