Ensure database set up always
Modify test to run query with db not explicitly set
Merge pull request #197 from kendru/issue176

Correct issue #176: Ensure database setup before building select