deliverr / data-knex-snowflake-dialect

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

driverName not set correctly after PR #36 #45

Open barooo opened 1 year ago

barooo commented 1 year ago

I'm trying to use the latest version (1.0.1), and in my minimal app that tries to get a connection I'm getting a generic error "Unable to acquire a connection". Currently, driverName is a property on the config object passed to the constructor and knex is not doing anything with that key so driverName is undefined when the super() call happens to Knex.Client.

I can get it to work if I do this:

const db = Knex(config);
db.client.driverName = "snowflake-sdk";
db.client.initializeDriver();
db.client.initializePool(config);

Am I missing something? This was changed in https://github.com/deliverr/data-knex-snowflake-dialect/pull/36 which was recently merged. I have version 1.0.1 of knex and of the dialect.

danajanezic commented 1 year ago

I just spent many many hours trying to figure out what was going on. This was exactly the issue. Any movement on this?

barooo commented 1 year ago

I just spent many many hours trying to figure out what was going on. This was exactly the issue. Any movement on this?

I ended up just calling the initialize methods as above when I initialize the db connection. I've got a few other changes in a fork that I haven't yet tried to get merged back in, once I've got some time I'll try to open a PR, I can probably fix this one too.