On Sep 15, 2011, at 10:51 AM, Matt Bodman wrote: > Hi Michael, > > Thanks for your reply. Please be patient with me though as I don't quite get > it. > > Where and when is the add_default function called? Won't I get the same > error trying to insert 'some default' into the column? > > Any further explanation would be great.
...and, once you mark the column as having some kind of default, SQLAlchemy won't try to insert NULL into it. It's not clear here what kind of default is already on the column - though if there was one the reflection system should have gotten it. Unless its the case that a TIMESTAMP column in SQL Server is inherently "default generating"? I haven't checked. If that's the case you'd want to set server_default=FetchedValue() on each Column. Also we'd probably want to add that to the dialect on our end at some point but it's not something I've researched. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en.
