I have a DataSource configured in NestJS leveraging TypeORM to connect to a Postgres Database. It took me a bit to figure out why I wasn’t getting records but then I found the table and records were being written to the default ‘postgres’ database even though I provided ‘dbfab’ as the database to do my work in.
I have scoured for other solutions to this and cannot find one. Any advice would be appreciated.
const dataSource = new DataSource({
type: 'postgres',
host: 'localhost',
port: 5432,
username: 'username',
password: 'password',
schema: 'public',
database: 'dbfab',
entities: [`${__dirname}/../**/**.entity{.ts,.js}`],
synchronize: true,
});