Added db:query_by_example unit tests
The unittests currently only cover the basic operation and a very simple
combined query. I am confident about the method, but if other often used
screnarios are met, they should be added.
Added db:query_by_example()
This function will query for a prototype in a database.