[sqlalchemy] Re: Creating a custom Visitable

2010-07-20 Thread Mike Lewis
I figured that I need to extend a dialect. Would having something similar to (still a rough version) added to the postgresql dialect be an option?: def post_create_table(self, table): Build table-level CREATE options like TABLESPACE. table_opts = [] inherits =

[sqlalchemy] Re: Creating a custom Visitable

2010-07-20 Thread Mike Lewis
extension ? On Jul 20, 2010, at 3:07 AM, Mike Lewis wrote: I figured that I need to extend a dialect.  Would having something similar to (still a rough version) added to the postgresql dialect be an option?:    def post_create_table(self, table):        Build table-level CREATE options

[sqlalchemy] Creating a custom Visitable

2010-07-19 Thread Mike Lewis
I'm interested in creating a visitable (more specifically, a SchemaItem) to support EXTENDS when creating tables. How would one go about this? Thanks, Mike -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] Re: WITH ... SELECT queries in postgres

2010-07-08 Thread Mike Lewis
, DB2 supportWITH).   Oracle makesWITHdifficult.    Its also getting to be time to do a DB2 dialect. On Jul 6, 2010, at 7:07 PM, Mike Lewis wrote: Does SA support this syntax? http://www.postgresql.org/docs/9.0/static/queries-with.html Thanks, Mike -- You received this message

[sqlalchemy] Re: WITH ... SELECT queries in postgres

2010-07-08 Thread Mike Lewis
, Mike Lewis wrote: I'd be interested in prototyping a WithClause or something similar if you think it might be useful. I imagine it would have similar semantics to a FromClause but would be prepended to the query.  Currently, I'm not too interested in prototyping the RECURSIVE part

[sqlalchemy] Re: WITH ... SELECT queries in postgres

2010-07-08 Thread Mike Lewis
Sorry, google groups formatted that *really* poorly. On Jul 8, 12:28 pm, Mike Lewis mikelikes...@gmail.com wrote: That's a fair point. I think one interface might be casting a FromClause into a WithClause similar to how one would alias something. With postgres it seams like when going from

[sqlalchemy] WITH ... SELECT queries in postgres

2010-07-06 Thread Mike Lewis
Does SA support this syntax? http://www.postgresql.org/docs/9.0/static/queries-with.html Thanks, Mike -- 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

[sqlalchemy] Re: WITH ... SELECT queries in postgres

2010-07-06 Thread Mike Lewis
... WITH and OVER seem to be the upcoming things we'll have to work on (PG, MSSQL, DB2 support WITH).   Oracle makes WITH difficult.    Its also getting to be time to do a DB2 dialect. On Jul 6, 2010, at 7:07 PM, Mike Lewis wrote: Does SA support this syntax? http://www.postgresql.org/docs/9.0

[sqlalchemy] Re: Column order with declarative base

2010-07-02 Thread Mike Lewis
On Jul 1, 2010, at 8:24 PM, Michael Bayer wrote: The Column object contains a sort key when constructed, against a single global value, that is used as a sort key when the Table is generated.  This is to get around the fact that the attribute dictionary of the declarative class is

[sqlalchemy] Column order with declarative base

2010-07-01 Thread Mike Lewis
I'm trying to do some DDL creation with declarative base. THe problem I am running into is that I'm using a mixin, and it seems that the order the columns are being created in is different than the order they're declared with. Is there any way to control this? Thanks, Mike Lewis -- You

[sqlalchemy] Re: Column order with declarative base

2010-07-01 Thread Mike Lewis
Please provide a simple, small example of your problem :-) Also, is there a reason the order of column creation matters? Chris -- Simplistix - Content Management, Batch Processing Python Consulting             -http://www.simplistix.co.uk class Foo(object): id = Column(Integer,

[sqlalchemy] in_ Subselect

2009-04-28 Thread Mike Lewis
Hi, This might be a noob question, but I am trying to reproduce the following sql query in SA select user_id, friend_id from follows where friend_id not (in select id from users); First, I do this: subquery = Session.query(User.id).subquery() Then q =

[sqlalchemy] Re: in_ Subselect

2009-04-28 Thread Mike Lewis
follows.friend_id NOT IN (SELECT users.id FROM users) Mike Lewis wrote: Hi, This might be a noob question, but I am trying to reproduce the following sql query in SA select user_id, friend_id from follows  where friend_id not (in select id from users); First, I do this: subquery

[sqlalchemy] Asynchronous SQLAlchemy

2008-01-23 Thread Mike Lewis
Hi All, I'm starting a new project that will probably be using Twisted, but I want to use SQLAlchemy as well. I saw a couple of old posts about Asynchronous SQLAlchemy and two different implementations, but neither sAsync nor nadbapi seem to be maintained (or at least have new versions posted),

[sqlalchemy] Testing Conditions for insertion, and grouping queries together

2007-08-27 Thread Mike Lewis
a join table where you have tags and things, and the join table tags the things. I want to test if it already exists and whatnot, and insert it in the same query if it doesn't. Are there any good articles on optimizing your SQL queries and such? Thanks, Mike Lewis