@quillsql/node 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,7 +66,9 @@ class CachedConnection {
66
66
  getCache({ username, password, host, port, cacheType, }) {
67
67
  if (cacheType === "redis" || cacheType === "rediss") {
68
68
  const redisURL = `${cacheType}://${username}:${password}@${host}:${port}`;
69
- return (0, redis_1.createClient)({ url: redisURL });
69
+ const client = (0, redis_1.createClient)({ url: redisURL });
70
+ client.connect();
71
+ return client;
70
72
  }
71
73
  return null;
72
74
  }
@@ -105,7 +105,7 @@ function formatSnowflakeConfig(connectionString) {
105
105
  }
106
106
  exports.formatSnowflakeConfig = formatSnowflakeConfig;
107
107
  function connectToSnowflake(config) {
108
- const connection = snowflake_sdk_1.default.createConnection(config);
108
+ const connection = snowflake_sdk_1.default.createConnection(Object.assign(Object.assign({}, config), { clientSessionKeepAlive: true }));
109
109
  connection.connect((err) => {
110
110
  if (err) {
111
111
  console.error(`Failed to connect to Snowflake: ${err.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/node",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Quill Server SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -89,7 +89,9 @@ export class CachedConnection {
89
89
  }: QuillConfig["cache"]): Mapable | null {
90
90
  if (cacheType === "redis" || cacheType === "rediss") {
91
91
  const redisURL = `${cacheType}://${username}:${password}@${host}:${port}`;
92
- return createClient({ url: redisURL }) as Mapable;
92
+ const client = createClient({ url: redisURL });
93
+ client.connect();
94
+ return client as Mapable;
93
95
  }
94
96
  return null;
95
97
  }
@@ -111,7 +111,10 @@ export function formatSnowflakeConfig(
111
111
  export function connectToSnowflake(
112
112
  config: SnowflakeConnectionConfig
113
113
  ): snowflake.Connection {
114
- const connection = snowflake.createConnection(config);
114
+ const connection = snowflake.createConnection({
115
+ ...config,
116
+ clientSessionKeepAlive: true,
117
+ });
115
118
  connection.connect((err) => {
116
119
  if (err) {
117
120
  console.error(`Failed to connect to Snowflake: ${err.message}`);