@louis88 had been playing around with GitHub's Copilot and @mahdiyari's [public HafSQL database](https://peakd.com/hive-139531/@mahdiyari/public-hafsql-database-on-haf) to figure out [the retention rate and general efficiency of onboarding programs](https://peakd.com/hive-139531/@louis88/inleo-referred-user-check), which I watched him stream on Discord.
This made me want to create a hafsql version of the hive_tx_to_csv script using the same tools. After a lot of prompting the AI, waiting for results and test-runs, and fixing quite a lot of ridiculous mistakes, I ended up with a [working version](https://github.com/pharesim/hive_tx_to_csv/blob/main/hive_tx_to_csv_hafsql.py).

The big benefit of using SQL is that it's a lot faster. Get a whole year's report in a matter of seconds or minutes.
The downside is that it relies on the availability of trustworthy public SQL nodes.
Both scripts are kept up-to-date (just added HBD interest payments for example), choose what suits your needs best.