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