@aicore/cocodb-ws-client
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "@aicore/cocodb-ws-client", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Websocket client for cocoDb", | ||
@@ -62,3 +62,3 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"@aicore/libcommonutils": "1.0.18", | ||
"@aicore/libcommonutils": "1.0.19", | ||
"ws": "8.9.0" | ||
@@ -65,0 +65,0 @@ }, |
import {sendMessage} from "./client.js"; | ||
export {init, close} from "./client.js"; | ||
import {COCO_DB_FUNCTIONS, isObjectEmpty, isStringEmpty} from "@aicore/libcommonutils"; | ||
import {COCO_DB_FUNCTIONS, isObjectEmpty, isString, isStringEmpty} from "@aicore/libcommonutils"; | ||
@@ -304,1 +304,37 @@ // @INCLUDE_IN_API_DOCS | ||
} | ||
/** | ||
* It queries the database for a given table name and query string. | ||
* @param {string} tableName - The name of the table you want to query. | ||
* @param {string} queryString - The query string to be executed. | ||
* @param {Array<string>}[useIndexForFields=null] - This is an array of fields that you want to use the index for. | ||
* @returns {Promise}A promise | ||
*/ | ||
export function query(tableName, queryString, useIndexForFields = null) { | ||
if (isStringEmpty(tableName)) { | ||
throw new Error('Please provide valid table name'); | ||
} | ||
if (!isString(queryString) || isStringEmpty(queryString)) { | ||
throw new Error('Please provide valid query String'); | ||
} | ||
if (!useIndexForFields) { | ||
return sendMessage( | ||
{ | ||
fn: COCO_DB_FUNCTIONS.query, | ||
request: { | ||
tableName: tableName, | ||
queryString: queryString | ||
} | ||
}); | ||
} | ||
return sendMessage( | ||
{ | ||
fn: COCO_DB_FUNCTIONS.query, | ||
request: { | ||
tableName: tableName, | ||
queryString: queryString, | ||
useIndexForFields: useIndexForFields | ||
} | ||
}); | ||
} | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61863
466
+ Added@aicore/libcommonutils@1.0.19(transitive)
- Removed@aicore/libcommonutils@1.0.18(transitive)