Karlo Lozovina wrote: > I was just wondering, why does SA quote column names that have mixed > case in them, and leaves them unquoted for lowercase column names?
Because in general SQL engines tend to be case-insensitive, that is, under most of them the query SELECT column_a, column_b FROM table is perfectly equivalent to SELECT COLUMN_A, Column_B FROM Table To preserve the case of the entities you have to quote them (for example because you have two distinct tables, "table" and "Table"): this forces the engine to take the name literally, so that the first query above is *not* equivalent to the following SELECT "column_a", "column_b" FROM "table" at least not when the "default case" used by the engine is uppercase (just imagine that the database server change every non-quoted entity name to either upper- or lower-case, and you are close to the fact :) So when SA thinks that the entity name it is handling is case sensitive (that always is when the name is "CamelCased") it put automatically put quotes around it. Hope this clarifies a little, ciao, lele. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
