Check out example codes for "use psql in terminal". It will help you in understanding the concepts better.

Code Example 1

psql "dbname=dbhere host=hosthere user=userhere password=pwhere port=5432 sslmode=require"

Learn ReactJs, React Native from akashmittal.com