Repository navigation
feat(system): ENV(name) scalar lookup of one environment variable (S15) - #95
Merged
Merged
Conversation
environment() lists every variable; ENV('PATH') returns one inside an
expression. NULL when unset (so COALESCE works), '' when set-but-empty,
case-insensitive name on Windows via var_os. Registered under a new
System category behind the system-tables feature.
UNNEST(ENV('PATH'), ';') now splits PATH with no FROM clause.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ENV(name)scalar: the value of one environment variable of this process, for use inside an expression.environment()(S9) lists them all; this is the lookup S9 kept the name free for.COALESCE(ENV('EDITOR'), 'vi')works),''when set-but-empty, NULL for impossible names (empty,=, NUL), error for a non-string name.var_os, soENV('path')findsPathregardless of launching shell; exact on Linux.Systemfunction category, behind thesystem-tablesfeature.UNNEST(ENV('PATH'), ';')splits PATH with noFROM.Docs: new S15 entry in
docs/SYSTEM_TABLES.md; two queries appended toexamples/system_environment.sql.Test plan
src/sql/functions/system.rs(readsCARGO_PKG_NAME, never sets vars)./run_all_tests.shgreen (smoke-only note onexpander_rewritersQ7, which doesn't useENV)cargo check --no-default-features --features redis-cachecompiles (system-tables off)--function-help ENVand--list-functionsshow theSystemcategory🤖 Generated with Claude Code