Thread: [SQLObject] Case-(in)sensitive strings
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2005-04-04 16:54:20
|
Hello! MySQL peroforms case-insensitive comaprison and sorting when a CHAR/VARCHAR column hasn't been marked BINARY; that's in a contrast with almost all other SQL implementations that perform all operations on such columns in the case-sensitive manner. I'd like to add an attribute to the StringCol named case_sensitive and make it True by default; in _mysqlType() it will add BINARY to the column declaration. Also I think _firebirdType() and _maxdbType() can use the attribute though I am not sure about their syntax. In _postgresType() and _sybaseType() setting the attribute to False will raise an exception - these backends do not allow case-insensitive columns. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: michelts <mic...@gm...> - 2005-04-06 12:58:36
|
Hi Oleg, To use postgresql, I done a set of methods: icontains, ILIKE, etc, to use a case insensitive search... Do you think this is usefull to sqlobject? the query is like: SELECT * FROM sometable WHERE somecolumn ILIKE '%foobar%'; seeya On Apr 4, 2005 1:54 PM, Oleg Broytmann <ph...@ph...> wrote: > Hello! > > MySQL peroforms case-insensitive comaprison and sorting when a > CHAR/VARCHAR column hasn't been marked BINARY; that's in a contrast with > almost all other SQL implementations that perform all operations on such > columns in the case-sensitive manner. I'd like to add an attribute to > the StringCol named case_sensitive and make it True by default; in > _mysqlType() it will add BINARY to the column declaration. > Also I think _firebirdType() and _maxdbType() can use the attribute > though I am not sure about their syntax. > In _postgresType() and _sybaseType() setting the attribute to False > will raise an exception - these backends do not allow case-insensitive > columns. > > Oleg. > -- > Oleg Broytmann http://phd.pp.ru/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > -- Michel Thadeu Sabchuk Curitiba - Brasil |
From: Oleg B. <ph...@ph...> - 2005-04-06 13:52:23
|
On Wed, Apr 06, 2005 at 09:58:31AM -0300, michelts wrote: > To use postgresql, I done a set of methods: icontains, ILIKE, etc, to > use a case insensitive search... Do you think this is usefull to > sqlobject? This can and should be implemented regardless of the column type, I think. > On Apr 4, 2005 1:54 PM, Oleg Broytmann <ph...@ph...> wrote: > > MySQL peroforms case-insensitive comaprison and sorting when a > > CHAR/VARCHAR column hasn't been marked BINARY The problem with BINARY is thet it's too BINARY - not only columns are sorted case-sensitive, they are sorted without any regard to locales. So I changed this - I renamed the new attribute to char_binray, made default None, and only allow setting it to True for MySQL. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: michelts <mic...@gm...> - 2005-04-06 14:06:10
|
On Apr 6, 2005 10:51 AM, Oleg Broytmann <ph...@ph...> wrote: > On Wed, Apr 06, 2005 at 09:58:31AM -0300, michelts wrote: > > To use postgresql, I done a set of methods: icontains, ILIKE, etc, to > > use a case insensitive search... Do you think this is usefull to > > sqlobject? > > This can and should be implemented regardless of the column type, I > think. I will make a patch and send to you, I need to make the tests for the SQLMultipleJoin, I working on the job, on a new personal project and I having the university tests, these weeks was too exaustive to me :) Next week I will end all the unfinishied points... Thanks -- Michel Thadeu Sabchuk Curitiba - Brasil |