Added support for running a database query