Skip to content

Commit

Permalink
fix: missing sqlite query quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
xob0t committed Jun 17, 2024
1 parent 6e09d21 commit 701776d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_last_notified(goodsId, merchantId, finalPrice, bonusAmount):
job_tables = [table[0] for table in cursor.fetchall()]

# Construct a union query to select from all job tables at once
union_query = " UNION ".join([f"SELECT scraped FROM {table} WHERE notified = 1 AND goodsId = ? AND merchantId = ? AND finalPrice = ? AND bonusAmount = ?" for table in job_tables])
union_query = " UNION ".join([f"SELECT scraped FROM '{table}' WHERE notified = 1 AND goodsId = ? AND merchantId = ? AND finalPrice = ? AND bonusAmount = ?" for table in job_tables])

union_query+="ORDER BY scraped DESC LIMIT 1"

Expand Down

0 comments on commit 701776d

Please sign in to comment.