On Mon, Jan 11, 2010 at 11:29 PM, Rainer Döbele <[email protected]> wrote: > Thanks for the info about the case sensitivity of MySql. > > In order to maintain code portability Empire-db must ensure that table, view > and column names are treated case-insensitive. For some databases this could > mean automatically converting names to lower or upper case.
I agree that we should warn about incompatibility for eg two columns MYCOL and MyCol in one table. But I don't think a tool like empire-db should enforce any naming rules on it's users. Cheers, Francis > > Regards, > Rainer > > Francis De Brabandere wrote: >> re: Re: DBCommandExpr.orderBy(), why auto UPPER CASE, adding twice >> the same column >> >> On Mon, Jan 11, 2010 at 9:25 PM, Rainer Döbele <[email protected]> >> wrote: >> > Hi Exxos, >> > >> > here are my (personal) comments to your questions: >> > >> >> If you allow >>> DBColumnExpr.as(<String>) >> >> then please add the following signature >> >> DBCommandExpr.orderBy(<String>); >> >> otherwise there is a gap. >> > >> > Not quite. In Empire-db we always work with objects not strings. The >> "as" method creates a new column object and initializes the name >> property of that object to the string provided. You should then use >> this object rather than continue working with things. >> > In your case this means: >> > DBColumnExpr ALIAS_COL = SOME_COL.as("alias_col"); >> > cmd.select(ALIAS_COL); >> > cmd.orderBy(ALIAS_COL); >> > Otherwise we would have to provide string overloads for many more >> methods and we would loose give up compile time safety completely. >> > >> >> db.album.title.as("title") will generates the following SQL column >> name >>> "TITLE" in upper case in the SQL command... >> >> Is there any reason? >> > >> > Long time ago we decided to make it all upper case. We could have >> gone for all lower case or left casing completely - but it does not >> matter. All column, table, view etc. names are case-insensitive and >> should be treated that way. Hence this is only an issue for debugging >> and logging. But of course this is something we could talk about. >> >> This is not the case in MySQL: >> http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html >> >> Cheers, >> Francis > -- http://www.somatik.be Microsoft gives you windows, Linux gives you the whole house.
