Test data generation

There is a way of test data generation for the table in the form of the Insert construction:

Open the new object creation wizard: File -> New -> Others, select the pgCodeKeeper -> Generate test data category and click Next.

_images/mock_data_wizard.png

For each column, depending on type and generator, the following settings are available:

  • Column name - the name of current column.

  • Column type - data type of the column. For unsupported types there is the OTHER type.

  • Generator - data generation algorithm. Currently there are 4 of them:

RANDOM:

A random value from the range.

INCREMENT:

Consistent increasing of the inital value by the increment value.

CONSTANT:

A constant value. Text values will be enclosed in single quotes.

ANY:

Any value (including function calls). The value will not be formatted.

  • Range start - initial value

  • Range end - final value

  • Increment step - increment step value

  • Undefined value - unidentified value which will be written without formatting.

To manage the column list, the following buttons are available:

  • Add column adds an INTEGER type column with the RANDOM generator.

  • Delete column deletes the selected columns.

  • Up moves the selected column up in the list.

  • Down moves the selected column down in the list.

  • Delete optional deletes the columns without the NOT NULL property.

The Typcasting setting adds typecasting for each value (for example, 7::integer).

After clicking Finish you’ll see the SQL editor with a ready Insert query.

Note

This wizard may be launched from the table’s right-click menu as well. In this case, all the data is filled in automatically.

_images/mock_data_menu.png