Re: [sqlalchemy] case sensitive Unicode and String columns

2010-04-20 Thread Chris Withers
Michael Bayer wrote: Please let me know if there's a better way! you should use TypeDecorator.load_dialect_impl(dialect), check the name of the dialect, Why the name rather than doing: if isinstance(dialect,MySQLDialect): ? then return either MSString(arguments) or

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-04-20 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: Please let me know if there's a better way! you should use TypeDecorator.load_dialect_impl(dialect), check the name of the dialect, Why the name rather than doing: if isinstance(dialect,MySQLDialect): you could do that too, though the name is

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-04-19 Thread Chris Withers
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

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-04-19 Thread Michael Bayer
On Apr 19, 2010, at 12:51 PM, Chris Withers wrote: 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

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-03-05 Thread Chris Withers
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

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-03-05 Thread Michael Bayer
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

[sqlalchemy] case sensitive Unicode and String columns

2010-03-04 Thread Chris Withers
Hi All, I'm looking to create a model with a unicode or string column type that is case sensitive. I'm looking to do this in the model in such a way that the code in the model doesn't know or care about what backend database is used, but that barfs if it's ever used with a backend that

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-03-04 Thread Daniel Robbins
On Thu, Mar 4, 2010 at 11:34 AM, Chris Withers ch...@simplistix.co.uk wrote: Hi All, I'm looking to create a model with a unicode or string column type that is case sensitive. I'm looking to do this in the model in such a way that the code in the model doesn't know or care about what

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-03-04 Thread Michael Bayer
Daniel Robbins wrote: On Thu, Mar 4, 2010 at 11:34 AM, Chris Withers ch...@simplistix.co.uk wrote: Hi All, I'm looking to create a model with a unicode or string column type that is case sensitive. I'm looking to do this in the model in such a way that the code in the model doesn't know