Re: [sqlalchemy] Re: DDL Changes through Slony

2011-09-01 Thread Michael Bayer
On Sep 1, 2011, at 9:38 PM, Arthur Kopatsy wrote: > Thanks Michael. > > I did indeed find out about this solution but that is not exactly the > perfect solution. A migration may do more that just changing the > schema (e.g. UPDATE queries or even python code to correctly transform > the data). T

[sqlalchemy] Re: DDL Changes through Slony

2011-09-01 Thread Arthur Kopatsy
Thanks Michael. I did indeed find out about this solution but that is not exactly the perfect solution. A migration may do more that just changing the schema (e.g. UPDATE queries or even python code to correctly transform the data). These sql statement do not have to go through slony. Only the DDL

Re: [sqlalchemy] use session inside the class

2011-09-01 Thread Michael Bayer
On Sep 1, 2011, at 3:06 PM, Geo wrote: > I have a self-reference table, > > class member: >id >upline_id = Column(Integer, ForeignKey('member.id')) >status > >downlines = relationship('member', > backref=backref('upline', remote_side=id)) > >

Re: [sqlalchemy] DDL Changes through Slony

2011-09-01 Thread Michael Bayer
On Sep 1, 2011, at 5:39 PM, Arthur Kopatsy wrote: > Hi, > > We are using postgresql with Slony set up for replication. The trick > is that all DDL changes must go through Slony (http://slony.info/ > documentation/1.2/ddlchanges.html) that way: > EXECUTE SCRIPT ( > FILENAME = 'path to a sql s

[sqlalchemy] use session inside the class

2011-09-01 Thread Geo
I have a self-reference table, class member: id upline_id = Column(Integer, ForeignKey('member.id')) status downlines = relationship('member', backref=backref('upline', remote_side=id)) def setUpline(self, upline_id) session = DBSe

[sqlalchemy] Question about Many to One relationship

2011-09-01 Thread Geo
I have tables which linked as a one to many relationship: user ---(one to many)---> order --(many to one)-->product Product has been populated and served as a lookup table. class User: member_id purchase_total order = relationship(Order) def add_product(self, orderO

[sqlalchemy] DDL Changes through Slony

2011-09-01 Thread Arthur Kopatsy
Hi, We are using postgresql with Slony set up for replication. The trick is that all DDL changes must go through Slony (http://slony.info/ documentation/1.2/ddlchanges.html) that way: EXECUTE SCRIPT ( FILENAME = 'path to a sql script' ) Since, I still want to leverage sqlalchemy for my migr

Re: [sqlalchemy] Bidirectional relationships with association proxies

2011-09-01 Thread Benjamin Sims
Thanks so much - I realise now that the documentation I should have been reading was: http://www.sqlalchemy.org/docs/orm/relationships.html#backref-arguments Ben On 31 August 2011 22:50, Michael Bayer wrote: > "dependency rule tried to blank out primary key" means: > > 1. A references B, B ha

Re: [sqlalchemy] any tips on balancing between performance and ease of use?

2011-09-01 Thread Krishnakant Mane
Thanks a lot. On 01/09/11 19:16, Michael Bayer wrote: I have some interest in working out ways to integrate stored procedures with SQLAlchemy though at the moment the points of integration are very rudimental.You can invoke a stored procedure, get results, and also create a "selectable" th

[sqlalchemy] Re: Caveats with sqlite in-memory databases + transactions?

2011-09-01 Thread Ben Hearsum
Ahhh, this makes so much more sense now. Thank you for your quick reply, and the links to documentation! On Sep 1, 9:48 am, Michael Bayer wrote: > you're seeing the behavior of the engine as involves a SQLite :memory: > database, which only exists in the state of one DBAPI connection at a time

Re: [sqlalchemy] Caveats with sqlite in-memory databases + transactions?

2011-09-01 Thread Michael Bayer
you're seeing the behavior of the engine as involves a SQLite :memory: database, which only exists in the state of one DBAPI connection at a time and therefore is impossible to use for testing transactional concurrency. http://www.sqlalchemy.org/docs/dialects/sqlite.html#threading-pooling-behavi

Re: [sqlalchemy] any tips on balancing between performance and ease of use?

2011-09-01 Thread Michael Bayer
I have some interest in working out ways to integrate stored procedures with SQLAlchemy though at the moment the points of integration are very rudimental. You can invoke a stored procedure, get results, and also create a "selectable" that would define the columns that come back from one (tha

[sqlalchemy] Caveats with sqlite in-memory databases + transactions?

2011-09-01 Thread Ben Hearsum
Hi all, I've been writing some tests for an application that makes use of transactions and came across a strange issue: the Transactions in my tests seemed to be committed before commit() was called. After some head scratching I reduced the problem to a minimal test case and found that everything

[sqlalchemy] any tips on balancing between performance and ease of use?

2011-09-01 Thread Krishnakant Mane
hello all, I am thinking of programming a lot of stored procedures for my postgresql based application. I would like to know if using the expression API is a way that can give me the power of sqlalchemy's eas and comfort, at the same time make use of the performance bennifits I will get from po