Re: [sqlalchemy] Unable to configure Column server_default attribute when using automap

2017-02-01 Thread mike bayer
On 02/01/2017 01:54 PM, derek.mil...@spacex.com wrote: It doesn't appear that the "default" column_info field allows for anything other than a generic default. I currently have the following event handler: | @event.listens_for(Table,'column_reflect')

Re: [sqlalchemy] Unable to configure Column server_default attribute when using automap

2017-02-01 Thread derek . miller
It doesn't appear that the "default" column_info field allows for anything other than a generic default. I currently have the following event handler: @event.listens_for(Table, 'column_reflect') def _set_fetched_value_for_triggered_columns(inspector, table, column_info): if

Re: [sqlalchemy] Unable to configure Column server_default attribute when using automap

2017-02-01 Thread mike bayer
you would use the column_reflect event and set the value of the "default" in the given dictionary to be your FetchedValue object. On 01/31/2017 05:06 PM, derek.mil...@spacex.com wrote: I am attempting to reflect an existing PostgreSQL database that has triggers setting a version_num column.

[sqlalchemy] Unable to configure Column server_default attribute when using automap

2017-01-31 Thread derek . miller
I am attempting to reflect an existing PostgreSQL database that has triggers setting a version_num column. Reading the docs SQLAlchemy needs to be told the the value is a FetchedValue(), however there is no way to do this via the the "column_reflect" event handler. I also attempted to manually