On Oct 7, 2010, at 9:21 PM, Taavi Burns wrote:

> We use reflection to generate base declarative class definitions of
> our tables, and I'm working on porting from SQLAlchemy 0.5 to 0.6.
> TIMESTAMP column reflection was quite a bit fishy in 0.5, and is
> overall better in 0.6.  Still, I found a bug while roundtripping(*)
> the whole shebang.  Looks like a typo in the MySQL dialect regexp. :)
> 
> https://bitbucket.org/taavi_burns/sqlalchemy/changeset/73d2d5673e01

yeah theres a ticket you placed for that right ?    There's no issue with the 
patch.



> 
> I think there's also a glitch in TINYINT(1) handling, which the docs
> say should come out as a Boolean().  Except that the docs also say
> that 0.6 tries to return the most specific type available, which
> should be TINYINT(1) and not Boolean(); so I'm not sure which is more
> "correct". :)  Right now I've got our code looking for TINYINT(1)
> specifically and forcing to Boolean(), because I know that's what we
> want.

I will be blunt and just say that the TINYINT/boolean on MySQL ordeal is just a 
shitshow.   We get requests to change it back and forth.   Nobody can agree on 
the intention of the TINYINT type in MySQL since MySQL's docs themselves are 
ambiguous here.   At some point, as I've mentioned in other threads here, we 
will have to add the ability to control type mapping when reflection occurs.



> 
> 
> (*) Because I'm paranoid, I've got tests that:
> 1. Issue a CREATE TABLE, then SHOW CREATE TABLE and save the output
> 2. Get SQLA to reflect that table, drop it, re-create from SQLA, and
> SHOW CREATE TABLE again
> 3. Generate the base declarative class, exec that code, drop the
> table, create it from the base declarative, and SHOW CREATE TABLE a
> third time
> 4. Make sure all 3 SHOW CREATE TABLE statements are identical. :)
> 
> It's a lot of work, but I'm now much more confident that the schema we
> think we're using is the one we're actually using.
> 
> Thanks!
> 
> -- 
> 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