[sqlalchemy] SQLAlchemy GUI

2009-05-11 Thread Jarrod Chesney
Hi All I'm planning on making a GUI database configurator based on SQLAlchemy. It will be roughly a GUI interface to the SQLAlchemy API. Allowing the user to view/edit table data as well as database objects. Eventually i'd like it to support most of the database access and db object

[sqlalchemy] Re: Basic Search Engine

2009-05-11 Thread fluence
@Paul I have been having a play with [py]parsing. What a nifty little library! I read those 2 free tutes and liked what I saw so bought a subscription to safari just so I could read your short cut. For my purposes (a few k objects at most, generally a few hundred) a non indexed and inefficient

[sqlalchemy] Re: Basic Search Engine

2009-05-11 Thread fluence
I apologise for the formatting. How does one go about posting snippets inline properly? In the future I think I'll just post links to pastes. Paste of the above code: http://pastie.org/474342 --~--~-~--~~~---~--~~ You received this message because you are

[sqlalchemy] bindparams not resolved?

2009-05-11 Thread Wichert Akkerman
I am wondering if this is a bug in my reasoning, or in SQLAlchemy (0.5.3). I have a model which is pretty simple: class ClothingArticle(BaseObject): __tablename__ = clothing_article id = schema.Column(types.Integer(), primary_key=True, autoincrement=True) currency =

[sqlalchemy] Re: Q: Declarative and self-referencing tables

2009-05-11 Thread Michael Bayer
Adrian von Bidder wrote: Heyho! How can I use Declarative to create self-referencing stuff? I'm trying without success to create the tree example (Node with Node.parent and Node.children) in declarative. The basic table is: class Node(Base): __tablename__ = 'nodes' id =

[sqlalchemy] Re: bindparams not resolved?

2009-05-11 Thread Michael Bayer
the signature for Session.execute is not the same as that of Connection or Engine: Session.execute(stmt, params={'foo':'bar'}) Wichert Akkerman wrote: I am wondering if this is a bug in my reasoning, or in SQLAlchemy (0.5.3). I have a model which is pretty simple: class

[sqlalchemy] Re: Sequence start value not working with PostgreSQL

2009-05-11 Thread Michael Bayer
the start functionality is unimplemented at the moment. instead, issue: t = Table(mytable, ) DDL(CREATE SEQUENCE ).execute_at('before-create', t) Chris Miles wrote: I need to create an explicit Sequence with a specified start value. Looks simple, I tried Sequence('test_seq',

[sqlalchemy] Re: How to run a stored procedure?

2009-05-11 Thread Daniel
Any reply on this? Should I submit a new bug report? On May 8, 11:49 am, Daniel daniel.watr...@gmail.com wrote: I've just been looking through the code in mssql.py and the change mentioned in the changeset I mentioned isn't there anymore.  I also can't see that's it's been abstracted to a

[sqlalchemy] Re: FOR UPDATE or UPDLOCK

2009-05-11 Thread Daniel
Can someone give me an idea about this? Should this be submitted as a bug or feature request? Thanks. On May 7, 3:50 pm, Daniel daniel.watr...@gmail.com wrote: Hello, I have a transaction that involves a SELECT and subsequent UPDATE.  It is operating against MSSQL.  I need to make sure

[sqlalchemy] Re: FOR UPDATE or UPDLOCK

2009-05-11 Thread Daniel
I mentioned this originally, but maybe it wasn't clear. In order to have MSSQL perform a select for update the FROM clause must be modified. This is comparable to appending FOR UPDATE to the entire query in other DBMSs. For example, the following two queries have the same effect and show the

[sqlalchemy] Re: How to run a stored procedure?

2009-05-11 Thread Michael Bayer
Email on the pyodbc mailing list for instructions on how to execute a stored procedure.The information there will guide how this is done with SQLAlchemy. Daniel wrote: Any reply on this? Should I submit a new bug report? On May 8, 11:49 am, Daniel daniel.watr...@gmail.com wrote: I've

[sqlalchemy] Re: FOR UPDATE or UPDLOCK

2009-05-11 Thread Michael Bayer
but is the comment in the code correct ? is DECLARE CURSOR required ? Daniel wrote: I mentioned this originally, but maybe it wasn't clear. In order to have MSSQL perform a select for update the FROM clause must be modified. This is comparable to appending FOR UPDATE to the entire query

[sqlalchemy] Re: FOR UPDATE or UPDLOCK

2009-05-11 Thread Daniel
A DECLARE CURSOR is required for the keywords 'FOR UPDATE, but I'm not sure that they do the same thing as FOR UPDATE in MySQL. On the other hand, the (UPDLOCK) keyword attached to the FROM clause doesn't require a DECLARE CURSOR. On May 11, 9:34 am, Michael Bayer mike...@zzzcomputing.com

[sqlalchemy] Re: Building an or_ filter in loop

2009-05-11 Thread polaar
this would even be easier (and correcter if the terms contain %) written as: cond = or_(*[Fruit.name.contains(term) for term in terms]) On 8 mei, 21:59, Kyle Schaffrick k...@raidi.us wrote: On Fri, 8 May 2009 12:52:09 -0700 (PDT) Bryan bryanv...@gmail.com wrote: I can't figure out a

[sqlalchemy] Possible documentation glitch?

2009-05-11 Thread klaus
The last example in the reference for Query.join (http:// www.sqlalchemy.org/docs/05/reference/orm/query.html#the-query-object) seems to contain a few typos: Articles.id should be Article.id article_keywords.c (2x) does not exist anymore. (The .c should simply be left out, I think.) Cheers

[sqlalchemy] Re: How to run a stored procedure?

2009-05-11 Thread Daniel
Michael, I can execute a stored procedure from SQLAlchemy, but I can't get a result set back out of SQLAlchemy. I've verified that the SP executes as expected and I know that it's returning a result set. I'm following what's been suggested on this forum

[sqlalchemy] Re: Building an or_ filter in loop

2009-05-11 Thread Kyle Schaffrick
On Mon, 11 May 2009 09:01:06 -0700 (PDT) polaar steven.vereec...@gmail.com wrote: this would even be easier (and correcter if the terms contain %) written as: cond = or_(*[Fruit.name.contains(term) for term in terms]) Indeed, good catch. I was so interested in the apply or_ logic that

[sqlalchemy] Re: Basic Search Engine

2009-05-11 Thread Paul McGuire
On May 11, 6:20 am, fluence ndudfi...@gmail.com wrote: @Paul I have been having a play with [py]parsing. What a nifty little library! I read those 2 free tutes and liked what I saw so bought a subscription to safari just so I could read your short cut. Glad to hear that pyparsing is

[sqlalchemy] Re: SQLAlchemy and unit tests

2009-05-11 Thread Michael Bayer
clear out the session (or make a new one) between tests. while the session attempts to weak reference its contents, it usually ends up holding onto a lot of stuff due to a particular reference cycle created by backrefs (I'm thinking of ways to eliminate that behavior). On May 11, 2009,

[sqlalchemy] Re: Sequence start value not working with PostgreSQL

2009-05-11 Thread Chris Miles
Thanks Michael. On 12/05/2009, at 12:34 AM, Michael Bayer wrote: the start functionality is unimplemented at the moment. instead, issue: t = Table(mytable, ) DDL(CREATE SEQUENCE ).execute_at('before-create', t) Chris Miles wrote: I need to create an explicit Sequence

[sqlalchemy] Re: SQLAlchemy and unit tests

2009-05-11 Thread James Brady
Perfect, thanks Michael - I'll pass this on to the TG list 2009/5/11 Michael Bayer mike...@zzzcomputing.com clear out the session (or make a new one) between tests. while the session attempts to weak reference its contents, it usually ends up holding onto a lot of stuff due to a