Compare commits

..

4 commits

Author SHA1 Message Date
Pablo Martin
b1a9657d8e Updated changelog. 2022-07-26 14:31:20 +02:00
Pablo Martin
4c65bf7297 Updated version. 2022-07-26 14:30:59 +02:00
Pablo Martin
730df7b534 Merge branch 'feature/show_rows' into develop 2022-07-26 14:28:39 +02:00
Pablo Martin
51c6a932dd Number of rows obtained by each query is now printed. 2022-07-26 14:13:39 +02:00
3 changed files with 11 additions and 2 deletions

8
CHANGELOG.MD Normal file
View file

@ -0,0 +1,8 @@
# Changelog
## [0.2.0] - 2022-07-26
### Added
- Sessions will now print the number of rows obtained from each successfully executed query.
- The tool version is now printed at the beginning of each session to leave a proper trace of what was the running
version for a results file.

View file

@ -1 +1 @@
__version__ = "latest" __version__ = "0.2.0"

View file

@ -61,6 +61,7 @@ def measure_query_runtime(
cur = connection.cursor() cur = connection.cursor()
cur.execute(query_to_measure.query_string) cur.execute(query_to_measure.query_string)
rows = cur.fetchall() rows = cur.fetchall()
obtained_rows = len(rows)
print( print(
f"Query '{query_to_measure.name}' took {int(time.time() - start_time)} seconds to run." f"Query '{query_to_measure.name}' took {int(time.time() - start_time)} seconds to run and returned {obtained_rows} rows."
) )