Updates
This commit is contained in:
@@ -13,6 +13,7 @@ export default async function <
|
||||
countOnly,
|
||||
dbFullName,
|
||||
tableSchema,
|
||||
dbConfig,
|
||||
}: Omit<
|
||||
DsqlCrudParam<T>,
|
||||
"action" | "data" | "sanitize"
|
||||
@@ -56,7 +57,10 @@ export default async function <
|
||||
];
|
||||
}
|
||||
|
||||
const res = await connDbHandler(undefined, connQueries);
|
||||
const res = await connDbHandler({
|
||||
query: connQueries,
|
||||
dsqlConnOpts: { config: dbConfig },
|
||||
});
|
||||
|
||||
const parsedRes = checkArrayDepth(res, 2)
|
||||
? parseDbResults({ unparsedResults: res[0], tableSchema })
|
||||
|
||||
@@ -28,6 +28,7 @@ export default async function dsqlCrud<
|
||||
debug,
|
||||
tableSchema,
|
||||
deleteKeyValuesOperator,
|
||||
dbConfig,
|
||||
} = params;
|
||||
|
||||
const finalData = (sanitize ? sanitize({ data }) : data) as T;
|
||||
@@ -50,6 +51,7 @@ export default async function dsqlCrud<
|
||||
dbFullName,
|
||||
debug,
|
||||
tableSchema,
|
||||
dbConfig,
|
||||
});
|
||||
return INSERT_RESULT;
|
||||
|
||||
@@ -64,6 +66,7 @@ export default async function dsqlCrud<
|
||||
identifierValue: String(targetValue || targetId),
|
||||
debug,
|
||||
tableSchema,
|
||||
dbConfig,
|
||||
});
|
||||
|
||||
return UPDATE_RESULT;
|
||||
@@ -81,11 +84,11 @@ export default async function dsqlCrud<
|
||||
deleteKeyValuesOperator,
|
||||
});
|
||||
|
||||
const res = (await connDbHandler(
|
||||
undefined,
|
||||
deleteQuery?.query,
|
||||
deleteQuery?.values
|
||||
)) as PostInsertReturn;
|
||||
const res = (await connDbHandler({
|
||||
query: deleteQuery?.query,
|
||||
values: deleteQuery?.values,
|
||||
dsqlConnOpts: { config: dbConfig },
|
||||
})) as PostInsertReturn;
|
||||
|
||||
return {
|
||||
success: Boolean(res.affectedRows),
|
||||
|
||||
Reference in New Issue
Block a user