From 9f64d9e7879526ae6de1f50d0a4ea9fd72c93de0 Mon Sep 17 00:00:00 2001 From: gourav Date: Sun, 9 Aug 2026 09:23:22 +0530 Subject: [PATCH] upsert handling --- .gitignore | 3 ++- main.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f7725c5..5a64751 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .env __pycache__ -uploads/* \ No newline at end of file +uploads/* +logs \ No newline at end of file diff --git a/main.py b/main.py index 5491aab..077b99d 100644 --- a/main.py +++ b/main.py @@ -101,6 +101,7 @@ async def update_nav(data: list[dict]): query = f""" INSERT INTO nav_history ({', '.join(columns)}) VALUES %s + on conflict(amfi_code, date) do update set nav=excluded.nav """ values = [