@certik/skynet 0.18.8 → 0.18.9

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.
package/.eslintrc.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": ["eslint:recommended", "plugin:import/recommended", "plugin:md/prettier"],
2
+ "extends": ["eslint:recommended", "plugin:import/recommended", "plugin:prettier/recommended", "plugin:md/prettier"],
3
3
  "parserOptions": {
4
4
  "ecmaVersion": 2023
5
5
  },
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.9
4
+
5
+ - Added options for `executeSql` function in `databricks` library
6
+
3
7
  ## 0.18.8
4
8
 
5
9
  - Added `databricks` library with `executeSql` function
package/databricks.js CHANGED
@@ -13,13 +13,14 @@ let client;
13
13
  */
14
14
  let session;
15
15
 
16
- async function initSession() {
16
+ async function initSession(options) {
17
17
  if (!client) {
18
18
  client = new DBSQLClient();
19
19
  await client.connect({
20
20
  token: ensureAndGet("SKYNET_DATABRICKS_TOKEN"),
21
21
  host: ensureAndGet("SKYNET_DATABRICKS_SERVER_HOSTNAME"),
22
22
  path: ensureAndGet("SKYNET_DATABRICKS_HTTP_PATH"),
23
+ ...options,
23
24
  });
24
25
  }
25
26
  if (!session) {
@@ -27,13 +28,13 @@ async function initSession() {
27
28
  }
28
29
  }
29
30
 
30
- async function executeSql(sql, bindings) {
31
+ async function executeSql(options, sql, bindings) {
31
32
  // retry sql query to avoid socket hang up error
32
33
  const results = exponentialRetry(
33
34
  async () => {
34
35
  let queryOperation;
35
36
  try {
36
- await initSession();
37
+ await initSession(options);
37
38
  queryOperation = await session.executeStatement(sql, {
38
39
  runAsync: true,
39
40
  namedParameters: objToParameter(bindings),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certik/skynet",
3
- "version": "0.18.8",
3
+ "version": "0.18.9",
4
4
  "description": "Skynet Shared JS library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -37,6 +37,7 @@
37
37
  "eslint": "^8.45.0",
38
38
  "eslint-plugin-import": "^2.29.1",
39
39
  "eslint-plugin-md": "^1.0.19",
40
+ "eslint-plugin-prettier": "^5.0.0",
40
41
  "prettier": "^3.3.3",
41
42
  "sinon": "^18.0.0"
42
43
  },