Bugfix
This commit is contained in:
parent
dbc68e54c6
commit
12296a3e75
@ -13,9 +13,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.default = dsqlCrud;
|
exports.default = dsqlCrud;
|
||||||
const get_1 = __importDefault(require("../../actions/get"));
|
|
||||||
const post_1 = __importDefault(require("../../actions/post"));
|
const post_1 = __importDefault(require("../../actions/post"));
|
||||||
const sql_generator_1 = __importDefault(require("../../functions/dsql/sql/sql-generator"));
|
const sql_generator_1 = __importDefault(require("../../functions/dsql/sql/sql-generator"));
|
||||||
|
const conn_db_handler_1 = __importDefault(require("../db/conn-db-handler"));
|
||||||
function dsqlCrud(_a) {
|
function dsqlCrud(_a) {
|
||||||
return __awaiter(this, arguments, void 0, function* ({ action, data, table, targetId, query, sanitize, debug, }) {
|
return __awaiter(this, arguments, void 0, function* ({ action, data, table, targetId, query, sanitize, debug, }) {
|
||||||
const finalData = sanitize ? sanitize(data) : data;
|
const finalData = sanitize ? sanitize(data) : data;
|
||||||
@ -27,11 +27,7 @@ function dsqlCrud(_a) {
|
|||||||
tableName: table,
|
tableName: table,
|
||||||
genObject: query,
|
genObject: query,
|
||||||
});
|
});
|
||||||
const GET_RES = yield (0, get_1.default)({
|
const GET_RES = yield (0, conn_db_handler_1.default)(global.DSQL_DB_CONN, (queryObject === null || queryObject === void 0 ? void 0 : queryObject.string) || "", (queryObject === null || queryObject === void 0 ? void 0 : queryObject.values) || []);
|
||||||
query: (queryObject === null || queryObject === void 0 ? void 0 : queryObject.string) || "",
|
|
||||||
queryValues: (queryObject === null || queryObject === void 0 ? void 0 : queryObject.values) || [],
|
|
||||||
debug,
|
|
||||||
});
|
|
||||||
return Object.assign(Object.assign({}, GET_RES), { queryObject });
|
return Object.assign(Object.assign({}, GET_RES), { queryObject });
|
||||||
case "insert":
|
case "insert":
|
||||||
return yield (0, post_1.default)({
|
return yield (0, post_1.default)({
|
||||||
|
@ -2,6 +2,7 @@ import get from "../../actions/get";
|
|||||||
import post from "../../actions/post";
|
import post from "../../actions/post";
|
||||||
import sqlGenerator from "../../functions/dsql/sql/sql-generator";
|
import sqlGenerator from "../../functions/dsql/sql/sql-generator";
|
||||||
import { DsqlCrudParam, PostReturn } from "../../types";
|
import { DsqlCrudParam, PostReturn } from "../../types";
|
||||||
|
import connDbHandler from "../db/conn-db-handler";
|
||||||
|
|
||||||
export default async function dsqlCrud<
|
export default async function dsqlCrud<
|
||||||
T extends { [key: string]: any } = { [key: string]: any }
|
T extends { [key: string]: any } = { [key: string]: any }
|
||||||
@ -30,11 +31,11 @@ export default async function dsqlCrud<
|
|||||||
genObject: query,
|
genObject: query,
|
||||||
});
|
});
|
||||||
|
|
||||||
const GET_RES = await get({
|
const GET_RES = await connDbHandler(
|
||||||
query: queryObject?.string || "",
|
global.DSQL_DB_CONN,
|
||||||
queryValues: queryObject?.values || [],
|
queryObject?.string || "",
|
||||||
debug,
|
queryObject?.values || []
|
||||||
});
|
);
|
||||||
|
|
||||||
return { ...GET_RES, queryObject };
|
return { ...GET_RES, queryObject };
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/datasquirel",
|
"name": "@moduletrace/datasquirel",
|
||||||
"version": "4.1.0",
|
"version": "4.1.1",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
Loading…
Reference in New Issue
Block a user