diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-08-21 15:14:07 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-08-21 15:15:03 -0700 |
| commit | 77d6eedd24ba8112c2a598189cd733ab0af6a235 (patch) | |
| tree | 37495b8372b6db149a5ea9e0b7c99bf7956982c5 /sql | |
| parent | c9ea489c468c1feba35e0175a2fddd7867b5eb26 (diff) | |
add recovery script for filling backlog of missing datapoints
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/pg_handler.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/pg_handler.py b/sql/pg_handler.py index 68ce82c..a010407 100644 --- a/sql/pg_handler.py +++ b/sql/pg_handler.py @@ -143,8 +143,13 @@ class PostgresHandler: cursor.execute(query) else: cursor.execute(query, data) - result = cursor.fetchall() - return result + query_type = query.strip().upper().split()[0] + if query_type == 'SELECT': + result = cursor.fetchall() + return result + else: + self._connection.commit() + return True except Error as e: self._connection.rollback() print(f"Failed to execute query: {query}") |
