From 85ce009b1072a5a4ff932728239196d847787298 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sven-Ove=20H=C3=A4nsel?= <sven-ove.haensel@hs-hannover.de>
Date: Tue, 27 May 2025 09:08:56 +0200
Subject: [PATCH] add index to identify inserted batches

---
 scripts/pg_insert.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/pg_insert.py b/scripts/pg_insert.py
index 7e92286..aed952e 100755
--- a/scripts/pg_insert.py
+++ b/scripts/pg_insert.py
@@ -129,7 +129,12 @@ if __name__ == "__main__":
     uuid_edges = len(getenv("UUID_EDGES", "")) > 0
 
     with psycopg.connect() as connection:
+        total_batches = len(list(read_zip(file, batch_size)))
+        info(f"Total batches to process: {total_batches}")
+        batch_count = 0
         for batch in read_zip(file, batch_size):
+            print(f"Processing batch number {batch_count + 1} of {total_batches}")
+            batch_count += 1
             if interrupted:
                 break
             batch_iter = (line.replace(HEADER_SCHEMA, b"") for line in batch)
-- 
GitLab