-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crud app v2 #15
Crud app v2 #15
Conversation
app.get('/table/:dbName/:tableName', async (req, res) => { | ||
const { dbName, tableName } = req.params; | ||
try { | ||
const [rows] = await mysqlConnection.query(`SELECT * FROM ${dbName}.${tableName}`); |
Check failure
Code scanning / SonarCloud
Database queries should not be vulnerable to injection attacks High
const placeholders = values.map(() => '?').join(', '); | ||
|
||
try { | ||
const [result] = await mysqlConnection.query(`INSERT INTO ${dbName}.${tableName} (${columns}) VALUES (${placeholders})`, values); |
Check failure
Code scanning / SonarCloud
Database queries should not be vulnerable to injection attacks High
const values = [...Object.values(data), id]; | ||
|
||
try { | ||
const [result] = await mysqlConnection.query(`UPDATE ${dbName}.${tableName} SET ${updates} WHERE id = ?`, values); |
Check failure
Code scanning / SonarCloud
Database queries should not be vulnerable to injection attacks High
const { dbName, tableName, id } = req.params; | ||
|
||
try { | ||
const [result] = await mysqlConnection.query(`DELETE FROM ${dbName}.${tableName} WHERE id = ?`, [id]); |
Check failure
Code scanning / SonarCloud
Database queries should not be vulnerable to injection attacks High
No description provided.