Replies: 1 comment
|
There is no Build ORDER BY yourself and whitelist the direction: const direction = String(opts.direction).toUpperCase() === "DESC" ? "DESC" : "ASC"
const sql = `SELECT * FROM users
WHERE id = :id AND status = :status
ORDER BY ${connection.escapeId(opts.column)} ${direction}`
const [rows] = await connection.query(sql, { id: 14, status: "active" })
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Are there any MySQL identifiers like below like
::columnand::directionAll reactions