feat: enhance DatabaseManagerService and QueryExecuterService with timeout settings, add AxiosPlugin for HTTP requests, and update DatabasePlugin to use query method

This commit is contained in:
Boris D
2025-10-09 17:20:33 +03:00
parent 0631e99886
commit 5b30b876e5
7 changed files with 104 additions and 13 deletions

View File

@ -3,6 +3,7 @@
import "module/squel";
import "plugin/db";
import "plugin/axios";
function createSQL(id) {
return squel.select().from("test").where("id = ?", id).toString();
@ -11,13 +12,22 @@ function createSQL(id) {
async function main(input, headers) {
const sql = createSQL(input.id);
await db.execute("START TRANSACTION");
await db.query("START TRANSACTION");
// log(await db.execute('insert into test (name) values ("Test")'));
// log(await db.query('insert into test (name) values ("Test")'));
const res = await db.execute(sql);
log(new Date().toISOString());
// const a = await axios.get("https://httpbin.dev/delay/10", {
// timeout: 50000000,
// });
log(res);
// log(a);
const res = await db.query(`
SELECT SLEEP(10000);
`);
log(new Date().toISOString());
return {
response: {