Replies: 7 comments 29 replies
-
I'm currently very skeptical about multiple addresses. There are a bunch of problems with defining how that should work:
|
Beta Was this translation helpful? Give feedback.
-
I have few issues with that:
|
Beta Was this translation helpful? Give feedback.
-
Another question is what priority of |
Beta Was this translation helpful? Give feedback.
-
Oh, and another question: should we fail client bindings which have neither EDGEDB_HOST/EDGEDB_PORT nor project initialized? (like we currently do for CLI) |
Beta Was this translation helpful? Give feedback.
-
So, upon further reflection on the issue we decided that an explicit and documented set of sub-priorities is the least confusing and most flexible way forward. I propose the following order, where each subsequent entry overrides the previous within the same configuration layer:
Also, there are two kinds of connection parameters: aggregate (dsn, instance, credentials file), and granular (host, port, etc.). Granular parameters override only their part, whereas aggregate parameters override all granular parameters. For example, an explicit
The advantage of this approach is that it's consistent and well-defined. The downside is that there is a potential confusion when one has a |
Beta Was this translation helpful? Give feedback.
-
And a |
Beta Was this translation helpful? Give feedback.
-
What we decided on the zoom call:
|
Beta Was this translation helpful? Give feedback.
-
Currently how the connection parameters (host, port, database, user, password and tls cert) are resolved from the various cli options/client connection config options and env vars differs between the cli and the client bindings. (Between the client bindings the behaviour is largely the same, except edgedb-go doesn't implement deprecated features like
admin
connections).Since the current behaviour of the client bindings has bugs where the configuration resolved from a project linked instance cannot be overridden (geldata/gel-js#163, this bug also exists for other params and across all bindings), one proposal is that we standardise on the behaviour of the cli, with a few changes.
Current CLI behaviour: (in questionable pseudo code)
or diagram form: https://excalidraw.com/#json=5434124462456832,IlWtTuYO7ArrpRlsPjBljw
Proposed changes to CLI behaviour:
--instance
beforeEDGEDB_INSTANCE
. Currently the env var can override the instance name explicitly given on the command linedatabase
(anddbname
),user
,password
,tls_cert_file
andtls_verify_hostname
from the query params of a dsn, and also support multiple addresses as the host and port (dsn, config option, and env vars) accepting comma seperated lists of values. Update the CLI to handle these.There would be one small difference between CLI and client bindings: we would drop support for
admin
and theedgedbadmin://
protocol in the client bindings, but keep the--admin
option in the CLI.However there are cases in the CLI behaviour where it may not be inituitive to users why the connection params were resolved as they were. For example if you explicitly provide a dsn with
--dsn
, the password in the dsn can be invisibly overridden by theEDGEDB_PASSWORD
env var, but none of the other params can. So an alternative proposal is to create a simpler set of rules that would be easier for the user to reason about, and update both the cli and client bindings to those rules.My proposal for these rules would be to have a strict overriding hierarchy: explicit param options would always override env vars, which would override the implicit project linked instance credentials, and within an override level, more specific params (like host, port, database, password, etc..) would override the params within broader params (like dsn and instance).
Beta Was this translation helpful? Give feedback.
All reactions