Generate schema and/or data from existing code/project?

Posts   
 
    
Posts: 5
Joined: 22-Oct-2019
# Posted on: 06-Dec-2019 23:20:20   

This is a silly question that I'm sure is easily answerable, but unfortunately I am out of my trial period with the software. We were/are evaluating a software project that uses LLBLGen Pro as the basis for creating its Data Access Layer.

We have the source code, but we're waiting a couple of weeks for the third party to produce a clean database with only information relevant to our site embedded.

Wondering if, as a way of saving time, if I can use LLBLGen projects to generate the schema/data of an implementation. i.e. Code First vs. Database First kind of concept?

Thanks for any information!

Posts: 5
Joined: 22-Oct-2019
# Posted on: 06-Dec-2019 23:25:16   

Just to be clear, I no longer (temporarily) have access to the database that was used to generate the model. My expectation/hope is that now that the models have been defined in the LLBLGen project, that they could optionally be used to generate a new set of tables from scratch that represent the models.

The end result would be a way of creating the actual databases and tables/etc. such that either I use the tool generated databases or the backups, and the application doesn't know the difference.

Thank you again for any information you can provide (meanwhile I need to get the purchase of the tool authorized).

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 07-Dec-2019 07:04:38   

Hi there!

Yes, it's possible:

  1. Use the Export DDL Create Script feature to produce a script that contains all the DB objects metadata. More info here....

  2. Use that script to create your DB.

  3. You could create a new LLBLGen project that uses that just-created DB to play around. See How to add relational model data from database for more information.

Hope that helps simple_smile

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 07-Dec-2019 13:22:28   

Also keep in mind if you have the model but not the tables in the project you can recreate them from the model using model first development: https://www.llblgen.com/Documentation/5.6/Designer/How%20To/WorkModelFirst.htm

Frans Bouma | Lead developer LLBLGen Pro
Posts: 5
Joined: 22-Oct-2019
# Posted on: 08-Dec-2019 22:42:58   

Great news! Thanks for the information, both of you! I will look to tool around with it!

Posts: 5
Joined: 22-Oct-2019
# Posted on: 10-Dec-2019 00:25:05   

So I downloaded version 5.6.1 I believe. The original project is in 5.2. Is Saving the project under the updated version a problem? (It tells me I can't go back).

Also, when I attempt to Generate the Code by Right Clicking Rleational Model Database and selecting Generate Database Schema Create Script, I get a Code Generation Task labeled as follows:

Is Enabled: Checkbox unselected Source: Database Meta-data Is Valid: a red X Specifics: Platform: RDBMS, Output Language: SQL, Framework: DDL Sql

When I try to Edit the rule, I can't set a destination folder

Based on the database meta data, I want to say it's looking for the real database, HOWEVER, I can traverse what appears to be a snapshot of the database in the project and see tables.

I was thinking about trying the older 5.2 release on this project, but was wondering if the above error had a known reason that I could troubleshoot?

Thanks for any help you can provide!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 10-Dec-2019 09:36:48   

trinetgrinch wrote:

So I downloaded version 5.6.1 I believe. The original project is in 5.2. Is Saving the project under the updated version a problem? (It tells me I can't go back).

You can load it in an older version, but it's not guaranteed to work (fileformat might change a bit) and things added in later versions are lost if you save it in the older version.

Also, when I attempt to Generate the Code by Right Clicking Rleational Model Database and selecting Generate Database Schema Create Script, I get a Code Generation Task labeled as follows:

Is Enabled: Checkbox unselected Source: Database Meta-data Is Valid: a red X Specifics: Platform: RDBMS, Output Language: SQL, Framework: DDL Sql

When I try to Edit the rule, I can't set a destination folder

You have to select the task (if there's just 1, it's automatically selected) and click the 'Edit selected task specifics' button (or double click the task). This will get you a new dialog which allow you to fill in the specifics. You clicked that button but nothing happened?

Based on the database meta data, I want to say it's looking for the real database, HOWEVER, I can traverse what appears to be a snapshot of the database in the project and see tables.

Yes in an LLBLGen Pro project you have a snapshot of the relational model data, it won't connect to the real server unless you say you want to do that (for syncing).

Frans Bouma | Lead developer LLBLGen Pro