title: Connect to postgresdb using typescript from nodejs server
body: <p>I am new to typescript and nodejs. I wanted to connect a server running on node to postgresdb in a containerized environment. There are examples available for this without typescirpt (only java script ) . 
  Any example or link would be helpful .</p>
  
  <p>Thanks </p>
  
  <p>Edit : 
  This JS Example</p>
  
  <pre><code>const { Client } = require('pg')
  const client = new Client()
  await client.connect()
  const res = await client.query('SELECT $1::text as message', ['Hello world!'])
  console.log(res.rows[0].message) // Hello world!
  await client.end()
  </code></pre>
  
  <p>This is the example taken from <a href="https://node-postgres.com/" rel="nofollow noreferrer">https://node-postgres.com/</a> and can we convert that into typescript , Using typescirpt is design decision so i cant use javascript, wanted to try something and experiment before giveup on it.</p>