MCPcopy Create free account
hub / github.com/temporalio/temporal / BuildCLIOptions

Function BuildCLIOptions

tools/sql/main.go:32–222  ·  view source on GitHub ↗

BuildCLIOptions builds the options for cli

()

Source from the content-addressed store, hash-verified

30
31// BuildCLIOptions builds the options for cli
32func BuildCLIOptions() *cli.App {
33
34 app := cli.NewApp()
35 app.Name = "temporal-sql-tool"
36 app.Usage = "Command line tool for temporal sql operations"
37 app.Version = headers.ServerVersion
38
39 logger := log.NewCLILogger()
40
41 app.Flags = []cli.Flag{
42 cli.StringFlag{
43 Name: schema.CLIFlagEndpoint,
44 Value: environment.GetMySQLAddress(),
45 Usage: "hostname or ip address of sql host to connect to",
46 EnvVar: "SQL_HOST",
47 },
48 cli.IntFlag{
49 Name: schema.CLIFlagPort,
50 Value: environment.GetMySQLPort(),
51 Usage: "port of sql host to connect to",
52 EnvVar: "SQL_PORT",
53 },
54 cli.StringFlag{
55 Name: schema.CLIFlagUser,
56 Value: "",
57 Usage: "user name used for authentication when connecting to sql host",
58 EnvVar: "SQL_USER",
59 },
60 cli.StringFlag{
61 Name: schema.CLIFlagPassword,
62 Value: "",
63 Usage: "password used for authentication when connecting to sql host",
64 EnvVar: "SQL_PASSWORD",
65 },
66 cli.StringFlag{
67 Name: schema.CLIFlagDatabase,
68 Value: "temporal",
69 Usage: "name of the sql database",
70 EnvVar: "SQL_DATABASE",
71 },
72 cli.StringFlag{
73 Name: schema.CLIFlagPluginName,
74 Value: mysql.PluginName,
75 Usage: "name of the sql plugin",
76 EnvVar: "SQL_PLUGIN",
77 },
78 cli.BoolFlag{
79 Name: schema.CLIFlagQuiet,
80 Usage: "Don't set exit status to 1 on error",
81 },
82 cli.StringFlag{
83 Name: schema.CLIFlagConnectAttributes,
84 Usage: "sql connect attributes",
85 EnvVar: "SQL_CONNECT_ATTRIBUTES",
86 },
87 cli.BoolFlag{
88 Name: schema.CLIFlagEnableTLS,
89 Usage: "enable TLS over sql connection",

Callers 5

TestUpdateSchemaMethod · 0.92
TestDryrunMethod · 0.92
TestVisibilityDryrunMethod · 0.92
TestSetupSchemaMethod · 0.92
RunToolFunction · 0.70

Calls 6

NewCLILoggerFunction · 0.92
GetMySQLAddressFunction · 0.92
GetMySQLPortFunction · 0.92
cliHandlerFunction · 0.70
BoolMethod · 0.65
PrintfMethod · 0.45

Tested by

no test coverage detected