do not access the database if it's not available

this adds checks for the successful load of the sqlite db in all syntax
modes. this avoids fatal errors when the sqlite plugin can't initialize
the database.