Chris Withers wrote:
> Michael Bayer wrote:
>>>> How do I do this?
>>> I think all databases that SQLAlchemy supports (in fact, likely all
>>> databases in use today) support case-sensitive strings by default, so
>>> I don't know if this something you'll need to worry about in your
>>> code. Maybe I am misunderstanding what you are trying to do?
>>
>> hes likely referring to case-sensitive collation support.
>>
>> Build a TypeDecorator and intercept the "dialect" in the
>> process_bind_param() method.
>
> This sounds pretty heavyweight unless I'm misunderstanding...
>
> I was hoping for something like:
>
> class MyModel(Base):
>    __tablename__ = 'foo'
>    ...
>    myfield = Column(String(50,case_sensitive=True))
>
> I know this doesn't exist, but I was hoping either it was easy to
> implement or a field type could be created that "did the right thing" no
> matter what the back end was...

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).



>
> Chris
>
> --
> Simplistix - Content Management, Batch Processing & Python Consulting
>              - http://www.simplistix.co.uk
>
> --
> 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.
>
>

-- 
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