Multiple DbSpecifics, Share DbGeneric, issue w/FieldInfoProvider

Posts   
 
    
sgay
User
Posts: 53
Joined: 23-Nov-2006
# Posted on: 26-Mar-2009 13:00:50   

We would like one of our project to support various databases (MySql and Oracle to begin with) "out of the box".

Reading through the forums, it looks like this should be done by using one common DbGeneric, and multiple dedicated DbSpecifics. We have troubles generating that common DbGeneric.

By carefully setting up the databases (fields order, fields types...) we can generate almost identical DbGenerics. Only the FieldInfoProvider classes differ, more precisely the values of base.AddElementFieldInfo() maxLength, scale and precision parameters.

E.g. for an Int32 field we have - In MySql : int => 0, 0, 11 - In Oracle : NUMBER(9,0) => 22, 0, 9

For a boolean field we have - In MySql : tinyint(1) => 0, 0, 1 - In Oracle : NUMBER(1,0) => 22, 0, 1

For a "text" field we have - In MySql : text => length is 65535 - In Oracle : NCLOB => length is ... much bigger

Text fields are a good example because, no matter how much you tweak the database field definitions, it may very well be the case that database A and database B simply don't have matching max lengths.

So... we're a bit lost here. The only idea we have is to move bits of FieldInfoProvider back to DbSpecifics and somehow inject those bits back in DbGeneric... or to just plainly ignore the differences and pick one DbGeneric at random (no idea what would happen) or...

What do you think?

sgay
User
Posts: 53
Joined: 23-Nov-2006
# Posted on: 26-Mar-2009 18:50:05   

I have copied the message to General, because it seems it's more appropriate. So you can safely ignore that one...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 26-Mar-2009 20:45:24   
Frans Bouma | Lead developer LLBLGen Pro