Check if database dir exists and create it if not
The default database URL is sqlite:///out/test.db
. However, starting for the very first time running the tool with something like ./tor-metrics-db.py --start 01-09-2021 --end 10-09-2021 --only server-descriptor
fails with
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
which is confusing as, of course, there is no database file yet given that fetching descriptors and let alone importing them has not happened yet. It's not obvious that the missing out
is the problem here.
Thus, I guess we should just create the missing directories in that case, if possible.