How to test queries

Testing Daobab queries is extremely easy.

Let's start from the basic one:

DataBaseTarget is a simple bean and you may even initialise it as a regular java class.

There is also a way to test just sql query itself.

To do this, call toSqlQuery() method at the end:

This method return a complete sql query, which normally is being sent to the database. You may check, if everything is correct and also you may check this query works as expected under the database editor:

Please note, that Daobab sql queries are consciously designed to be very clear and compatible with the original SQL we get used to have during the daily usage of database. Because of that, converting backward, from regular SQL to Daobab query is also very easy. 

If you want to find out, how query looks like on the specific database engine, you may use MockDataBase class to imitate specific DataBase target:

© Copyright 2018-2023 Elephant Software Klaudiusz Wojtkowiak 
e-mail: contact@daobab.io