MSSQL & MySQL in same project

Posts   
 
    
rscott
User
Posts: 2
Joined: 12-Jun-2006
# Posted on: 12-Jun-2006 22:13:37   

Our product supports both MSSQL and MySQL databases. We'll never have the situation where both databases are used at the same time in the same install of our product. I've seen reference that to do this, one must use the Adapter approach and generate the code for both databases then use the DBGeneric for Entity's and then use the DBSpecific for saving.

A few questions:

In the Documentation under Database drivers it states this about MySQL:

No support for database defined foreign keys. Foreign key constraint meta-data defined in the database are not (yet) read by the MySql driver.

Let it be known that I'm in the research/evaluation phase and have not actually used the LLBLGen yet in a real product. Having said that, it seems that without the ability to read foreign key's that LLBLGen will be crippled when generating the code. How will it know that my User table links up to the Order table and be able to create the "Orders" field inside the UserEntity? That being the case, then using MySQL doesn't seem to be an option with LLBLGen.... or am I missing something?

Also----

Using the Adapter just seems clunky to me when compared with the SelfServicing classes. Is there no way to create an MSSQL and an MySQL project and generate the code then use them similar to how people have described using the Adapater generic classes?

Thanks in advance-

Rscott

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Jun-2006 06:55:13   

You can easily use the LLBLGen Pro designer to define the relations (Pk-Fk) between different entities.

Please refer to the LLBLGen Pro manual "Using the designer -> Adding custom relations"

Using the Adapter just seems clunky to me when compared with the SelfServicing classes. Is there no way to create an MSSQL and an MySQL project and generate the code then use them similar to how people have described using the Adapater generic classes?

Adapter is the best solution here. but if you want I think you may use 2 SelfServicing projects (one against each database), then you will have to build and use a wrapper that loads either of them according to the database used.