deliverr / data-knex-snowflake-dialect

knex.js dialect for the Snowflake data warehouse
MIT License
13 stars 26 forks source link

Lib is leaking Snowflake SDK connections #69

Open GabrielLomba opened 6 months ago

GabrielLomba commented 6 months ago

Hi! This lib is leaking Snowflake Connection instances due to a cleanup code error here. In that code, we call connection.end() when, in reality, the method defined by the Snowflake SDK is connection.destroy (defined here).

This leads to never cleaning up the keepalive interval SF connections create by default, which, in turn, keeps all Connection instances around even when they were already removed from the pool managed by Knex. I've created a pull request to fix this.