Updates
This commit is contained in:
parent
e7b7cf0314
commit
c71c1c29ca
@ -61,7 +61,7 @@ function apiPost(_a) {
|
||||
}
|
||||
results = result;
|
||||
if (error)
|
||||
throw error;
|
||||
throw new Error(error);
|
||||
let tableSchema;
|
||||
if (dbSchema) {
|
||||
const targetTable = dbSchema.tables.find((table) => table.tableName === tableName);
|
||||
|
@ -3,7 +3,9 @@ type QueryObject = {
|
||||
query: string;
|
||||
values?: (string | number | undefined)[];
|
||||
};
|
||||
type Return<ReturnType = any> = ReturnType | null;
|
||||
type Return<ReturnType = any> = ReturnType | null | {
|
||||
error: string;
|
||||
};
|
||||
/**
|
||||
* # Run Query From MySQL Connection
|
||||
* @description Run a query from a pre-existing MySQL/Mariadb Connection
|
||||
|
@ -92,7 +92,9 @@ values, debug) {
|
||||
label: "Error",
|
||||
});
|
||||
}
|
||||
return null;
|
||||
return {
|
||||
error: `Connection DB Handler Error: ${error.message}`,
|
||||
};
|
||||
}
|
||||
finally {
|
||||
conn === null || conn === void 0 ? void 0 : conn.end();
|
||||
|
@ -74,7 +74,7 @@ export default async function apiPost({
|
||||
|
||||
results = result;
|
||||
|
||||
if (error) throw error;
|
||||
if (error) throw new Error(error);
|
||||
|
||||
let tableSchema:
|
||||
| import("../../../types").DSQL_TableSchemaType
|
||||
|
@ -6,7 +6,7 @@ type QueryObject = {
|
||||
values?: (string | number | undefined)[];
|
||||
};
|
||||
|
||||
type Return<ReturnType = any> = ReturnType | null;
|
||||
type Return<ReturnType = any> = ReturnType | null | { error: string };
|
||||
|
||||
/**
|
||||
* # Run Query From MySQL Connection
|
||||
@ -96,7 +96,9 @@ export default async function connDbHandler<ReturnType = any>(
|
||||
});
|
||||
}
|
||||
|
||||
return null;
|
||||
return {
|
||||
error: `Connection DB Handler Error: ${error.message}`,
|
||||
};
|
||||
} finally {
|
||||
conn?.end();
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@moduletrace/datasquirel",
|
||||
"version": "4.4.8",
|
||||
"version": "4.4.9",
|
||||
"description": "Cloud-based SQL data management tool",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
|
Loading…
Reference in New Issue
Block a user