[sqlalchemy] how do i take advantage of sqlite manifest typing / type affinity using sqlalchemy?

2010-06-15 Thread Harry Percival
Not sure what the etiquette is re cross-posting to this list from stackoverflow? here's my question: http://stackoverflow.com/questions/3044518/how-do-i-take-advantage-of-sqlite-manifest-typing-type-affinity-using-sqlalchem I like the idea of sqlite's manifest typing / type affinity:

Re: [sqlalchemy] how do i take advantage of sqlite manifest typing / type affinity using sqlalchemy?

2010-06-15 Thread Michael Bayer
On Jun 15, 2010, at 7:14 AM, Harry Percival wrote: Not sure what the etiquette is re cross-posting to this list from stackoverflow? here's my question: http://stackoverflow.com/questions/3044518/how-do-i-take-advantage-of-sqlite-manifest-typing-type-affinity-using-sqlalchem AFAIK this

Re: [sqlalchemy] how do i take advantage of sqlite manifest typing / type affinity using sqlalchemy?

2010-06-15 Thread Harry Percival
Answered my own question: Define a custom column type, as per http://www.sqlalchemy.org/docs/reference/sqlalchemy/types.html#custom-types a combination of the documentation and some trial error have given me this: class MyDuckType(sqlalchemy.types.TypeDecorator): SQLALchemy custom

Re: [sqlalchemy] how do i take advantage of sqlite manifest typing / type affinity using sqlalchemy?

2010-06-15 Thread Harry Percival
Thanks Michael - i've seen others complain about the arbitrary-precision numbers issue... I'm not so bothered by that, but i do like the ability to natively store integers and strings in the same column. On Tue, Jun 15, 2010 at 4:40 PM, Harry Percival harry.perci...@gmail.comwrote: Answered my