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:
@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user