Checking that the datastore releases a client

If we can't connect to the database, we should release the client
immediately.
Wrote tests for query

The datastore is starting to query.