title: How to configure NestJS TypeOrm with URI instead of host, port, username and password fields?
body: <p>The Heroku Postgres addon provides DB connection details as <code>postgres://user:pw@host:port</code> in the <code>DATABASE_URL</code> env var.</p>
  <p>I'm wondering how to configure a NestJS app using TypeOrm, because all the examples look like this:</p>
  <pre class="lang-js prettyprint-override"><code>@Module({
    imports: [
      TypeOrmModule.forRoot({
          type: 'postgres',
          host: '...',
          port: 5432,
          username: '...',
          password: '...',
      }),
    ],
  })
  </code></pre>