Is your feature request related to a problem? Please describe.
Performance is not ideal with the current Connection behavior.
Describe the solution you'd like
Currently, Connection objects connect/disconnect on each call. We should have an option to have it connect once and stay open until the user explicitly disconnects for the transports that support such things (idb, odbc, ssh). This would have to be opt-in, as the user would then be necessary for closing out connections that would otherwise be leaked.
The proposed solution would be something like
constconn=newConnection({transport: 'ssh',transportOptions: {host: 'myhost',username: 'myuser',password: 'mypassword'},persistent: true,// or keepOpen or whatever});conn.add(...);conn.run(...);// transport is implicitly openedconn.run(...);// transport is re-usedconn.close();conn.run(...);// transport is implicitly opened againIn this example the connection still implicitly opens the connection, it's just the user responsible for closing it. Alternatively, we could have the user explicitly open it as well.
When using the existing behavior, close() would be a no-op.
Is your feature request related to a problem? Please describe.
Performance is not ideal with the current Connection behavior.
Describe the solution you'd like
Currently, Connection objects connect/disconnect on each
call. We should have an option to have it connect once and stay open until the user explicitly disconnects for the transports that support such things (idb, odbc, ssh). This would have to be opt-in, as the user would then be necessary for closing out connections that would otherwise be leaked.The proposed solution would be something like
In this example the connection still implicitly opens the connection, it's just the user responsible for closing it. Alternatively, we could have the user explicitly open it as well.
When using the existing behavior,
close()would be a no-op.