| 815 | } |
| 816 | |
| 817 | class ProjectConfigOptions { |
| 818 | public static defaultDatabase: INamedOption<yargs.Options> = { |
| 819 | name: "default-database", |
| 820 | option: { |
| 821 | describe: |
| 822 | "The default database to use, equivalent to Google Cloud Project ID. If unset, " + |
| 823 | "the value from workflow_settings.yaml is used.", |
| 824 | type: "string" |
| 825 | } |
| 826 | }; |
| 827 | |
| 828 | public static defaultSchema: INamedOption<yargs.Options> = { |
| 829 | name: "default-schema", |
| 830 | option: { |
| 831 | describe: |
| 832 | "Override for the default schema name. If unset, the value from workflow_settings.yaml is used." |
| 833 | } |
| 834 | }; |
| 835 | |
| 836 | public static defaultLocation: INamedOption<yargs.Options> = { |
| 837 | name: "default-location", |
| 838 | option: { |
| 839 | describe: |
| 840 | "The default location to use. See " + |
| 841 | "https://cloud.google.com/bigquery/docs/locations for supported values. If unset, the " + |
| 842 | "value from workflow_settings.yaml is used." |
| 843 | } |
| 844 | }; |
| 845 | |
| 846 | public static assertionSchema: INamedOption<yargs.Options> = { |
| 847 | name: "assertion-schema", |
| 848 | option: { |
| 849 | describe: "Default assertion schema. If unset, the value from workflow_settings.yaml is used." |
| 850 | } |
| 851 | }; |
| 852 | |
| 853 | public static databaseSuffix: INamedOption<yargs.Options> = { |
| 854 | name: "database-suffix", |
| 855 | option: { |
| 856 | describe: "Default assertion schema. If unset, the value from workflow_settings.yaml is used." |
| 857 | } |
| 858 | }; |
| 859 | |
| 860 | public static vars: INamedOption<yargs.Options> = { |
| 861 | name: "vars", |
| 862 | option: { |
| 863 | describe: |
| 864 | "Override for variables to inject via '--vars=someKey=someValue,a=b', referenced by " + |
| 865 | "`dataform.projectConfig.vars.someValue`. If unset, the value from workflow_settings.yaml is used.", |
| 866 | type: "string", |
| 867 | default: null, |
| 868 | coerce: (rawVarsString: string | null) => { |
| 869 | const variables: { [key: string]: string } = {}; |
| 870 | rawVarsString?.split(",").forEach(keyValueStr => { |
| 871 | const [key, value] = keyValueStr.split("="); |
| 872 | variables[key] = value; |
| 873 | }); |
| 874 | return variables; |