ref. https://gist.github.com/silverark/2fd88d03fddbe373fce87da80afdc3ce
Line 22:
This connection string should be global, and reusable for all the operations, and not recreated for every method
Line 22:
It’s a really bad code practice to put the connection string inside the code, the common usage is to declare the variables inside a .env file for different environments, but never inside the code itself,
The variables, user, password and dbname should not be public.