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
Tegola is using PGX to connect to Postgis enabled postgres database. By default, PGX handles standard libpq env variables like PGHOST, PGDATABASE, PGPORT, PGUSER, PGPASSWORD. However Tegola forces either hardcoding the connection url into the config file or manually setting interpolated env vars. This is clunky and unintuitive (especially if you have a password that contains a character that needs escaping) and could be solved by making the connection uri in the config file optional and allowing pgx to handle validating the connection. directly.
If multiple postgis providers are needed, postgres has a built in convention for this using the pgservicefile which is also supported by default by PGX without any additional configuration needed
an optional service parameter could be added to allow switching between multiple providers. This way Tegola does not need to reinvent the wheel and manually handle what PGX can already do.
The text was updated successfully, but these errors were encountered:
actually you don't even need the extra service parameter. if tegola just feeds the url directly to pgx you can specify the service in the uri like postgres:///?service=pg-db all that needs to be done is not pre-validate the connection uri
@apjoseph I'm all for supporting more ways to load in the connection string. I just want to make sure we prove the connection is valid at start up. I think this change could be fairly easy to implement by just doing a check if a connection string is present, and if not then let pgx run through it's load routine. If that fails, return an error.
@iwpnd if you want to tackle this feel free to pick it up as well. I think it is a good enhancement and you're pretty familiar with that part of the codebase ;-)
Tegola is using PGX to connect to Postgis enabled postgres database. By default, PGX handles standard libpq env variables like PGHOST, PGDATABASE, PGPORT, PGUSER, PGPASSWORD. However Tegola forces either hardcoding the connection url into the config file or manually setting interpolated env vars. This is clunky and unintuitive (especially if you have a password that contains a character that needs escaping) and could be solved by making the connection uri in the config file optional and allowing pgx to handle validating the connection. directly.
If multiple postgis providers are needed, postgres has a built in convention for this using the pgservicefile which is also supported by default by PGX without any additional configuration needed
an optional
service
parameter could be added to allow switching between multiple providers. This way Tegola does not need to reinvent the wheel and manually handle what PGX can already do.The text was updated successfully, but these errors were encountered: