Using DQE to retrieve database schema

Posts   
 
    
Bashar
User
Posts: 108
Joined: 11-Nov-2004
# Posted on: 19-Jan-2006 09:46:04   

In an effort to extend our JCL Framework, we're thinking of creating a tool that will retrieve the database schema and make recommended changes to the database based on preset criteria. For example, create a PK here, create a relationship here, add an autoincrement field here, and so on.

This is made primarily to check the database after it has been created and before any code has been generated. This will be primarily be made to make sure the database is better compliant with the JCL Framework.

To create this tool, it is required that I read every aspect of the database schema. I attempted to use the ADO; I failed miserably disappointed . I then remembered LLBL Gen's DQE engines, and thought I could use those.

At this point in time, I have 3 questions;

  • Am I allowed to use these legally?
  • Is there any chance of you providing me with a working example. Specifically for the SQL Server?
  • Is there any other way you think this might be achieved? I'd really appreciate your input on this.

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 19-Jan-2006 10:02:43   

DQE's generate code (SQL). You need the drivers. The sourcecode is in the SDK. A licensee of LLBLGen Pro can legally use them simple_smile

THough the complete database schema is in the project. Perhaps that helps.

Frans Bouma | Lead developer LLBLGen Pro
Bashar
User
Posts: 108
Joined: 11-Nov-2004
# Posted on: 19-Jan-2006 10:17:46   

My thinking cap is NOT on today confused . You'll have to elaborate a little more.

I already have the SDK. I'm already using the Driver. But I'm unable to use the code cry . What I want to learn is how to properly utilize the RetrieveSchema function.

THough the complete database schema is in the project.

What project? smile Oh, the LLBL project. No, that doesn't really help.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 19-Jan-2006 11:36:54   

Please check the commandlinerefresher sourcecode in the extras section of the customer area. In there, in Engine.cs, you'll see how to populate a catalog. You'll get back a catalog object with the schema information.

You can then examine that through the catalog object model and if you want, produce DDL SQL to alter the schema.

Frans Bouma | Lead developer LLBLGen Pro
Bashar
User
Posts: 108
Joined: 11-Nov-2004
# Posted on: 19-Jan-2006 12:45:19   

There simply aren't good enough words for me to thank you!!! smile Brilliant, that's simply brilliant!!!