Connect to Postgres via environment variables
-
Apparently Directus supports to connect to external existing Postgres databases via custom environment variables - I wanted to try it these days and was wondering if someone has tried it already.
Also, can I use the same to connect to the Postgres addon database which I'd use for my custom app?
Also, can anyone recommend a free online Postgres database I could use for testing? I only know ElephantSQL, but they have announced their end of life.
-
I could successfully connect to a test postgres database with these environment variables:
DB_HOST=IP
DB_PORT=Port
DB_DATABASE="db_name"
DB_USER="user_name"
DB_PASSWORD="password"Then I ran
npx directus bootstrap
to initialise the database.When I run commands like
npx directus count table_name
it provides correct answers indicating that the database connection works.However, for some reason, the database doesn't show up in my GUI.