|
|
|
|
|
by lowsong
109 days ago
|
|
Parameterized queries have been a thing for decades, which mitigate SQL injection attacks.[1] This is true of the examples in the post too, they used this: query = """
SELECT * from tasks
WHERE id = $1
AND state = $2
FOR UPDATE SKIP LOCKED
"""
rec = await self.db.fetchone(query=query, args=[task_id, TaskState.PENDING], connection=connection)
[1] https://en.wikipedia.org/wiki/SQL_injection#Parameterized_st... |
|