We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4524b69 + 8a1da91 commit 9b614d4Copy full SHA for 9b614d4
src/connection.ts
@@ -17,6 +17,13 @@ export const getConnectionOptions = async (configPath = 'ormconfig.js'): Promise
17
}
18
19
export const createConnection = async (configPath: string): Promise<Connection> => {
20
- const options = await getConnectionOptions(configPath)
+ let options = await getConnectionOptions(configPath)
21
+ if (Array.isArray(options)) {
22
+ options.forEach(item => {
23
+ if (item.name === 'default') {
24
+ options = item
25
+ }
26
+ })
27
28
return createTypeORMConnection(options as TypeORMConnectionOptions)
29
0 commit comments