Does TypeORM require the "default"
connection to be created? I created a named connection using the snippet below:
await createConnection({
name: 'usercontext',
type: 'postgres',
url: PGSQL_DATABASE_URL!,
synchronize: true,
ssl: {
rejectUnauthorized: false
},
entities
});
When I try to do an <Entity>.findOne
, the program throws a Connection "default" not found
error. My entities are registered on the connection creation. When I remove the "name"
variable in the connection configuration, I get the expected result. I need to use named connections since I'm developing with multiple databases. I am assuming since I included the entities in the connection configuration then there is no need to set invoke the "useConnection"
function of the entity.