[sqlalchemy] finding table/column name of unique constraint failure

2013-05-19 Thread lars van gemerden
Hi all, I generate webpages in which end-users can input data that is stored in a database via sqla.The datamodel is not pre-defined but created by (other) users/designers. My question is how can i best let the end-user know which field contains the error if the end-user violates a unique

Re: [sqlalchemy] Working with stored procedures

2013-05-19 Thread Michael Bayer
On May 19, 2013, at 8:53 AM, Charlie Clark charlie.cl...@clark-consulting.eu wrote: Hi, I have created a stored procedure on a MySQL database to create a pivot table. To reduce network traffic the procedure generates some SQL and then executes a statement. It has no return value. I have

Re: [sqlalchemy] Working with stored procedures

2013-05-19 Thread Charlie Clark
Am 19.05.2013, 17:09 Uhr, schrieb Michael Bayer mike...@zzzcomputing.com: you want to pull a DBAPI cursor from SQLAlchemy's notion of the DBAPI connection, like this: dbapi_conn = session.connection().connection cursor = dbapi_conn.cursor() Thanks for explaining the nested connection stuff.

Re: [sqlalchemy] finding table/column name of unique constraint failure

2013-05-19 Thread Michael Bayer
On May 19, 2013, at 4:39 AM, lars van gemerden l...@rational-it.com wrote: Hi all, I generate webpages in which end-users can input data that is stored in a database via sqla.The datamodel is not pre-defined but created by (other) users/designers. My question is how can i best let

Re: [sqlalchemy] Working with stored procedures

2013-05-19 Thread Michael Bayer
On May 19, 2013, at 12:57 PM, Charlie Clark charlie.cl...@clark-consulting.eu wrote: Am 19.05.2013, 17:09 Uhr, schrieb Michael Bayer mike...@zzzcomputing.com: you want to pull a DBAPI cursor from SQLAlchemy's notion of the DBAPI connection, like this: dbapi_conn =

Re: [sqlalchemy] Fun with Macros: PINQ to SQLAlchemy

2013-05-19 Thread Michael Bayer
On May 17, 2013, at 9:37 AM, Haoyi Li haoyi...@gmail.com wrote: Hey All, I asked a few questions here a while ago to get help on a project, and thought it might be interesting to share the result of that project. PINQ to SQLAlchemy is a shameless clone of .NET's LINQ to SQL, using

Re: [sqlalchemy] How to close database connection of a session?

2013-05-19 Thread Michael Bayer
On May 17, 2013, at 7:59 AM, Bozhidar Cherkezov bozhidar...@gmail.com wrote: Is session.bind.dispose() the same as Engine.dispose()? I'm asking that because the docs says A new connection pool is created immediately after the old one has been disposed, so you are destroying all

Re: [sqlalchemy] Fun with Macros: PINQ to SQLAlchemy

2013-05-19 Thread Haoyi Li
Currently our custom import loader scans modules for top level from aaa.bbb.ccc import macros, ddd, eee, ... before passing them through our macro expander; hopefully not too many other people will put macros first in the list in an import-from statement =D. With only in-band signalling at our