Skip to content

TypeOrmModule.forRoot() should accept connection name #66

Open
@IntellectProductions

Description

@IntellectProductions

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

TypeOrmModule.forRoot('default') is throwing as invalid code even though in the documentation states that it accepts the same arguments as createConnection() does in Typeorm.

[{
  "name": "default",
  "type": "postgres",
  "host": "localhost",
  "port": 5432,
  "username": "",
  "password": "",
  "database": "",
  "entities": ["src/**/**.entity{.ts,.js}"],
  "synchronize": false,
  "migrationsTableName": "migrations",
  "migrations": ["src/database/migrations/*{.ts,.js}"],
  "cli": {
    "migrationsDir": "src/database/migrations"
  }
}, {
  "name": "seed",
  "type": "postgres",
  "host": "localhost",
  "port": 5432,
  "username": "",
  "password": "",
  "database": "",
  "entities": ["src/**/**.entity{.ts,.js}"],
  "synchronize": false,
  "migrationsTableName": "seeds",
  "migrations": ["src/database/seeds/*{.ts,.js}"],
  "cli": {
    "migrationsDir": "src/database/seeds"
  }
}]

Expected behavior

It should pick the connection name from your ormconfig.js or json file like Typeorm does.

What is the motivation / use case for changing the behavior?

To stay up to date with Typeorm's codebase.

Environment


Nest version: 5.7.3

 
For Tooling issues:
- Node version: 10.5.0  
- Platform:  Mac 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions