Skip to content

when we call stored procedure it gives a response to every second request #150

@VijalPatel

Description

@VijalPatel

I am calling stored procedure using mysql client and I am getting responses on every second request.
Please check below code and response.

import { Client } from "https://deno.land/x/mysql@v2.6.1/mod.ts";
import Dex from "https://deno.land/x/dex/mod.ts";

const database = "mysql";
let dex = Dex({ client: database });

const client = await new Client().connect({
  hostname: "localhost",
  username: "app",
  password: "123456",
  db: "test_db"
});

var query = dex.raw(" CALL test_getDataUsingSP(?, ?, ?, ?); ", [objParam.fromDate, objParam.toDate, objParam.loggedUserId, objParam.userTypeId]).toString();
const response: any = await client.query(query);
console.log(query)
console.log("response length : ", response.length)

Below are the response we got.

CALL APP_getDashboardInspection('2023-01-30', '2023-02-05', 3, 23);
response length :  3
POST /api/getDataUsingSP :- 361ms
 CALL test_getDataUsingSP('2023-01-30', '2023-02-05', 3, 23);
response length :  undefined
POST /api/getDataUsingSP :- 10ms
 CALL test_getDataUsingSP('2023-01-30', '2023-02-05', 3, 23);
response length :  3
POST /api/getDataUsingSP :- 3ms
 CALL test_getDataUsingSP('2023-01-30', '2023-02-05', 3, 23);
response length :  undefined
POST /api/getDataUsingSP :- 1ms
 CALL test_getDataUsingSP('2023-01-30', '2023-02-05', 3, 23);
response length :  3
POST /api/getDataUsingSP :- 2ms
 CALL test_getDataUsingSP('2023-01-30', '2023-02-05', 3, 23);
response length :  undefined
POST /api/getDataUsingSP :- 1ms

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions