@aicore/coco-db-client
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "@aicore/coco-db-client", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "JS client for cocoDb", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -29,2 +29,32 @@ import {httpGet, httpPut} from "./client.js"; | ||
/** | ||
* It creates a database with the name provided in the databaseName parameter | ||
* @param{string} databaseName - The name of the database you want to create. | ||
* @returns{Promise<boolean>} A promise | ||
*/ | ||
export function createDb(databaseName) { | ||
if (isStringEmpty(databaseName)) { | ||
throw new Error('Please provide valid dataBaseName'); | ||
} | ||
return httpPut('/createDb', { | ||
databaseName: databaseName | ||
}); | ||
} | ||
/** | ||
* It deletes the database with the given name | ||
* @param{string} databaseName - The name of the database to be deleted. | ||
* @returns{Promise<boolean>} A promise. | ||
*/ | ||
export function deleteDb(databaseName) { | ||
if (isStringEmpty(databaseName)) { | ||
throw new Error('Please provide valid dataBaseName'); | ||
} | ||
return httpPut('/deleteDb', { | ||
databaseName: databaseName | ||
}); | ||
} | ||
/** | ||
* It takes a table name and a document as input and returns a promise | ||
@@ -31,0 +61,0 @@ * @param tableName - The name of the table you want to put the document in. |
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
56766
352