cloudspannerecosystem/wrench

wrench use environment variables instead of command arguments

Opened this issue · 0 comments

Expected Behavior

When specifying project, instance and database by command line args, I want wrench to use the values instead of environment variables.

Current Behavior

wrench use environment variables even if I pass project, instance and database by the command line args.

Steps to Reproduce

$ echo $SPANNER_PROJECT_ID                                                                                                                              
project-local-emulator

$ wrench apply --project my-gcp-project --instance instance1 --database database1 --dml ./sql/dml/000001_init.sql

Error command: apply, version: unknown
        Failed to execute the operation to Cloud Spanner, context deadline exceeded

$ unset SPANNER_PROJECT_ID                                                                                                               
$ echo $SPANNER_PROJECT_ID                                                                                                                              

$ wrench apply --project my-gcp-project --instance instance1 --database database1 --dml ./sql/dml/000001_init.sql
1 rows affected.

Context (Environment)

  • wrench version: 1.3.0

wrench help says project, instance and database can be specified by command line args. For example, in the description of the arg for database, (optional. if not set, will use $SPANNER_DATABASE_ID value) seems to mean command line args have higher priority than environment variables.