You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'd like to be able to specify an environment for a language inside a directory or individual note. Any code in that language inside that note would use that environment, but notes outside of that would either use their own environments or the default environment.
Describe the solution you'd like
Something that allows me to define an environment for that individual note or any notes in the current directory and its children. For example with SQL, I could define a server to connect to (possibly pulling credentials from a .env file that may or may not be in the current dir or even in the vault) and any SQL blocks in that note or dir would connect to that host.
Maybe even an option to specify it per code block:
Maybe something like {pre, env='~/really/long/path/prod.env'} to apply that env to everything in the note. Or {label='prod', env='~/really/long/path/prod.env'} and use an import to reuse that env without having to rewrite the path for each block.
Or even {env=[dev='./dev.env', prod='./prod.env']} and the Run button in that block (and anything that imports it) would change to 2 buttons labeled dev and prod
Describe alternatives you've considered
Right now I don't know of anything like this. I just copy-paste my code into terminal in a dir where I use direnv to set up environments
Additional context
I'm looking for a place to keep all my snippets for all my projects and be able to easily run them. I think this is the last piece of the puzzle.
The text was updated successfully, but these errors were encountered:
Another possible solution: wrappers. In fact, this might be better, and more flexible as you could run custom languages with it. Similar to pre/post blocks but with more options.
```run-shell {label='prod'}
docker run -it --rm postgres psql -d <database> -U <user> -c '@wrapped_str'
# or
docker run -it --rm postgres psql -d <database> -U <user> -f @wrapped_file
```
```run-sql {wrap='prod'}
SELECT * FROM table;
```
Is your feature request related to a problem? Please describe.
I'd like to be able to specify an environment for a language inside a directory or individual note. Any code in that language inside that note would use that environment, but notes outside of that would either use their own environments or the default environment.
Describe the solution you'd like
Something that allows me to define an environment for that individual note or any notes in the current directory and its children. For example with SQL, I could define a server to connect to (possibly pulling credentials from a .env file that may or may not be in the current dir or even in the vault) and any SQL blocks in that note or dir would connect to that host.
Maybe even an option to specify it per code block:
or in a file
prod.env:
Maybe something like
{pre, env='~/really/long/path/prod.env'}
to apply that env to everything in the note. Or{label='prod', env='~/really/long/path/prod.env'}
and use animport
to reuse that env without having to rewrite the path for each block.Or even
{env=[dev='./dev.env', prod='./prod.env']}
and theRun
button in that block (and anything that imports it) would change to 2 buttons labeleddev
andprod
Describe alternatives you've considered
Right now I don't know of anything like this. I just copy-paste my code into terminal in a dir where I use
direnv
to set up environmentsAdditional context
I'm looking for a place to keep all my snippets for all my projects and be able to easily run them. I think this is the last piece of the puzzle.
The text was updated successfully, but these errors were encountered: