Queries
Run queries against any data source in CAT Studio.
On this page
On Queries tab, you can run any query against any data source you defined. The page has two use-cases.
Playground
You can use queries tab as a playground, where you issue queries against your data sources and check the data you are about to test. You can give your queries names and descriptions.
Once you want to turn one of your queries into an automated test, you can use “Make it a Test” button. You then just set correct expectation, fill name, description and categorization for the test, and you are done with automation.
Metadata for Tests
CAT supports generating test from metadata. This is a huge time-saver. On Queries tab, you define the metadata query that should be used for generating tests. Add a query, give it a name and then on Tests page, create a test and set “Metadata” to your query.
You can then anywhere use syntax %NAME_OF_ONE_OF_COLUMNS_RETURNED_BY_THE_QUERY%
- CAT will automatically create a test for each row and replace these placeholders with values from the query results.
Page Structure
- Query Toolbar
- Common actions, like run a query, duplicate a query etc.
- Query Tabs
- Switch between open queries, add a new query.
- Query Editor
- Type or paste your query. No advanced intellisense or query formatting is available at the moment.
F1
reveals common actions for working with text (comment, upper-case, lower-case etc.). - Query Details
- Here you set against what data source should the query be run, name of the query and description.
- Query Results
- The results of your query. You can use advanced grid features - right click any column header to see options you have. Remember the query results are kept in memory - the editor is not yet designed to work with millions of rows. Tip: you can save your project and reload it - this way you get rid of any datasets you don’t work with. The results area also contains Messages tab, if the query returns any messages (such as
print
in MS SQL server) or errors. - Status Bar
- Statistics about the query run, such as number of returned rows.