Re: [sqlalchemy] Raising on usage of attribute in SQL queries

2017-08-18 Thread Neena Parikh
Thanks all for the prompt and thorough responses! use Column subclass (class DontUseCol(Column)) then use @compiles to raise > any time this column is accessed in a SQL context We chose to follow this approach. It is a lightweight solution that works well for all of the outlined use cases,

Re: [sqlalchemy] Raising on usage of attribute in SQL queries

2017-08-17 Thread Mike Bayer
On Wed, Aug 16, 2017 at 7:35 PM, Neena Parikh wrote: > Hi there! > > I'm looking to create a helper or decorator function that will enable us to > "mark" a column or table as “unused”, and raise an error if that column or > table is queried for in SQL. There's a lot of ways

Re: [sqlalchemy] Raising on usage of attribute in SQL queries

2017-08-17 Thread Simon King
On Thu, Aug 17, 2017 at 12:35 AM, Neena Parikh wrote: > Hi there! > > I'm looking to create a helper or decorator function that will enable us to > "mark" a column or table as “unused”, and raise an error if that column or > table is queried for in SQL. > > > Context > The

[sqlalchemy] Raising on usage of attribute in SQL queries

2017-08-16 Thread Neena Parikh
Hi there! I'm looking to create a helper or decorator function that will enable us to "mark" a column or table as “unused”, and raise an error if that column or table is queried for in SQL. Context The motivation behind this is to help us catch accidental references to deleted columns in our