I am writing a system where I want my DB primary keys to be represented in
the system by a type other than an integer.  I have run into several issues
with this:

1) I tried using a TypeDecorator, but SQLAlchemy does not like this.  Seems
like the main problem is the auto_increment is not set on the column when
creating the table, but I think I ran into other issues even after making
the table by hand.  This issue was discussed here:
http://groups.google.com/group/sqlalchemy/browse_thread/thread/4b13261da8c4c932/d0b84b4c14a6645e.
However, specifying a Sequence does not solve the problem for me (I'm using
MySQL).

So, I resorted to using a straight Type, and have a couple of other
problems:

2) After session.flush() the ID is an integer, not the type returned from my
result processor.  After a query the types are correct.

3) When doing queries, filters on the ID are not passed through the bind
process, so they return no results. This broke after 0.6beta1.

I have created a test case the illustrates all of these issues here:
http://pastebin.com/CnAmptck

Thanks for any help!

  -Lenza

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