Overview

About SB Data Generator

SB Data Generator is a simple and powerful tool to generate and populate selected tables or entire databases with realistic test data for your applications. SB Data Generator reverse your database and displays tables and columns so you can assign to them multiple data generators templates.

SB Data Generator comes with multiple generators for various types. You can create your own generators template to populate database tables with meaningful test data that meets your needs.

For more details: https://soft-builder.com/sb-data-generator/


User Interface

SB Data Generator has a simple and user-friendly interface; it consists of five main elements:

1. Toolbar located on the top of the main window and contains various buttons to perform some tasks. The toolbar is divided into different sections according to the type of action performed by the button

2. Treeview explorer that enables navigation on the project’s objects

3. Diagram area that displays the elements of the data model

4. Data model browser is an exploration module build for a full and deep exploration of the data structure extracted from a database

5. The status bar displays alerts, errors, and information about the different actions executed


Getting started

This topic provides an overview of how to use SB Data Generator to generate test data.

We recommend you to back up your database that you are going to populate before you generate the test data, so you can repeat the data generation if you are not satisfied with the results.

- To generate data, first create a new project by selecting the connection to the database you want to reverse and populate with data.

- You can create a new database connection on the new project window. You can also edit or delete an existing connection. Read the section “How to manage connections”.

- In the next step, select the tables and triggers to be imported, and then click on “Import”.

With the option “Draw All Items Diagram”, you can choose to draw the diagram “all items” after reverse engineering the database or get only the list of the tables selected above without the diagram. By default, this option is checked.

- Tables and relationships are positioned on the “All items” diagram.

- To assign a data generator template to a column, double-click on this column from the treeview or double click on its table graphic representation. This will open the table settings window. Select a generator from the multiples data generators templates available.

- Before inserting data to the live database, you can generate a preview of the data that will be inserted. You can also manipulate these data by using the query tool. To use the database sandbox Go to “Tools | Database sandbox”

- To start populating your database with test data go to “Tools | Generate test data”. You have the choice to generate test data from the virtual data or directly from assigned data generators templates.


Project Management

Creating a new project

SB Data Generator allows you to reverse engineer an existing database and get its ER diagram. You have the ability to reverse engineer a local or a remote database.

To create a new project:

1. Select “File | New Project” from the main menu:

2. In the “New Project” dialog box, select a local or remote connection to the database and then click on “Next”. You can also create a new connection by clicking the “New Connection” button (see the section Connections Management.)

3. In the next step, select the items to be imported, and then click on “Import”. You can choose whether or not to draw the Entity-Relationship diagram by checking the "Draw objects" option (Available only on the professional edition).

In the console below, the process will display a notification regarding the success or failure of the database items import.

4- Tables and relationships are positioned on the diagram (Available only on the professional edition).

Available in: Standard and Professional Editions


Saving a project

To save a project:

1. Select “File | Save” on the menu bar.

2. You can also save it with a shortcut (Ctrl+S):

Available in: Standard and Professional Editions


Opening an existing project

To open an existing project:

1. Select “File | Open Project”:

2. In the “File Open” dialog box, select a project (the file extension should be “.ERB”), and click on “Open”.

The last opened projects are accessible from the "File | Recent Projects" menu.

Available in: Standard and Professional Editions


Project properties

To display project properties:

1. Select “Project | Project properties”.

2. A window containing two tabs will appear: General and Description. You can enter your project properties and click on OK to confirm.

Available in: Standard and Professional Editions


Diagram Management

Add a new diagram

Delete a diagram

Rename a diagram

Diagram properties

Add tables/relationships to a diagram

Show/hide relationships from a diagram


Add a new diagram

To add a diagram:

1. Right-click on the diagram.

2. Click on “Add Diagram”. A new tab is added with the name “Diagram_ number of the diagram”.

You can also add it with a shortcut (Ctrl+T).

Available in: Professional Edition


Delete a diagram

To delete a diagram:

1. Right-click on the created diagram.

2. Click on “Delete Diagram”:

You can also delete it with a shortcut (Ctrl+W).

Available in: Professional Edition


Rename a diagram

To rename a diagram:

1. Right-click on the created diagram.

2. Click “Diagram properties”:

3. On the diagram properties window enter the new name then click on OK.

Available in: Professional Edition


Diagram properties

To display the diagram properties window, right-click on the diagram name or right-click from the diagram drawing area.

From the diagram properties, you can set the following options:

1. Rename the diagram

2. Display columns level: define which columns will be displayed on the tables on the diagram. You can choose between displaying all columns, primary keys, keys or no columns.

3. Display columns data types: display or hide column data types on the tables in the diagram.

4. Display relationships title: display/hide relationships titles from the diagram.

Available in: Professional Edition


Add existing tables/relationships to diagram

You can add existing tables or relationships from the other diagrams of the same project to the new diagram by using the “Add tables/relationships” feature.

To add tables/relationships:

1. Right-click on the diagram area of the new diagram and click on “Add tables/relationships”. You can also access to this feature from the main menu “Diagram | Add tables/relationships”.

2. On the displayed “Add to diagram window” select the tables/relationships you want to add to your new diagram

3. Click the “Add” button

Available in: Professional Edition


Show/hide relationships from a diagram

The show/hide relationships utility allows you to show/hide a specific or all relationships from the diagram.

1. To hide a specific relationship, right click on its graphical representation then click on “Hide relationship”.

2. To hide all relationships, go to the menu “Diagram” then click “Show/hide relationships”, or just do a right click on the diagram area, then select “Show/hide relationships”.

3. In the opened window, unselect all relationships to hide them then click “OK”

4. To display one or more relationships, go to “Diagram | Show/hide relationships” then select the relationships you want to show.

Available in: Professional Edition


Show/hide related relationships

To show or hide all related relationships of an object:

1. Right-click on “Table”.

2. Click on “Hide all related relationships” from the Contextual menu to hide all related relationships to this table, or click “Show all related relationships” to show them.

Available in: Professional Edition


Setting relationship line style

On an ER diagram, relationships are the lines that connect two objects. When you have a lot of objects connected between them on the same diagram, you may find that it is difficult to handle the straight-line relationships. To overcome this problem, SB Data Generator provides two other line styles besides the straight-line style.

To change the line style, right-click on the relationship and select the Line style you want from the pop-up menu.

This is how the relationship looks like after applying the horizontal rectilinear style:

And this is how the relationship looks like after applying the vertical rectilinear style:

Available in: Professional Edition


Add/ remove relationship point

To split a relationship line you can add multiple relationship points by simply right-clicking on the target relationship, then clicking on “Add relationship point”. Drag the created point to adjust the relationship line. Note that you can add relationship points only to a relationship with a “Straight line” style.

To remove a relationship point, right-click on the relationship line and then click “Remove relationship point”.

Available in: Professional Edition


Connections management

SB Data Generator allows you to create multiple connections to multiple DBMS. SB Data Generation supports the most popular DBMS such as Oracle, MySQL, Microsoft SQL Server, PostgreSQL, Azure SQL Database, Amazon Redshift, SQLite, and Firebird.

Creating a new connection

Editing an existing connection

Deleting an existing connection

SSL settings

Windows Authentication


Creating a new connection

To create a new connection:

  1. Go to “File | Manage connections”.

  2. Then, click “ [image] ” in the “Manage Connections” form.

  3. Fill in the required fields for a database connection.
  4. Click on “ [image] ” to complete this process.

Available in: Standard and Professional Editions


Editing an existing connection

To modify the properties of an existing connection:

  1. Select “File | Manage connections”.

  2. Select the connection that requires editing, and click on “ [image] ” in the “Manage Connections” form.

  3. Change the necessary properties of the connection, then click on “ [image] ” to apply the changes.

Available in: Standard and Professional Editions


Deleting an existing connection

To delete an existing connection:

1. Select “File | Manage connections”.

2. Then click on “ [image] ”.

3. To complete the deletion, click “Yes” in the dialog box:

Available in: Standard and Professional Editions


SSL settings

In order to adjust the SSL setting, you can open the "SSL" tab in the "Manage Connections" window when creating or modifying a connection. Then you can:

1. Specify connection settings such as certificate, key, certificate authority and encryption algorithm.

2. Click on “validate” and then “OK”.

Available in: Standard and Professional Editions


Windows Authentication

During the creation of a new connection to an MS SQL Server database, you can set one of the two authentication methods:

● SQL server authentication

1. Choose ”Server” authentication method

2. Fill in the user name and the password of your database

● Windows authentication

If you use windows authentication as the default authentication method in your SQL Server, then choose “Windows” while creating a new connection to your SQL Server database.

Available in: Standard and Professional Editions


Assign data generators

SB Data Generator provides multiple predefined generators for generating realistic data to populate a connected database.

  1. First, open the “Table” form by double-clicking on the table graphic. You can also open the table from the treeview panel.

  2. In this tab, you can assign a data generator for each column. The following generators are available:

● Constant value: Generates a constant value for the selected column.

● Dictionary: Allows you to create different values for the selected column. You can use an existing data dictionary or add a new one. To add a new data dictionary, see the section “Add a new data dictionary” .

● Random generate: Generates random data between the minimum and maximum value that you specify.

● Random via a mask: Generates random values structured according to a mask.

● Sequence generate: Generates a sequence from the start value to the finish value that you specify. You can also set a step value; otherwise, the step value will be automatically set to 1. Notice that when the data type is DATE, the step value is defined in terms of days, weeks, months, or years. This generator is recommended for all auto-increment or serial data types.

● Set null: Sets all column values to null.

Available in: Standard and Professional Editions


Add a new dictionary

With SB Data generator, you can to create, save, and use your own data generators instead of using the predefined generators.

To add a new dictionary, follow these steps:

  1. Open the table form by double-clicking on the table graphic.
  2. Under the “Data generation” tab, select the generator “Dictionary” and Click on [image] to add a new dictionary. Note that the column must have a string data type.
  3. Browse to your data file (*.txt) and open it, and then select the category of your new dictionary or create a new category. Finally, name your dictionary, and click the “Add” button.

Note: The dictionary file to load must be a text file (*.txt), and the values must be separated by line breaks.

Available in: Standard and Professional Editions


Working with database sandbox

Virtual test data are data that are not persistent in a database. These data are stored only in memory and are used to:

– Validate a data model by manipulating and querying the data in a database sandbox.

– Generate test data.

● To populate the database sandbox: You can fill in the database sandbox with virtual test data manually, or you can populate the grid automatically by simply defining the number of rows to create then click on “populate” button. Note that you must assign data generators to the columns before start using the sandbox (see the section “Assign Data Generators” ).

– To populate the database sandbox grid automatically:

1. Open the “Database sandbox” form by clicking on “Tools | Database sandbox”. On the “Data” tab select the column that you want to fill in with virtual test data. You need to set the number of rows that you want to populate in the grid.

2. Then, click the populate button [image] .

You can delete all populated data by clicking the delete button [image]. You can also add, edit, or delete a single row.

– To populate the database sandbox manually:

Use the toolbar buttons to manually fill in the grid. You can also edit or delete an existing row.

Note: If you fill in data manually, be careful when the data type is serial or auto-increment; you need to respect the sequencing rule. If you insert random data, an issue can arise when you generate persistent data from database sandbox to your database.

● To view virtual data:

You can display the data as a grid or as a form. To switch the view, click the Grid View button [image] or the Form View button [image] at the bottom.

Button | Description
 | Add record: Fill in a new record manually.
 | Delete record: Delete any selected record(s).
 | Edit records: Edit an existing record.
 | Apply changes: Apply the changes made to a record.
 | Discard changes: Cancel all edits made to a record.
 | Set the number of rows: Set the number of rows that you want to populate in the grid.
 | Populate the grid: Populate the grid using the data generators.
 | Clear the grid: Clear all existing data in the grid.
 | First record: Move to the first record.
 | Last record: Move to the last record.
 | Next record: Move to the next record.
 | Previous record: Move to the previous record.
 | Grid view: Switch to grid view.
 | Form view: Switch to form view.
 | Import from CSV: import data from files in CSV format
 | Export to CSV: export data to files in CSV format

● To query virtual data:

You can manipulate virtual data by using the query tool, accessed by clicking the “Query” tab.

Use the toolbar buttons to do the following:

Button | Description
 | Open a saved SQL query
 | Save an SQL query
 | Execute an SQL query
 | Navigate to the previous query
 | Navigate to the next query
 | First record: Move to the first record.
 | Last record: Move to the last record.
 | Next record: Move to the next record.
 | Previous record: Move to the previous record.

Available in: Standard and Professional Editions


Generate test data

This topic describes how use SB Data Generator to populate a database with realistic test data. It is recommended to save a copy of the database that you are going to fill with data before generating data, so you can go back if you are not satisfied with the results.

  1. First, navigate to “Tools | Generate test data”.
  2. In the data generation window, you have the choice to generate data from:

● Database sandbox: The test data on the database sandbox will be inserted into the connected database. To use this option, you must already have test data filled in the database sandbox. (See the section “Working with database sandbox”.)

● Generators: SB Data Generator will generate data using the generators specified previously (see the section “Assign Data Generators” ). In this case, you need to set the number of rows to generate.

  3. Specify a connection to the database, and click “Connect” to test it. If the connection is successful, you can click the “Next” button; otherwise, review your connection configuration by going to “File | Manage Connections” (or [Ctrl+Alt+c]). (See the section “Connections management”).
  4. Check “Disable triggers” if you want to disable the triggers while the data are inserted to the database

In the next window, select the tables that you want to populate with test data, and click the “Start” button. If you generate data from “Generators” you have the possibility to customize the number of rows generated for each table.

When the data generation is finished, you can check to see whether the data were successfully inserted into your database by going to the status bar under the diagram area.

Note:

● For some data types, the only generator possible is “Set null”, which means that the generation of these data types is not supported.

● For columns with an auto-increment or sequence data type (for example, SERIAL in PostgreSQL or auto-increment in MySQL), data generation will not be possible because of the nature of these data types. The DBMS will automatically generate these data.

● In the case of a reflexive relationship and a primary key with an auto-increment or sequence data type, the generated data for the foreign key will be set to null.

Available in: Standard and Professional Editions


Data model browser

The main purpose of the Data model browser module is to allow a full exploration of the data structure extracted from your database.

By default, the “Data model browser” is full width mode. You can turn the data model browser on a floating mode by clicking on the “reduce” button as shown on the following screenshot (Available only on the professional edition).

Available in: Standard and Professional Editions


Elements of the data model browser

The Previous/Next buttons allow the navigation up and down on your exploration process.

Search and select a table to explore.

Open the table details form to edit the selected table.

The number of related ‘parents’ tables.

The number of related ‘child’ tables.

The ‘display objects’ filter allows you to show in the grid all tables, parents and children, parents, or children tables.

The search box allows you to find and select any table in the grid.

Displays a form allowing for more flexible search capabilities. Read how to use the advanced search form .

Allows you to reset and clear all the filters entered.

The table’s grid

To explore a specific table, right click on that table name and click on "Explore". You can also open the “Table” details form by double-clicking on it.

By default all the model’s tables are listed on the grid.

For each table, the following fields are displayed:

· Table Name

· The number of related parent tables.

· The number of related children tables.

· Schema Name

It is possible to drag and drop tables from the table’s grid to the Diagram area in order to build new customized diagrams. You must reduce the data model browser to show the diagram area (Available only on the professional edition).

The area below the grid is composed of two tabs, which are “Relationships” and “In diagram” tab.

· Relationships tab: All the relationships between the table to explore and the selected table are displayed in this list. Double click on the relationship’s name to open the “Relationship” details form.

· In diagram tab: all the diagrams where the selected table exists are displayed in this list. Double click on the diagram’s name to select the related table on this “diagram” (you must reduce the data model browser to use this feature)

· Hide objects in diagram: by checking the “Hide objects in diagram” checkbox, the tables present in the current diagram are hidden from the tables grid (Available only on the professional edition).

Available in: Standard and Professional Editions


Using the advanced filters

The advanced search feature allows more flexible search capabilities. The advanced search form consists of two sections:

· The Left section includes a range of filters fields, including table caption, schema name, parent count, child count, description and comment. This section is divided into two tabs, the “All” tab which contain the filter fields and the “Searched” tab that contain all the filters applied for this search.

Field Order: allows you to order the fields by logical or alphabetic order.

· The right section is also divided into two tabs; the “By Value” tab allows you to enter the field value that can be searched by exact match, partial match at beginning, or partial match anywhere. The second tab “By Range” allows a search by range value for the specified field in the left section.

View summary: The “view Summary” button displays a summary of the filters applied to a search.

New search: The “New Search” button allows you to reset and clear all the filters entered.

Available in: Professional Edition


Options management

A number of options are available for customizing your project. The options window is accessed via “Tools | Options”. You can also open the options window from the toolbar:

  1. A window will appear which contains four tabs. Each one has a specific option:

Available in: Standard and Professional Editions


General tab

This tab contains two sections: Display and Environment

● Display: In this section, you can choose a theme from the list of themes:

You can also change the style of the icons (Flat or Classic) as well as their size (32x32 or 16x16):

● Environment: In this section, you can load the last project you worked on upon launching the software. You can also change the working directory by opening a file and opening a dialog box to select the directory. You also have the option to change the default DBMS by selecting a DBMS from the list:

Available in: Standard and Professional Editions


Diagram tab

In this section, you can change the background color of a diagram, display table shadows or even change the diagram notation.

Diagram notation: You can change the diagram notation and choose between Relational, IDEF1X, Conceptual (Crow’s foot) and CODASYL. To do so:

1. Go to “diagram notation” by clicking on “Tools | Options | Diagrams”.

2. Choose your favorite notation from the “Diagram Notation” combo box.

Show grid: Check this option to show/hide the grid in the diagram area.

Snap to grid: Align objects created in the diagram area to the grid.

Available in: Professional Edition


Tables tab

In this section, you can change the properties of a table.

● Display Column Level: You can change the properties of the columns to display in the tables by selecting the following values: All attributes, Primary keys, Keys, No attributes.

● Auto size: To adjust the size with the table contents in the diagram, check the Auto size tables option.

● Display footer: To display a footer containing the number of columns in the table representation on a diagram.

● Display data types: To display data types in the tables, check the Display data types option.

● Display schema: To display the schema name in the tables, check the Display Schema option.

● Default title font: To change the title style of the table in the diagram, click on the table_1 button to display a window that contains a list of fonts, sizes, styles, effects, colors, and scripts.

● Default body font: To change the styles of the attributes table displayed in the diagram, click on the ID INTEGER button to display a window containing a list of fonts, sizes, styles, effects, colors, and scripts.

● Default title background color: This option allows you to change the color of the table header title in the diagram by selecting a color from the window displayed after clicking on the button:

● Default body background-color: This option allows you to change the color of the table body in the diagram by selecting a color from the window displayed after clicking on the button:

● Date: This option allows you to change the date format and the date separator.

Available in: Professional Edition


Relationships tab

In this section, you can change the properties of relationships:

● Displaying information: You can select the title of the relationship to display it in the diagram. The title values to display include Caption, Name, and Constraint Name.

● Displaying title: To display the relationship name in the diagram, check the “Display Title” option.

● Default color: You can change the color of the relationship by clicking on the button and selecting the color:

Available in: Professional Edition