Currently, I'm making use of db_mysql, which means that there must already be a MySQL driver installed.
If MySQL is there, the program compiles fine and runs fine.
If MySQL is not installed, the program still compiles fine but throws an error (that's on Mac):
could not load: (libmysqlclient|libmariadbclient)(|.20|.19|.18|.17|.16|.15).dylib
(compile with -d:nimDebugDlOpen for more information)
One way I've though of is compiling with different switches: so, we'll have normal compilation (with MySQL included) and -d:nomysql, where I will be checking for it throughout the code with when blocks and exclude the relevant parts.
The question is: can I perform this type of testing, when the program runs, and instead of having the program quit on error, display a nice message that "X" is not available? (when trying to use something that will need MySQL)