Re: [sqlalchemy] Support for CouchDB

2010-08-25 Thread Diez B. Roggisch
On Wednesday, August 25, 2010 12:26:42 Rawlins wrote: Hello Guys, Do we have support for CouchDB with SQlAlchemy? Can't seem to find much information anywhere so I'm guessing not, just thought I would check. The SQL in SQLAlchemy pretty much says it all. The whole way CouchDB and RDBMS

Re: [sqlalchemy] Model factory

2010-08-22 Thread Diez B. Roggisch
Thanks Diez and Daniel for the responses. It seems that this is the way to go, but it's not quite there yet: now I can indeed load the correct lass instance for my queries, but it seems to be restricted to inherited classes already loaded in my current module. What would like to do is being to

Re: [sqlalchemy] Model factory

2010-08-20 Thread Diez B. Roggisch
On Aug 19, 2010, at 10:39 PM, Eduardo Robles Elvira wrote: Hello everyone: This is my first post in this mailing list/group. My question is simple: is there some way to tell sqlalchemy which method should be called to instance models? Now, some background: I'm working in a project with

Re: [sqlalchemy] sqlalchemy 0.6 and mock strategy produces different SQL for postgres

2010-01-06 Thread Diez B. Roggisch
On Tuesday 05 January 2010 19:26:56 Michael Bayer wrote: On Jan 5, 2010, at 11:35 AM, Diez B. Roggisch wrote: Hi, we have a utility-script schemautil that allows us to re-create our DB based on the metadata of SA, or simply dump the generated SQL for manual inspection - the latter

[sqlalchemy] sqlalchemy 0.6 and mock strategy produces different SQL for postgres

2010-01-05 Thread Diez B. Roggisch
Hi, we have a utility-script schemautil that allows us to re-create our DB based on the metadata of SA, or simply dump the generated SQL for manual inspection - the latter is used when one writes migration scripts. Now we noticed a strange behavior: the generated SQL isn't working for

[sqlalchemy] Re: When to create new sessions?

2009-04-09 Thread Diez B. Roggisch
On Thursday 09 April 2009 05:14:36 Bobby Impollonia wrote: Now the decorator swallows exceptions silently. You have to reraise the exception after rolling back like Michael did. I believe the correct form is: Darn.. you're right of course :) Diez

[sqlalchemy] Re: When to create new sessions?

2009-04-08 Thread Diez B. Roggisch
On Wednesday 08 April 2009 05:53:12 Michael Bayer wrote: On Apr 7, 2009, at 6:07 PM, rintin...@googlemail.com wrote: Hey Everyone, I'm new to SQLAlchemy (used to using Django's ORM but need to switch) and there's just one thing I'm struggling with, which is when am I supposed to create

[sqlalchemy] Re: session close - whatfor?

2009-04-06 Thread Diez B. Roggisch
not at all, when you commit/rollback, everything in the session is expired (assuming you're on 0.5). 0.5.2 Doing a remove() at the end of a request is a good way to ensure nothing is around from the previous request but in theory its not needed. But again, I've no idea what TG does in

[sqlalchemy] Re: session close - whatfor?

2009-04-05 Thread Diez B. Roggisch
Michael Bayer schrieb: the close() will remove any objects left in the session and may help with unit tests in that the subsequent tests aren't interfered with by objects remaining from the previous test. Where is the difference between a process running several tests and one answering

[sqlalchemy] session close - whatfor?

2009-04-02 Thread Diez B. Roggisch
Hi, I've run into troubles with a TurboGears2-application that showed a difficult to track error when being integration tested - but not when the same test was run locally. Eventually I could track things down to two tests run after another - the first somehow setting up the SA session in a

[sqlalchemy] statement profiling on production

2009-02-12 Thread Diez B. Roggisch
Hi, with our old homegrown SQL-wrapping we enjoyed the possibility to time each sql-query to drill down on performance bottlenecks. This is currently not possible for us using SA. So I'd like to ask how to approach this. I found some references on the net talking about profiling in

[sqlalchemy] Re: reflection for indices, function-based indices

2009-02-03 Thread Diez B. Roggisch
Index support for Postgres was recently added to the trunk and I merged it into the reflection branch. You are welcome to check out the reflection branch and give it a go. You could do a quick check like so: import sqlalchemy as sa from sqlalchemy.engine.reflection import Inspector e =

[sqlalchemy] reflection for indices, function-based indices

2008-12-17 Thread Diez B. Roggisch
Hi, we've got some function-based indices we currently create using plain text()-calls, like this: CREATE UNIQUE INDEX users_lower_email_index ON user_db.users (lower(email)); This works, but it would be nice to stay in the SA-world even with these

[sqlalchemy] Re: Versioning

2008-09-12 Thread Diez B. Roggisch
Sam schrieb: One of the things I really liked about sqlobject was its versioning plug-in. ( http://www.sqlobject.org/Versioning.html ) Is there anything similar for sqlalchemy? A google search turned up versioned ( http://elixir.ematia.de/apidocs/elixir.ext.versioned.html ) This is a

[sqlalchemy] ProgrammingError invalidates Session

2008-09-12 Thread Diez B. Roggisch
Hi, I've got a table with a unique-constraint. And I've got an automatic transaction management via decorator in place. Now it can happen that the violation of that constraint occurs - then a ProgrammingError is raised. As the violation is non-fatal, I try to catch it, and continue. The

[sqlalchemy] complex query failing because of postgres type annotations.

2008-09-08 Thread Diez B. Roggisch
Hi, I have a rather complex query that I'd like to execute through SA on a Postgres dababase. This is the query: SELECT questions.id, questions.question, (SELECT count(attempts.id) AS count_1 FROM attempts WHERE attempts.question_id = questions.id AND attempts.is_correct = True) AS anon_1,

[sqlalchemy] Re: complex query failing because of postgres type annotations.

2008-09-08 Thread Diez B. Roggisch
Michael Bayer schrieb: On Sep 8, 2008, at 3:27 PM, Diez B. Roggisch wrote: But it fails with raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect) OperationalError: (OperationalError) unrecognized token: : ... text() treats :name as a bind

[sqlalchemy] Re: complex query failing because of postgres type annotations.

2008-09-08 Thread Diez B. Roggisch
Michael Bayer schrieb: On Sep 8, 2008, at 3:56 PM, Diez B. Roggisch wrote: This does fail with the same error - the :: isn't properly recognized. I tried to escape as you said: select([literal_column(rcount(*)\:\:float)], and_(at.c.question_id == qt.c.id

[sqlalchemy] Re: complex query failing because of postgres type annotations.

2008-09-08 Thread Diez B. Roggisch
yeah (select(x).as_scalar() / select(y).as_scalar).label('mylabel') Ah. Good. I did look for alias, and obviously found the wrong thing. Thanks, Diez --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] getting schema list

2008-09-01 Thread Diez B. Roggisch
Hi, I need to enhance sqlalchemy-migrate to consider schemas. I already wrote most of the code - just one convenience-feature is missing: the possibility to enumerate *all* schemas a certain engine has. I can do that with a bit of sql of course - yet I wonder: is there a way to accomplish

[sqlalchemy] Re: getting schema list

2008-09-01 Thread Diez B. Roggisch
Michael Bayer schrieb: not within SQLA, though you can propose this feature for sqlalchemy- migrate. schemas are a slippery topic among databases (such as on oracle, the schema is really the user who owns the tables, This is not entirely correct. Every user in oracle has a schema with