+ handleSql show_sql_error $ do
+ r <- case (database cfg) of
+ Nothing -> connectPostgreSQL (connection_string cfg) >>= report cfg
+
+ Just dbname -> do
+ exists <- doesFileExist dbname
+ if exists
+ then connectSqlite3 dbname >>= report cfg
+ else connectPostgreSQL (connection_string cfg) >>= report cfg