Added config option to run arbitrary SQL commands after connecting to a database, closes #646