[sqlalchemy] Re: DDL Changes through Slony

2011-09-02 Thread Arthur Kopatsy
of the mock output to a tmp file and (2) a migrate_engine.execute('EXECUTE SCRIPT') Arthur On Sep 1, 6:52 pm, Michael Bayer mike...@zzzcomputing.com wrote: 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

[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

[sqlalchemy] Re: DDL Changes through Slony

2011-09-01 Thread Arthur Kopatsy
. Arthur On Sep 1, 6:25 pm, Michael Bayer mike...@zzzcomputing.com wrote: 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

[sqlalchemy] Re: Occasional ProgrammingError in threaded environment

2011-07-20 Thread Arthur Kopatsy
Hi Michael, I indeed had a object hanging around and being shared across threads... Thanks for the hint, you saved my week! Arthur On Jul 20, 6:46 am, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2011, at 1:50 AM, Arthur Kopatsy wrote: Hi, My web application has a controller

[sqlalchemy] Occasional ProgrammingError in threaded environment

2011-07-19 Thread Arthur Kopatsy
Hi, My web application has a controller that spawns multiple threads using a thread pool. Each of them has its own session (I store it in thread local). Occasionally (1 out of 100 or more) I get really strange errors that really look like corrupted queries. My guess is that it may be due to my

[sqlalchemy] Persist an object on multiple tables across multiple shards

2011-06-28 Thread Arthur Kopatsy
Hi, Here is the scenario. I have two objects: node and edge. My DB is sharded on node ids. Edges connect two node ids. I have essentially three tables: node, inboundEdge, outboundEdge. If an edge (A,B) is created, I want it to be persisted in the inbound edge table of node B shard and in the

[sqlalchemy] Re: Add helper methods to a model class

2011-06-26 Thread Arthur Kopatsy
. Also, it potentially allows applications to add columns to the models which I do not want. Arthur On Jun 26, 9:26 am, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 25, 2011, at 10:59 PM, Arthur Kopatsy wrote: Hi, I have seen a few related questions but never a clear answer. I

[sqlalchemy] Add helper methods to a model class

2011-06-25 Thread Arthur Kopatsy
Hi, I have seen a few related questions but never a clear answer. I have a set of core models defined using a declarative form. These models are used by multiple applications. In each application we however want to extend this model class with helper methods. Since these methods are application

[sqlalchemy] query_chooser and relationship queries

2011-06-24 Thread Arthur Kopatsy
Hi, I am trying to write a proper query_chooser method for our user based sharding. To do so, I need to be able to query the value of the query's criterions. I have the following model: class User(object): id = Column(Integer, primary_key=True) ... class Subscription(object): id =

[sqlalchemy] Re: query_chooser and relationship queries

2011-06-24 Thread Arthur Kopatsy
= bind.callable() Thank you so much for the quick response. Arthur On Jun 24, 10:05 am, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 24, 2011, at 12:49 PM, Arthur Kopatsy wrote: Hi, I am trying to write a proper query_chooser method for our user based sharding. To do so, I need

[sqlalchemy] Re: query_chooser and relationship queries

2011-06-24 Thread Arthur Kopatsy
Great. Of course that line ( |    verificationTokenExpiry = Column(String)) was a copy and paste mistake. On Jun 24, 10:28 am, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 24, 2011, at 1:26 PM, Arthur Kopatsy wrote: Awesome. Does that mean the sqlalchemy example is wrong