I wrote the code to do this.  I can't attach a patch because I upgraded tsvn recently and the patch functionality broke.  The lines that changed in sqlite.py/reflecttable are

            (name, type, nullable, has_default, primary_key) = (row[1], row[2].upper(), not row[3], row[4], row[5])
...
            colargs= []
            if has_default:
                colargs.append(PassiveDefault('?'))
            table.append_item(schema.Column(name, coltype, primary_key = primary_key, nullable = nullable, *colargs))

It passes all the tests, but I suspect this is a bit of a grey area where the tests are concerned.  Therefore I declare this behavior to be the correct one. :)

On 7/25/06, Jonathan Ellis <[EMAIL PROTECTED]> wrote:
Looks like SA doesn't reflect defaults for sqlite tables for the excellent reason that sqlite does a piss-poor job of providing that information.  Grr.

But, sqlite _does_ indicate that _some_ default exists.  As far as I can tell, SA only really cares about the contents of a PD when it's going to create the table, and if you're reflecting we obviously don't need to worry about that.  So would it be okay to create a PassiveDefault('?') on those columns so that the appropriate executioncontext etc flags get set?


--
Jonathan Ellis
http://spyced.blogspot.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to