Michael Bayer wrote:
the MySQL string types support MySQL's "collation" flags so you can get
close to it for at least that platform.  But then you aren't platform
independent.

Not sure why you're so averse to creating types.   The interface could not
be simpler.   When i used Hibernate, there was no option - you had to make
types for pretty much anything non-trivial (like oracle BLOBs and such).

This is what I've ended up with:

from sqlalchemy import types
from sqlalchemy.databases.mysql import MSString

class CaseSensitiveUnicode(types.TypeDecorator):
    """This is a unicode case sensitive field"""

    impl = types.Unicode

    def get_col_spec(self):
        if isinstance(self.impl,MSString):
            self.impl.collation='utf8_bin'
        return self.impl.get_col_spec()

Please let me know if there's a better way!

Chris

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to