🚀 Feature: Add external postgres database support #452

Closed
opened 2025-10-09 16:47:41 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @edbourque0 on GitHub.

Feature description

Add the option to connect to an external Postgres database to store the data, replacing sqlite. The database information could be entered as environment variables (host, port, username, password). Could add these env var : DB_TYPE (sqlite or postgres), DB_HOST, DB_PORT, DB_USER, DB_PASS.

Pitch

I personally like to have control over my app's data. I have a postgres database that stores all of it and it's easier to update some data thru this. My usecase for now would be to update the approximate location which are all set to unknown before I entered my maxmind licence.

Originally created by @edbourque0 on GitHub. ### Feature description Add the option to connect to an external Postgres database to store the data, replacing sqlite. The database information could be entered as environment variables (host, port, username, password). Could add these env var : DB_TYPE (sqlite or postgres), DB_HOST, DB_PORT, DB_USER, DB_PASS. ### Pitch I personally like to have control over my app's data. I have a postgres database that stores all of it and it's easier to update some data thru this. My usecase for now would be to update the approximate location which are all set to unknown before I entered my maxmind licence.
OVERLORD added the feature label 2025-10-09 16:47:41 +03:00
Author
Owner

@stonith404 commented on GitHub:

Postgres support in now in v0.20.0 :)

@stonith404 commented on GitHub: Postgres support in now in `v0.20.0` :)
Author
Owner

@edbourque0 commented on GitHub:

I've created a pull request #79. Would you mind to test the stonith404/pocket-id:postgres-development Docker image and give me feedback if something doesn't work as expected or is confusing to setup?

You have to set the DB_PROVIDER and POSTGRES_CONNECTION_STRING environment variables. You can see the new documentation in the new README.

Here is my feedback after testing :

  1. There seems to be an issue with the TRUST_PROXY environment variable. The container is not running when it's set to true. Got a caddy error in the logs (line 11) :
    image

  2. Why is it mentioned that the database must be named pocket-id in the environment variable description ? Everything seems to work with my database which was named pocketid.

Let me know if your want me to test anything else!
Cheers

@edbourque0 commented on GitHub: > I've created a pull request #79. Would you mind to test the `stonith404/pocket-id:postgres-development` Docker image and give me feedback if something doesn't work as expected or is confusing to setup? > > You have to set the `DB_PROVIDER` and `POSTGRES_CONNECTION_STRING` environment variables. You can see the new documentation in the [new README](https://github.com/stonith404/pocket-id/blob/feat/postgres-support/README.md#environment-variables). Here is my feedback after testing : 1. There seems to be an issue with the ``TRUST_PROXY`` environment variable. The container is not running when it's set to ``true``. Got a caddy error in the logs (line 11) : ![image](https://github.com/user-attachments/assets/54a1dac9-70e4-45a7-adeb-aeda1cfeddef) 2. Why is it mentioned that the database must be named ``pocket-id`` in the environment variable description ? Everything seems to work with my database which was named ``pocketid``. Let me know if your want me to test anything else! Cheers
Author
Owner

@stonith404 commented on GitHub:

Thank you for testing!

Caddy was automatically updated and this broke something, this should be fixed now.

You're right, the database name hasn't to be "pocket-id", I'm not sure what I was thinking while writing that 😅.

@stonith404 commented on GitHub: Thank you for testing! Caddy was automatically updated and this broke something, this should be fixed now. You're right, the database name hasn't to be "pocket-id", I'm not sure what I was thinking while writing that 😅.
Author
Owner

@stonith404 commented on GitHub:

I've created a pull request #79. Would you mind to test the stonith404/pocket-id:postgres-development Docker image and give me feedback if something doesn't work as expected or is confusing to setup?

You have to set the DB_PROVIDER and POSTGRES_CONNECTION_STRING environment variables. You can see the new documentation in the new README.

@stonith404 commented on GitHub: I've created a pull request #79. Would you mind to test the `stonith404/pocket-id:postgres-development` Docker image and give me feedback if something doesn't work as expected or is confusing to setup? You have to set the `DB_PROVIDER` and `POSTGRES_CONNECTION_STRING` environment variables. You can see the new documentation in the [new README](https://github.com/stonith404/pocket-id/blob/feat/postgres-support/README.md#environment-variables).
Author
Owner

@edbourque0 commented on GitHub:

Of course! I'll let you know when I'm done

@edbourque0 commented on GitHub: Of course! I'll let you know when I'm done
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-2#452