Possible to Access Environment Variables from XQuery?

Saturday, 25 March 2017 · 4 messages
EK
Eliot Kimber25 Mar 2017 19:01 #
I’m running BaseX in a Docker container started via docker-compose. I need to communicate some local configuration details to BaseX. Can set these as environment variables (e.g., using .env with docker-compose) but I don’t see anything in the docs that would let me access environment variables from XQuery. Is there a built-in way to do this? Thanks, Eliot
-- Eliot Kimber http://contrext.com
CG
Christian Grün25 Mar 2017 19:05 #
Hi Eliot, fn:environment-variable should do the job; proc:property [1] can be used to access system properties. Hope this helps, Christian [1] http://docs.basex.org/wiki/Process_Module#proc:property
Quoted text · Eliot Kimber · 16 lines
On Sat, Mar 25, 2017 at 7:01 PM, Eliot Kimber <ekimber at contrext.com> wrote: > I’m running BaseX in a Docker container started via docker-compose. I need to communicate some local configuration details to BaseX. Can set these as environment variables (e.g., using .env with docker-compose) but I don’t see anything in the docs that would let me access environment variables from XQuery. > > Is there a built-in way to do this? > > Thanks, > > Eliot > > -- > Eliot Kimber > http://contrext.com > > > >
AB
Andy Buncein reply to Eliot Kimber, 25 Mar 2017, 19:0125 Mar 2017 19:06 #
Quoted text · Eliot Kimber · 21 lines
On 25 March 2017 at 18:01, Eliot Kimber <ekimber at contrext.com> wrote: > I’m running BaseX in a Docker container started via docker-compose. I need > to communicate some local configuration details to BaseX. Can set these as > environment variables (e.g., using .env with docker-compose) but I don’t > see anything in the docs that would let me access environment variables > from XQuery. > > Is there a built-in way to do this? > > Thanks, > > Eliot > > -- > Eliot Kimber > http://contrext.com > > > > >
EK
Eliot Kimberin reply to Christian Grün, 25 Mar 2017, 19:0525 Mar 2017 19:24 #
Thanks—it never occurred to me this would be a built-in function of XQuery 3. Cheers, E.
-- Eliot Kimber http://contrext.com
Quoted text · Christian Grün · 1 line
On 3/25/17, 7:05 PM, "Christian Grün" <christian.gruen at gmail.com> wrote:
Hi Eliot, fn:environment-variable should do the job; proc:property [1] can be used to access system properties. Hope this helps, Christian [1] http://docs.basex.org/wiki/Process_Module#proc:property
Quoted text · Eliot Kimber · 16 lines
On Sat, Mar 25, 2017 at 7:01 PM, Eliot Kimber <ekimber at contrext.com> wrote: > I’m running BaseX in a Docker container started via docker-compose. I need to communicate some local configuration details to BaseX. Can set these as environment variables (e.g., using .env with docker-compose) but I don’t see anything in the docs that would let me access environment variables from XQuery. > > Is there a built-in way to do this? > > Thanks, > > Eliot > > -- > Eliot Kimber > http://contrext.com > > > >

⚡Generated with XQuery