'When using mssql queries in Nodejs, Can't I use it like mysql2?

I used queries very simply when used mysql2 in Nodejs.

('select * from table where A = ? AND B = ?', [val1, val2])

But I'm using mssql this time, and it seems very uncomfortable.

const result = await pool.request()
.input('input_parameter', sql.Int, req.query.input_parameter)
.query('select * from mytable where id = @input_parameter')      

})

When using the mssql module, can't I use it as simple as mysql2?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source