import time import config from connectors import mysql logger = config.logger def main() -> None: connection = mysql.get_mysql_connection() with connection.cursor() as cursor: now = time.time() tables = [ "accountingflat.TEMP_dig_sales_processed", "accountingflat.TEMP_dig_sales_statements", ] for table in tables: sql = f"SELECT COUNT(*) FROM {table};" cursor.execute(sql) post_query = time.time() logger.info(f"Query time for {sql} is {post_query - now}\n") result = cursor.fetchone() logger.info(f"Result: {result}") if connection.show_warnings(): logger.warning(f"Warnings: {connection.show_warnings()}") connection.close() if __name__ == "__main__": main()