You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to run seed using an existing named DB connection and it does not work as expected.
To specify a connection name, I pass a connection property to configureConnection() function.
After digging in the code of the createConnection() function, I discovered that it is supposed to reuse a connection if it already exists.
It retrieves a connection name from the name property of a configureOption object. The property is always undefined as it does not even exist in the ConfigureOption interface.
I tried to change connection = await TypeORMGetConnection(configureOption.name) to connection = await TypeORMGetConnection(configureOption.connection) and it started to work properly.
Should I submit a PR for these changes or are there any restrictions I am not aware of?
The text was updated successfully, but these errors were encountered:
I try to run seed using an existing named DB connection and it does not work as expected.
To specify a connection name, I pass a
connection
property toconfigureConnection()
function.After digging in the code of the
createConnection()
function, I discovered that it is supposed to reuse a connection if it already exists.typeorm-seeding/src/connection.ts
Lines 102 to 111 in 4136b0e
So, the last step is calling a
createConnection()
function with configured above options.But the issue is that this line of code never gonna work as expected.
typeorm-seeding/src/connection.ts
Line 104 in 4136b0e
It retrieves a connection name from the
name
property of aconfigureOption
object. The property is alwaysundefined
as it does not even exist in theConfigureOption
interface.typeorm-seeding/src/connection.ts
Lines 17 to 21 in 4136b0e
I tried to change
connection = await TypeORMGetConnection(configureOption.name)
toconnection = await TypeORMGetConnection(configureOption.connection)
and it started to work properly.Should I submit a PR for these changes or are there any restrictions I am not aware of?
The text was updated successfully, but these errors were encountered: