Sync relational model data

The LLBLGen Pro designer contains a central place where relational model data and entity model data are synchronized with each other: the Sync tab.

It is used for both synchronizing the entity model with an updated database schema in your database (Database first) as well as synchronizing your relational model data in your project with an updated entity model (Model first). In this tutorial we'll be using the latter, we'll using Sync to create a catalog, schema and tables from our entity model with one action.

Creating the relational model data using Sync

  • Start the LLBLGen Pro designer. Either use the Programs start menu, Windows search or double click the LLBLGenPro.exe in the installation folder to start the LLBLGen Pro designer.
  • To open our tutorial project, select it from the Recent Projects list on the Home Tab, or select File -> Open Project... from the main menu, or select the project from the File -> Recent Projects... menu.
  • From the menu select Project -> Sync Relational Model Data or press F5. The Sync tab opens.
  • As the project contains an empty relational model data container, there is no catalog yet and the Sync tab enlists the SQL Server element with as sync source Model. This is the default for when you add a new empty relational model data container, and also what we need, as we'll sync the SQL Server container with the entity model. In the list of Available Sync Tasks, there's one, enabled sync task created for you. To perform it, simply click the Perform Tasks.. button.
  • The Designer will now create a catalog (database) named after the project name, a schema after the group the entities are in (which is the empty group, so the default schema is created, 'dbo'), and for each entity a table. All relationships are converted to FK constraints as well. To examine what's been created, go to the Catalog explorer and navigate the tree to see which elements are created. Right-click a parent node and press Ctrl-Shift-D to open the details pane for its child nodes.
  • Additionally, Sync has created for each entity a mapping onto the table created from it. Verify this by opening an entity in its editor (Right-click the entity and select Edit...) and go to the Field Mappings tab at the bottom of the entity editor.

Next step

This relational model data is not in your database server yet. It's only in your project. In the next step we'll export the created elements as a DDL SQL script so we can create the database physically in our database server: Create DDL SQL Script.