Using CLI switches or environment variables

Did you know that the FlowObjects DataLoader allows you to use most switches as environment variables instead?

When you run the DataLoader with -h or --help you’ll see a list of all the available required and optional switches (required and optional switches always require a value to be provided) along with optional flags (flags never accept a value). Each switch is listed in all lowercase with a -- in front of it and those that support environment variable equivalent have an identical name in all uppercase. For example you’ll see:

  --sf_account SF_ACCOUNT
                        Snowflake account name.
  --sf_username SF_USERNAME
                        Snowflake user name.
  --sf_password SF_PASSWORD
                        Snowflake password.

The --sf_account in the above example is a switch and its environment variable equivalent is SF_ACCOUNT.

While everyone’s use case may be a little different, here are a couple of common use cases for using environment variable instead of the CLI switch:

  • Using an automated script, but you don’t want to store the password in the script, use the SF_PASSWORD as an environment variable
  • Testing different switches and/or flags, but you don’t want to keep typing the all the static required parameters, put them in the environment variables:
    • etc…

See also: FlowObjects Data Loader for Snowflake - command line parameters