Re: [sqlalchemy] foreign key to *any* other class?

2010-01-11 Thread Jules Stevenson
Thanks Michael, very useful. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options,

[sqlalchemy] Beware of DateTime and sqlite [Problem solved]

2010-01-11 Thread Peter
Hi This is to warn people working with sqlalchemy and sqlite and date/time columns. I know, the topic has already been discussed, but I found it difficult to relate this topic with the error messages I got when trying the following: transactions_table = Table('transactions', metadata,

[sqlalchemy] predefined,dynamic query

2010-01-11 Thread tom
hi all! i'm creating user interface for search in database, and i wondered of any of you knows how to generate query dynamically, without using 'eval ()' (slow) or 'engine.execute(my query)' (loosing flexability and efficiency - am i right?) the aim is to manage complex query (with or, and,

Re: [sqlalchemy] Sharding - same table definitions yet different (but predictable) table names... thousands of them

2010-01-11 Thread Diana Clarke
Thanks for the quick response, Michael. We are mapping the classes dynamically, and we patched an in-house copy of SQLAlchemy 0.5.6 with the stricter mutex from SQLAlchemy 0.6 to fix the sporadic mappers failed to compile errors we were seeing under production load. We also added a Least

[sqlalchemy] why query_chooser rather than shard_chooser in this case?

2010-01-11 Thread diana
Hello again, I'm getting errors in a certain case which lead me to suspect that I'm missing some big picture sharding concept, so to better understand sharding I'm playing with the SQLAlchemy sharding unit tests (sqlalchemy/test/orm/sharding/test_shard.py). Here's one of the investigative tests

RE: [sqlalchemy] Oracle, ownership and unrecognized type warnings

2010-01-11 Thread Jeff Peterson
Sorry for not getting back sooner. -- Jeffrey D Peterson Webmaster Crary Industries, Inc. -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Bayer Sent: Wednesday, January 06, 2010 1:23 PM To: sqlalchemy@googlegroups.com

Re: [sqlalchemy] why query_chooser rather than shard_chooser in this case?

2010-01-11 Thread Michael Bayer
diana wrote: Hello again, I'm getting errors in a certain case which lead me to suspect that I'm missing some big picture sharding concept, so to better understand sharding I'm playing with the SQLAlchemy sharding unit tests (sqlalchemy/test/orm/sharding/test_shard.py). Here's one of the

RE: [sqlalchemy] Oracle, ownership and unrecognized type warnings

2010-01-11 Thread Michael Bayer
Jeff Peterson wrote: its true that there's no built in functionality to reflect views. In the case of your views, just create Table instances manually, specifying the view names, column names, and column types explicitly. Set the primary_key=True flag on those columns which you'd like to

Re: [sqlalchemy] why query_chooser rather than shard_chooser in this case?

2010-01-11 Thread Diana Clarke
A, deferred (new to me), thanks! in sqlalchemy/test/orm/sharding/test_shard.py: mapper(WeatherLocation, weather_locations, properties={ 'reports':relation(Report, backref='location'), 'city': deferred(weather_locations.c.city), }) When I comment

Re: [sqlalchemy] why query_chooser rather than shard_chooser in this case?

2010-01-11 Thread Diana Clarke
Again, this investigative test is loosely based on SQLAlchemy's sharding test: sqlalchemy/test/orm/sharding/test_shard.py def test_update(self): print \n session = create_session() query = session.query(WeatherLocation) # query_chooser returns: ['asia']

RE: [sqlalchemy] Oracle, ownership and unrecognized type warnings

2010-01-11 Thread Jeff Peterson
Hmmm, must be something megrok.rdb is doing I am not seeing, I will look into it. -- Jeffrey D Peterson Webmaster Crary Industries, Inc. -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Bayer Sent: Monday, January 11, 2010

RE: [sqlalchemy] Oracle, ownership and unrecognized type warnings

2010-01-11 Thread Jeff Peterson
OK, it is definitely megrok.rdb, the last thing it does is call metadata.create_all() so, I will email the megrok folks. Thanks a bunch. -- Jeffrey D Peterson Webmaster Crary Industries, Inc. -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On

Re: [sqlalchemy] why query_chooser rather than shard_chooser in this case?

2010-01-11 Thread Michael Bayer
Diana Clarke wrote: Again, this investigative test is loosely based on SQLAlchemy's sharding test: sqlalchemy/test/orm/sharding/test_shard.py def test_update(self): print \n session = create_session() query = session.query(WeatherLocation) #

Re: [sqlalchemy] why query_chooser rather than shard_chooser in this case?

2010-01-11 Thread Diana Clarke
Thanks, Michael. This will take me a bit to digest, and I'm about to start the second shift as wife and mother... tomorrow maybe. Thanks again for the quick responses -- greatly exceeding expectations! Cheers, --diana On Mon, Jan 11, 2010 at 5:14 PM, Michael Bayer mike...@zzzcomputing.com

[sqlalchemy] pylons SQLAlchemy memory

2010-01-11 Thread diana
And now for a question about a completely different app (no sharding, very simple). I haven't got a sufficient response from the pylons group, so I'm trying here. The question: http://groups.google.com/group/pylons-discuss/browse_thread/thread/cb48d0ea2b084159 Things I've tried/considered:

Re: [sqlalchemy] pylons SQLAlchemy memory

2010-01-11 Thread Michael Bayer
diana wrote: And now for a question about a completely different app (no sharding, very simple). I haven't got a sufficient response from the pylons group, so I'm trying here. The question: http://groups.google.com/group/pylons-discuss/browse_thread/thread/cb48d0ea2b084159 Things I've

Re: [sqlalchemy] pylons SQLAlchemy memory

2010-01-11 Thread Antoine Pitrou
Le lundi 11 janvier 2010 à 15:55 -0800, diana a écrit : And now for a question about a completely different app (no sharding, very simple). I haven't got a sufficient response from the pylons group, so I'm trying here. The question:

[sqlalchemy] error handling for sessionmaker function

2010-01-11 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I'm updating some of my code to SQLALchemy 0.6, and I have noted a problem with the sessionmaker function. The problem is a compatibility one: old versions use the transactional parameter, new ones the autocommit parameter. Usually, to handle

Re: [sqlalchemy] pylons SQLAlchemy memory

2010-01-11 Thread Diana Clarke
On Mon, Jan 11, 2010 at 7:07 PM, Antoine Pitrou solip...@pitrou.net wrote: Le lundi 11 janvier 2010 à 15:55 -0800, diana a écrit : Well if you only want to count entries, use Query.count(), not Query.all(). Yup, I don't actually do this in a real app. I was just doing this (in a hello world

Re: [sqlalchemy] pylons SQLAlchemy memory

2010-01-11 Thread Michael Bayer
we have a full set of tests that ensure SQLA itself has no unreleased memory issues or excessive cycles and they've been in our trunk for several years, and we also nailed a few remaining corner cases over the past year which correspond to highly unusual usage patterns, so I'm very confident

Re: [sqlalchemy] error handling for sessionmaker function

2010-01-11 Thread jason kirtland
On Mon, Jan 11, 2010 at 4:07 PM, Manlio Perillo manlio.peri...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I'm updating some of my code to SQLALchemy 0.6, and I have noted a problem with the sessionmaker function. The problem is a compatibility one: old versions use

Re: [sqlalchemy] error handling for sessionmaker function

2010-01-11 Thread Michael Bayer
On Jan 11, 2010, at 7:07 PM, Manlio Perillo wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I'm updating some of my code to SQLALchemy 0.6, and I have noted a problem with the sessionmaker function. The problem is a compatibility one: old versions use the transactional

Re: [sqlalchemy] pylons SQLAlchemy memory

2010-01-11 Thread Diana Clarke
I never really suspected that this was a SQLAlchemy issue, which was why I didn't originally post this question to the SQLAlchemy group. I apologize if it came across that way. Time for me to do my python VM homework... My apologies, --diana On Mon, Jan 11, 2010 at 8:15 PM, Michael Bayer