doc: added threshold details (#15458)

This commit is contained in:
Teddy 2024-03-05 13:46:48 +01:00 committed by GitHub
parent b9e732c5cd
commit 70e1643bd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -296,11 +296,14 @@ Write you own SQL test. When writting your query you can use 2 strategies:
- `ROWS` (default): expects the query to be written as `SELECT <field>, <field> FROM <foo> WHERE <condition>`. **Note** if your query returns a large amount of rows it might cause an "Out Of Memeory" error. In this case we recoomend you to use the `COUNT` startegy.
- `COUNT`: expects the query to be written as `SELECT COUNT(<field>) FROM <foo> WHERE <condition>`.
**How to use the Threshold Parameter?**
The threshold allows you to define a limit for which you test should pass or fail - by defaut this number is 0. For example if my custom SQL query test returns 10 rows and my threshold is 5 the test will fail. If I update my threshold to 11 on my next run my test will pass.
**Properties**
* `sqlExpression`: SQL expression
* `strategy`: one of `ROWS` or `COUNT`
* `threshold`: and integer defining the threshold above which the test should fail (default to 0 if not specified)
* `threshold`: an integer defining the threshold above which the test should fail (default to 0 if not specified)
**Behavior**