Add Insert Generator
This commit is contained in:
parent
f5e89799fc
commit
a01dd7107b
24
functions/sql/sql-insert-generator.d.ts
vendored
Normal file
24
functions/sql/sql-insert-generator.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
export = sqlInsertGenerator;
|
||||
/**
|
||||
* @typedef {object} SQLINsertGenReturn
|
||||
* @property {string} query
|
||||
* @property {string[]} values
|
||||
*/
|
||||
/**
|
||||
* @param {object} param0
|
||||
* @param {any[]} param0.data
|
||||
* @param {string} param0.tableName
|
||||
*
|
||||
* @return {SQLINsertGenReturn | undefined}
|
||||
*/
|
||||
declare function sqlInsertGenerator({ tableName, data }: {
|
||||
data: any[];
|
||||
tableName: string;
|
||||
}): SQLINsertGenReturn | undefined;
|
||||
declare namespace sqlInsertGenerator {
|
||||
export { SQLINsertGenReturn };
|
||||
}
|
||||
type SQLINsertGenReturn = {
|
||||
query: string;
|
||||
values: string[];
|
||||
};
|
2
index.d.ts
vendored
2
index.d.ts
vendored
@ -26,6 +26,7 @@ import sanitizeSql = require("./utils/functions/sanitizeSql");
|
||||
import datasquirelClient = require("./client");
|
||||
export namespace sql {
|
||||
export { sqlGenerator };
|
||||
export { sqlInsertGenerator };
|
||||
}
|
||||
import uploadImage = require("./utils/upload-image");
|
||||
import uploadFile = require("./utils/upload-file");
|
||||
@ -43,4 +44,5 @@ import validateToken = require("./users/validate-token");
|
||||
import loginWithGoogle = require("./users/social/google-auth");
|
||||
import loginWithGithub = require("./users/social/github-auth");
|
||||
import sqlGenerator = require("./functions/sql/sql-generator");
|
||||
import sqlInsertGenerator = require("./functions/sql/sql-insert-generator");
|
||||
export { get, post, getSchema, sanitizeSql, datasquirelClient as client };
|
||||
|
2
index.js
2
index.js
@ -29,6 +29,7 @@ const validateToken = require("./users/validate-token");
|
||||
const sanitizeSql = require("./utils/functions/sanitizeSql");
|
||||
const datasquirelClient = require("./client");
|
||||
const sqlGenerator = require("./functions/sql/sql-generator");
|
||||
const sqlInsertGenerator = require("./functions/sql/sql-insert-generator");
|
||||
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
@ -68,6 +69,7 @@ const media = {
|
||||
*/
|
||||
const sql = {
|
||||
sqlGenerator,
|
||||
sqlInsertGenerator,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@moduletrace/datasquirel",
|
||||
"version": "2.5.9",
|
||||
"version": "2.6.0",
|
||||
"description": "Cloud-based SQL data management tool",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
|
Loading…
Reference in New Issue
Block a user