RE: [sqlalchemy] dynamically set table_name at runtime

2011-06-21 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Cody Django Sent: 20 June 2011 19:37 To: sqlalchemy Subject: [sqlalchemy] dynamically set table_name at runtime Hello! I would like to dynamically set/change the table that is

[sqlalchemy] intersect_all vs chaining of filter

2011-06-21 Thread Eduardo
What is the best practice: to chain filters or to collect queries in a list and then apply intersect_all()? Thanks -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from

[sqlalchemy] Can't make SQLAlchemy return unicode in results of raw SQLs

2011-06-21 Thread Adam Bielański
Hello. I'm using Python 2.6, SQLAlchemy 0.7.1, MySQL 5.5 and MySQLdb 1.2.3. I'm creating engine with following connect string: mysql+mysqldb://localhost/test_1?charset=utf8sql_mode=STRICT_ALL_TABLES' and convert_unicode parameter set to True. Now when I call connection.execute(sql) I'm

Re: [sqlalchemy] Can't make SQLAlchemy return unicode in results of raw SQLs

2011-06-21 Thread Michael Bayer
On Jun 21, 2011, at 6:07 AM, Adam Bielański wrote: Hello. I'm using Python 2.6, SQLAlchemy 0.7.1, MySQL 5.5 and MySQLdb 1.2.3. I'm creating engine with following connect string: mysql+mysqldb://localhost/test_1?charset=utf8sql_mode=STRICT_ALL_TABLES' and convert_unicode parameter set

[sqlalchemy] SQLAlchemy and DBFs

2011-06-21 Thread David Marsh
I'm trying to get SQAlchemy to connect to a collection of DBFs and I'm having some difficulty. If I use pyodbc, I can connect and extract data using the following connection string: 'Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=C:\\path\\to\ \dbfs;' I'm having trouble translating

Re: [sqlalchemy] SQLAlchemy and DBFs

2011-06-21 Thread Michael Bayer
On Jun 21, 2011, at 10:25 AM, David Marsh wrote: I'm trying to get SQAlchemy to connect to a collection of DBFs and I'm having some difficulty. If I use pyodbc, I can connect and extract data using the following connection string: 'Driver={Microsoft dBASE Driver

[sqlalchemy] Read-Only Database

2011-06-21 Thread Mark Erbaugh
My program accesses a sqlite database. It only extracts data from the database, it never writes anything to it. It can also be assumed that the database is not updated by other processes. In reality, the database is completely replaced periodically by a new version, but the program can be shut

Re: [sqlalchemy] Read-Only Database

2011-06-21 Thread Sebastian Elsner
Hey, I have been using the approaches described here: http://www.mail-archive.com/sqlalchemy@googlegroups.com/msg21801.html Cheers Sebastian On 06/21/2011 05:06 PM, Mark Erbaugh wrote: My program accesses a sqlite database. It only extracts data from the database, it never writes anything

[sqlalchemy] Re: SQLAlchemy and DBFs

2011-06-21 Thread David Marsh
Thanks for the quick reply. A generic dialect like the one you mentioned would satisfy all of the use cases I personally run into when using DBFs. Having one available would certainly be handy but using the other available modules is no big deal right now. The database aspect will be hidden

[sqlalchemy] Feature request - indexes on arbitrary expressions with postgresql

2011-06-21 Thread Filip Zyzniewski - Tefnet
Hi, I got an idea today and thought that maybe SQLAlchemy could support that (copy at http://ideone.com/t42G4 ): == # Fails with Python-2.7.0 and SQLAlchemy-0.7.1 import sqlalchemy import sqlalchemy.ext.declarative Base =

Re: [sqlalchemy] Feature request - indexes on arbitrary expressions with postgresql

2011-06-21 Thread Michael Bayer
sure probably, just compile the expression through the dialect and its fine On Jun 21, 2011, at 3:28 PM, Filip Zyzniewski - Tefnet wrote: Hi, I got an idea today and thought that maybe SQLAlchemy could support that (copy at http://ideone.com/t42G4 ):

Re: [sqlalchemy] SQLAlchemy and DBFs

2011-06-21 Thread Filip Zyzniewski - Tefnet
Hi, Dnia 2011-06-21, wto o godzinie 07:25 -0700, David Marsh pisze: I'm trying to get SQAlchemy to connect to a collection of DBFs and I'm having some difficulty. If I use pyodbc, I can connect and extract data using the following connection string: 'Driver={Microsoft dBASE Driver

Re: [sqlalchemy] Feature request - indexes on arbitrary expressions with postgresql

2011-06-21 Thread Filip Zyzniewski - Tefnet
Dnia 2011-06-21, wto o godzinie 15:34 -0400, Michael Bayer pisze: sure probably, just compile the expression through the dialect and its fine Would you like me to try to come up with a patch for that? Do you think that column_property could have an optional 'index' keyword argument for this

Re: [sqlalchemy] Feature request - indexes on arbitrary expressions with postgresql

2011-06-21 Thread Michael Bayer
On Jun 21, 2011, at 3:52 PM, Filip Zyzniewski - Tefnet wrote: Dnia 2011-06-21, wto o godzinie 15:34 -0400, Michael Bayer pisze: sure probably, just compile the expression through the dialect and its fine Would you like me to try to come up with a patch for that? Do you think that

Re: [sqlalchemy] Feature request - indexes on arbitrary expressions with postgresql

2011-06-21 Thread Michael Bayer
also note you can do this stuff without a patch with the @compiles decorator, if you just need to get something done. you'd redefine compilation for CreateIndex. On Jun 21, 2011, at 3:55 PM, Michael Bayer wrote: On Jun 21, 2011, at 3:52 PM, Filip Zyzniewski - Tefnet wrote: Dnia

Re: [sqlalchemy] Feature request - indexes on arbitrary expressions with postgresql

2011-06-21 Thread Michael Bayer
On Jun 21, 2011, at 5:02 PM, Filip Zyzniewski - Tefnet wrote: Dnia 2011-06-21, wto o godzinie 15:58 -0400, Michael Bayer pisze: also note you can do this stuff without a patch with the @compiles decorator, if you just need to get something done. you'd redefine compilation for CreateIndex.

[sqlalchemy] Raising exceptions from TypeDecorator.process_bind_param()

2011-06-21 Thread anton
Hi, I'm porting sqlamp [1] to SQLAlchemy 0.7 and have some difficulties with it. One of them is raising an exception (non-DBAPI) from process_bind_param() method of classes derived from TypeDecorator. In 0.6 [2] method _handle_dbapi_exception() of engine.base.Connectable doesn't munch the

Re: [sqlalchemy] Raising exceptions from TypeDecorator.process_bind_param()

2011-06-21 Thread Michael Bayer
I added StatementError after having too often a custom type or other kind of error happen deep inside the preparation for execution with no indication what statement or parameter caused the issue.It's an enhancement, and the original exception is associated with the new one as orig. In

[sqlalchemy] Re: Raising exceptions from TypeDecorator.process_bind_param()

2011-06-21 Thread Anton
On 22 июн, 00:47, Michael Bayer mike...@zzzcomputing.com wrote: I added StatementError after having too often a custom type or other kind of error happen deep inside the preparation for execution with no indication what statement or parameter caused the issue.    It's an enhancement, and the

[sqlalchemy] A question about the Hybrid Value pattern for encrypted values

2011-06-21 Thread Roy Hyunjin Han
Hi Michael, In the documentation you state that the Hybrid Value pattern is useful for encrypted values. http://www.sqlalchemy.org/docs/orm/extensions/hybrid.html Is it possible for you to provide an example of the Hybrid Value pattern as applied to encrypted values? In my case, I want to

[sqlalchemy] Re: A question about the Hybrid Value pattern for encrypted values

2011-06-21 Thread Roy Hyunjin Han
On Jun 21, 5:55 pm, Roy Hyunjin Han starsareblueandfara...@gmail.com wrote: In the documentation you state that the Hybrid Value pattern is useful for encrypted values.http://www.sqlalchemy.org/docs/orm/extensions/hybrid.html Is it possible for you to provide an example of the Hybrid Value

Re: [sqlalchemy] A question about the Hybrid Value pattern for encrypted values

2011-06-21 Thread Michael Bayer
On Jun 21, 2011, at 7:55 PM, Roy Hyunjin Han wrote: Hi Michael, In the documentation you state that the Hybrid Value pattern is useful for encrypted values. http://www.sqlalchemy.org/docs/orm/extensions/hybrid.html Is it possible for you to provide an example of the Hybrid Value pattern