Open mmastrac opened 5 months ago
I think I'm leaning toward 1: our client connections really do want to try to read from the environment, so even if you don't plan on using environment variables to configure the client (which is against our best practices), maybe we should still attempt looking there.
At the very least we should update the Deno readme to suggest allow-env
and allow-read
permissions in stronger language and call out that our connection algorithm really wants this.
Describe the bug
When connecting to EdgeDB cloud, the required
EDGEDB_*
environment variables need to be read to retrieve the required instance and secret key. The Deno adapter silently avoids reading these variables when--allow-env
is not present, causing the EdgeDB client to fall back to a local connection in most cases.This may appear as if the client is not successfully connecting to the EdgeDB cloud.
Reproduction
Note that
--allow-env
works as you'd expect:The problem appears to be that the client silently returns
undefined
here -- the same result as if the env var doesn't exist.Expected behavior
As this can cause end-user confusion, it's best if the client behaves in one of three ways:
console.warn
with the variables that were skipped and encourage the user to specify the connection string explicitly and/or configure the--allow-env
permission.Versions (please complete the following information):
Deno: approx >1.33 (versions with stable ALPN support) edgedb-js: current (< 1.5.7)