lpil / pgo

🐘 Use PostgreSQL databases with PGO
https://hexdocs.pm/gleam_pgo/
Apache License 2.0
123 stars 12 forks source link

Question: connection pool example #38

Open mblarsen opened 2 weeks ago

mblarsen commented 2 weeks ago

The README prescribes a way to to handle connection pool limitation https://github.com/lpil/pgo?tab=readme-ov-file#atom-generation

Does a sample application exist that shows how this could work?

lpil commented 2 weeks ago

How what would work, sorry?

mblarsen commented 5 days ago

Sorry for just posting a link. I was thinking about this part:

Atom generation

Creating a connection pool with the pgo.connect function dynamically generates an Erlang atom. Atoms are not garbage collected and only a certain number of them can exist in an Erlang VM instance, and hitting this limit will result in the VM crashing. Due to this limitation you should not dynamically open new connection pools, instead create the pools you need when your application starts and reuse them throughout the lifetime of your program.

lpil commented 5 days ago

I don't know what you're asking I'm afraid.