[sqlalchemy] Re: Using a different set of engines for reading versus writing

2009-08-12 Thread Michael Bayer
the most APIish way to do that would be using merge(). the sneaky way would be to tap into the "connection_callable" argument that the sharded session uses.you'd have to read the source to shard.py to see what thats about. On Aug 12, 2009, at 7:13 PM, phrrn...@googlemail.com wrote: >

[sqlalchemy] Using a different set of engines for reading versus writing

2009-08-12 Thread phrrn...@googlemail.com
One of the very nice things about using SQLAlchemy is that since so much of the grunt-work is taken care of for you, it gives you the opportunity to come up with (potentially) hare-brained schemes like the one I just thought of. We would like to do reading of data with one set of logins and do wri

[sqlalchemy] Re: Adding new columns to a table

2009-08-12 Thread Nelson
Thanks! I had actually just arrived at looking at this code: class PGSchemaGenerator(compiler.SchemaGenerator): def get_column_specification(self, column, **kwargs): ...snipped... else: colspec += " " + column.type.dialect_impl (self.dialect).get_col_spec() but ha

[sqlalchemy] Re: Proper way to use case() in a filter()?

2009-08-12 Thread Randy Syring
Mike, Thank you for the reply. That looks very close to what I have. At the very least, my understanding about what I should be able to do looks correct. I will do some further testing and examination and post back with details. Thanks again. -- Randy Syrin

[sqlalchemy] Re: Adding new columns to a table

2009-08-12 Thread Michael Bayer
Nelson wrote: > > Michael, > > Looking at some usage links on the Wiki, thanks to your original link, > brought up this: > > http://www.sqlalchemy.org/trac/wiki/UsageRecipes/AutoCode > > which has this gem of informaton: > > from sqlalchemy.databases import postgres > - and - > coltypes = dict( (v

[sqlalchemy] Re: Adding new columns to a table

2009-08-12 Thread Nelson
Michael, Looking at some usage links on the Wiki, thanks to your original link, brought up this: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/AutoCode which has this gem of informaton: from sqlalchemy.databases import postgres - and - coltypes = dict( (v,k) for k,v in postgres.pg2_colspecs

[sqlalchemy] Fwd: sql soup not persisting insert

2009-08-12 Thread Lilian David
Hi, The attached script doesn't persist a sqlsoup insert. Would anyone happen to know what must be changed in the script to allow the insert to be persisted ? Thanks, Lysander This is the output: 741 lda...@macintosh:~/explore/python/sqlalchemy/04_sql_soup $ ls 04_sql_soup.py04_sql_soup.py