On 12/17/08, Gaetan de Menten <[email protected]> wrote:
>
>  On Wed, Dec 17, 2008 at 11:10, Giovanni Marco Dall'Olio
>  <[email protected]> wrote:
>
>  > I was looking for a way to create case_sensitive columns in 
> sqlalchemy/elixir.
>  >
>  > For sqlalchemy versions earlier than 0.4.8, there it was a keyword
>  > called 'case_sensitive' that you could pass as argument when creating
>  > a new column, to declare case_sensitive behaviour.
>  >
>  > But I have found a post on sqlalchemy'list, where they say that this
>  > this behaviour has changed in sqlalchemy 0.4.8. Now all the columns
>  > that have lower case names are handled as case unsensitive fields, and
>  > the case_sensitive argument has been deprecated:
>  >
>  > - 
> http://groups.google.com/group/sqlalchemy/browse_thread/thread/d78d4118b7cca96?q=sqlalchemy+case_sensitive#32078a7edab232e5
>  >
>  > - sqlalchemy changelog:
>  > http://www.sqlalchemy.org/trac/browser/sqlalchemy/tags/rel_0_4_8/CHANGES
>  >
>  > How are case insensitive columns declared in Elixir?
>
>
> For the fields you declare manually (which are not generated by
>  Elixir), they are fowarded directly to SQLAlchemy without
>  modification. The case_sensitive argument is forwarded too (as any
>  other argument not explicitly handled by Elixir). So, basically,
>  you'll get the behavior of the underlying SA lib.

ok,
but since the case_sensitive argument has been deprecated, how do I
declare case insensitive columns with sqlalchemy >0.4.8 and elixir?
I have tried to create a table with a column which has a lowercase
name (see attached test file), but it doesn't seem to work as a
lowercase column.

>
>  > I wrote a simple test case to verify this, however, I am also not sure
>  > how a case insensitive should behave with operators like get_by and
>  > filter.
>
>
> Those are only shortcuts to the corresponding SA operations:
>
>  MyClass.get_by(name='test')
>
>  is only a shortcut for:
>
>  session.query(MyClass).filter_by(name='test').first()

Thanks. maybe it could be useful to specify this on the docstring.

>  --
>  Gaƫtan de Menten
>  http://openhex.org
>
>  >
>


-- 

My blog on bioinformatics (now in English): http://bioinfoblog.it

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to