[sqlalchemy] Re: psycopg2 default transaction inefficiency

2007-02-12 Thread JP
Yeah, I think I explained badly. What I was trying to show with the sqlalchemy vs postgres query logs is that extra BEGIN that psycopg2 is sending before the SELECT that sqlalchemy executes. The BEGIN is implicitly added by psycopg2 because it's in its default transaction isolation state of read

[sqlalchemy] Re: Adding with (nolock) to all queries (mssql)

2007-02-12 Thread Michael Bayer
On Feb 12, 4:25 am, Arnar Birgisson [EMAIL PROTECTED] wrote: Hi again, Yes, we thought that might be the case. We tried changing the isolation level on this connection to snapshot. Now I'm getting different errors, and more frequent. One error I get is this: AttributeError:

[sqlalchemy] cross DB development, columns lower/upper case letters

2007-02-12 Thread vkuznet
Hi, I'm trying to develop a cross-DB application which works with ORACLE and MySQL back-ends. Both DBs has the same schema, but of course there is a caveat. ORACLE has Tables and Columns in upper case and MySQL does not. That leads to the following problem. When I construct select(table.c.column)

[sqlalchemy] Re: Cascade-Delete causes AssertionError (Tries to blank-out primary key ...)

2007-02-12 Thread Luke Stebbing
Right, delete-orphan is what adds the lifecycle relationship between parent and child. It means that the child can't exist without a parent. That lets SA know that it should eliminate the child rather than trying to null out the relationship. You probably want all so that all actions performed

[sqlalchemy] Tracking changes on mapped entities

2007-02-12 Thread Allen Bierbaum
Is it possible to examine the session and get a list of all mapped instances that have been changed? More details: I would like to implement an observer pattern in my application. I would like to let the code make changes to mapped objects as normal, but immediately before (or after) a session

[sqlalchemy] How to determine if an instance has been populated?

2007-02-12 Thread Matt Culbreth
Hello Friends, I'm working with the latest version of SQLAlchemy now and I have a question: how do I determine if a particular mapped object instance has been populated by the database? The question originates because I have defined a __repr__() method on one of my mapped objects. It works

[sqlalchemy] Announcing Elixir!

2007-02-12 Thread Jonathan LaCour
Today, we are pleased to announce the release of Elixir (http://elixir.ematia.de), a declarative mapper for SQLAlchemy. Elixir is the successor to ActiveMapper and TurboEntity, and is a collaboration between Daniel Haus, Jonathan LaCour and Gaƫtan de Menten. Elixir's website provides

[sqlalchemy] deletion behavior question

2007-02-12 Thread iain duncan
I would like some objects that are related through many to many tables to delete the many to many entry on deletion, but NOT the endpoint. It seems that cascade=all deletes both, and no arg to cascade leaves left over invalid entries in the manytomany table. Is there a suggested way to deal with

[sqlalchemy] drop_all not working for me

2007-02-12 Thread percious
See test case: from turbogears import config from turbogears.database import metadata from turbogears import database from sqlalchemy import Table, Column, Integer, Unicode import sqlalchemy.orm config.update({sqlalchemy.dburi:sqlite:///:memory:}) database.bind_meta_data() Table('t_table',

[sqlalchemy] Re: cross DB development, columns lower/upper case letters

2007-02-12 Thread Michael Bayer
are these column names using MixedCase ? otherwise you can probably access them in a case-insensitive fashion (oracle col names are usually case-insensitive) On Feb 12, 11:35 am, vkuznet [EMAIL PROTECTED] wrote: Hi, I'm trying to develop a cross-DB application which works with ORACLE and

[sqlalchemy] Re: psycopg2 default transaction inefficiency

2007-02-12 Thread Michael Bayer
On Feb 12, 10:30 am, JP [EMAIL PROTECTED] wrote: But It would be nice to be able to have total control over the transactional state of the connection, so that when I know that I'm just doing a select or two I don't have to have the overhead of a BEGIN that I know is useless, but as things

[sqlalchemy] Re: drop_all not working for me

2007-02-12 Thread Michael Bayer
drop_all() doesnt remove Table instances from the metadata. the Table object is a python object, it only represents your real database table. you may well want to call create_all() again using that same Table. On Feb 12, 3:20 pm, percious [EMAIL PROTECTED] wrote: See test case: from

[sqlalchemy] Re: deletion behavior question

2007-02-12 Thread Michael Bayer
On Feb 12, 3:00 pm, iain duncan [EMAIL PROTECTED] wrote: I would like some objects that are related through many to many tables to delete the many to many entry on deletion, but NOT the endpoint. It seems that cascade=all deletes both, and no arg to cascade leaves left over invalid entries

[sqlalchemy] Re: drop_all not working for me

2007-02-12 Thread percious
On Feb 12, 3:49 pm, Michael Bayer [EMAIL PROTECTED] wrote: drop_all() doesnt remove Table instances from the metadata. the Table object is a python object, it only represents your real database table. you may well want to call create_all() again using that same Table. On Feb 12, 3:20

[sqlalchemy] Re: How to determine if an instance has been populated?

2007-02-12 Thread Michael Bayer
check for an _instance_key attribute. On Feb 12, 1:52 pm, Matt Culbreth [EMAIL PROTECTED] wrote: Hello Friends, I'm working with the latest version of SQLAlchemy now and I have a question: how do I determine if a particular mapped object instance has been populated by the database? The

[sqlalchemy] Re: drop_all not working for me

2007-02-12 Thread Michael Bayer
not if you understood my previous reply, no. On Feb 12, 3:55 pm, percious [EMAIL PROTECTED] wrote: On Feb 12, 3:49 pm, Michael Bayer [EMAIL PROTECTED] wrote: drop_all() doesnt remove Table instances from the metadata. the Table object is a python object, it only represents your real

[sqlalchemy] Re: How to determine if an instance has been populated?

2007-02-12 Thread Matt Culbreth
That got it, thanks. On Feb 12, 3:57 pm, Michael Bayer [EMAIL PROTECTED] wrote: check for an _instance_key attribute. On Feb 12, 1:52 pm, Matt Culbreth [EMAIL PROTECTED] wrote: Hello Friends, I'm working with the latest version of SQLAlchemy now and I have a question: how do I

[sqlalchemy] Re: cross DB development, columns lower/upper case letters

2007-02-12 Thread Michael Bayer
On Feb 12, 3:45 pm, vkuznet [EMAIL PROTECTED] wrote: No, here is real problem: schema had the following: create table Foo (int id); in MySQL it creates table 'Foo' and column 'id'. in ORACLE it creates table 'FOO' and column 'ID' That's create a problem in sqlalchemy, when I access

[sqlalchemy] schema comments

2007-02-12 Thread Sean Davis
I looked over the docs but didn't find an answer (so the answer is probably no). Does SA allow descriptions (database comments) of tables and/or columns? Thanks, Sean --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: Never-saved orphans are an error?

2007-02-12 Thread SteveTether
On Feb 10, 11:48 am, Michael Bayer [EMAIL PROTECTED] wrote: del p.children[3] basically cascade has nothing to say about this operation when applied to transient instances. the history tracking will not see the item as ever being part of the children collection since you added it then

[sqlalchemy] Re: psycopg2 default transaction inefficiency

2007-02-12 Thread JP
like the example illustrates, there is no BEGIN being issued for every SELECT statement when using psycopg2 in non-autocommit mode, which applies to SQLAlchemy as well. therefore there is no performance bottleneck; this is a django issue only. I guess we're reading the example differently.