Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: general variable substitution (#196)
Support environment variables and special variables (like `$__TEST_DIR__`) substitution with the crate [`subst`](crates.io/subst). Basically, this is a general form of the previous `replace_keywords`. This is helpful if we want to don't want to hardcode some information in the SQL, for example, authentication information. ``` control substitution on query T select $MY_USERNAME, ${MY_PASSWORD}, ${MY_INEXISTENT_PORT:11451}, ${MY_DATABASE:$MY_USERNAME-db} ---- sqllogictest, rust, 11451, sqllogictest-db query T select $__TEST_DIR__ ---- /var/folders/h3/ky82klmd2ygfr58ppqm4js6m0000gn/T/.tmp63ZLdk ``` See `substitution/basic.slt` for more detailed usages. In order to be compatible with other implementations, this feature is under the gate of `control substitution` and is by default disabled.
- Loading branch information