So far, each DB access uses a new connection. This is slow. The standard approach, instead, is to us a connection pool.
Figure out how to set up such a connection pool and how to use it. Note: For the command-line version of the application, connection pooling does not make much sense, as the application is started anew for each request. However, the pool will become more sensible once the web interface is in place.
A connection pool is properly initialised when the application starts.
The pool is used in each DB access.
The pool is passed to the appropriate place via the ReaderT config.
So far, each DB access uses a new connection. This is slow. The standard approach, instead, is to us a connection pool.
Figure out how to set up such a connection pool and how to use it. Note: For the command-line version of the application, connection pooling does not make much sense, as the application is started anew for each request. However, the pool will become more sensible once the web interface is in place.