Syntax 2.0


NBi was created in 2012 (as a New Year’s resolution) and is supporting the same syntax in the last six years. Unfortunately, I made some poor decisions during the design of a few features. That’s the problem when you’re working on your free time: it’s not always possible to be smart when it’s 1.00AM or when you’ve been interrupted ten times by your daughters, your wife or sport at TV during the last 30 minutes :-) Anyway, it starts to be cumbersome to go forward and to make improvements to the tool without fixing these design issues. To fix these issues, some of the xml elements will need to be changed. On the long-term, some of the syntaxes currently supported by NBi will not work anymore but we hope that the new syntax will be more user-friendly.

PascalCase vs dashes

Some of the names of the xml elements are written in Pascal-case and not with dashes between words. This will be adapted along the way to the release 2.0 Until this moment both syntaxes will be supported. The current status is visible in this issue

execution replaced by result-set

The system-under-test execution was a bit ambiguous, sometimes used for performance or successfulness of a query/ETL and sometimes for the result-set of a query. The new syntax will clarify this by introducing the system-under-test result-set.

This result-set can be defined in different way.

Inline definition

The most straightforward is to define rows and cells inline.

<result-set>
  <row>
    <cell>Canada</cell>
    <cell>130</cell>
  </row>
  <row>
    <cell>Belgium</cell>
    <cell>45</cell>
  </row>
</result-set>

External definition

You can also refer to an external CSV file:

<result-set file="myFile.csv"/>

the filename can be dynamically evaulated based on a variable (formatting). To enable this featureou must precede the filename by a tilt ~ and mix static part of the filename with dynamic part. The dynamic part must be contained between curly barces {} and start by the variable name to consider.

<result-set file="File_{@myVar}.csv"/>

In case the variable is a numeric or dateTime, it can be useful to format it. This formatting must be specified after a column (:).

<result-set file="File_{@myDate:yyyy}_{@myDate:MM}.csv"/>

The formatting syntax is the one supported by .Net and explained in MSDN for the numerics and dateTimes

Query-based definition

Naturally, all the queries defined here under can take advantage of all features: parameters, template-variables, timeout for the old syntax of a query.

Inline query

This query can be sourced from an inline definition

<result-set>
  <query>
    select * from myTable
  </query>
<result-set>

Query defined in an external file

<result-set>
  <query file="myQuery.sql"/>
<result-set>

Query defined in an assembly’s method

More info about assembly

<result-set>
  <query>
    <assembly ...>
  <query>
<result-set>

Query defined in a report (SQL Server Reporting Server)

More info about report

<result-set>
  <query>
    <report ...>
  <query>
<result-set>

Query defined in a shared dataset (SQL Server Reporting Server)

More info about shared-dataset

<result-set>
  <query>
    <shared-dataset ...>
  <query>
<result-set>

Alterations

You can also define an alteration to the result-set. For the moment, three kinds of alterations are supported by NBi:

<result-set>
  <query>
    ...
  <query>
  <alteration>
    <filter ...>
  </alteration>
<result-set>
Back
Next