Skip to content

Conversation

Mytherin
Copy link
Collaborator

Implements #4038

This PR adds the getenv function to the shell which can be used to read environment variables, for example:

D select getenv('HOME');
┌────────────────┐
│ getenv('HOME') │
│    varchar     │
├────────────────┤
│ /Users/myth    │
└────────────────┘

Note that the function is only available in the CLI (not in other DuckDB clients), and can only be run when enable_external_access is set to true.

SET/PRAGMA Expressions

This PR also extends the SET and PRAGMA statements to work with expressions instead of with constant values. As a result, we can also run the following code after this PR:

SET default_null_order=getenv('DEFAULT_NULL_ORDER');

@Mytherin Mytherin merged commit 754991b into duckdb:feature Nov 13, 2023
@Mytherin Mytherin added the Needs Documentation Use for issues or PRs that require changes in the documentation label Nov 13, 2023
@Mytherin Mytherin deleted the getenv branch December 4, 2023 11:45
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Dec 11, 2023
Merge pull request duckdb/duckdb#9392 from lnkuiper/parquet_encryption
Merge pull request duckdb/duckdb#9461 from hawkfish/merge-sort-trees
Merge pull request duckdb/duckdb#8788 from alnkesq/capi_create_enum_type
Merge pull request duckdb/duckdb#9513 from Tmonster/5614-database-invalidated
Merge pull request duckdb/duckdb#9622 from Mytherin/typescoping
Merge pull request duckdb/duckdb#9615 from hawkfish/strptime-infinity
Merge pull request duckdb/duckdb#9627 from Mytherin/attachifnotexists
Merge pull request duckdb/duckdb#9648 from samansmink/add-keep-alive-toggle
Merge pull request duckdb/duckdb#9638 from taniabogatsch/bench-refactor
Merge pull request duckdb/duckdb#9651 from Mytherin/getenv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Documentation Use for issues or PRs that require changes in the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant