[sqlalchemy] Re: [Sqlalchemy-users] Objects with just some fields

2007-05-09 Thread Mike Orr
On 5/9/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > On May 9, 2007, at 2:46 PM, Mike Orr wrote: > > > > > The actual SQL time is 1.04 second for this ORM-inspired query: > > > > SELECT entries.category AS entries_category, entries.title AS > > entries_title, entries.thumb200 AS entries_thumb

[sqlalchemy] Re: Viewing SQL of literals....

2007-05-09 Thread Michael Bayer
currently: statement.compile().construct_params() On May 9, 2007, at 6:44 PM, m h wrote: > > Hey- > > I think this is a simple question but I couldn't find it in the docs > (or wiki or faq). > > I'm trying to debug a query that has some string literals in it (ie > > calendar.c.week.between(fu

[sqlalchemy] Viewing SQL of literals....

2007-05-09 Thread m h
Hey- I think this is a simple question but I couldn't find it in the docs (or wiki or faq). I'm trying to debug a query that has some string literals in it (ie calendar.c.week.between(func.to_date('09/19/06','MM/DD/RR')-84,func.to_date('09/19/06','MM/DD/RR') ) and when I view the sql (via pri

[sqlalchemy] Re: Generative style on SQL-API layer

2007-05-09 Thread Rick Morrison
I've only ever wanted to copy the select() item, usually as a component of a generic "query builder" like thing. But maybe things like .alias() and .label() could be made into generative versions that might make it easier to reassign names on the fly. As far as the individual clause elements themse

[sqlalchemy] Re: Generative style on SQL-API layer

2007-05-09 Thread Michael Bayer
On May 9, 2007, at 4:08 PM, Rick Morrison wrote: > Hey Mike, > > I've really gotten to like the generative style of query building > that the ORM layer uses, and I find myself developing a number of > patterns that use that style to > good advantage. > > Today I found myself struggling with

[sqlalchemy] Generative style on SQL-API layer

2007-05-09 Thread Rick Morrison
Hey Mike, I've really gotten to like the generative style of query building that the ORM layer uses, and I find myself developing a number of patterns that use that style to good advantage. Today I found myself struggling with a query in the low-level SQL-API layer that the generative approach wo

[sqlalchemy] Re: Speed of BoundMetaData

2007-05-09 Thread Eric Brunson
I think I was looking at the BoundMetaData call while we were having database problems, that doesn't seem to be the core of the problem. Ignore this for now, please. Thanks. Eric Brunson wrote: > I have a web app running under mod_python that dynamically builds forms > to edit database reco

[sqlalchemy] Speed of BoundMetaData

2007-05-09 Thread Eric Brunson
I have a web app running under mod_python that dynamically builds forms to edit database records which uses the database's constrains pretty extensively to generate FK drop downs and appropriate validation rules. My problem is that as the schema has grown and the inter-table dependencies have

[sqlalchemy] Re: [Sqlalchemy-users] Objects with just some fields

2007-05-09 Thread Michael Bayer
On May 9, 2007, at 2:46 PM, Mike Orr wrote: > > The actual SQL time is 1.04 second for this ORM-inspired query: > > SELECT entries.category AS entries_category, entries.title AS > entries_title, entries.thumb200 AS entries_thumb200, entries.creator > AS entries_creator, entries.doctype AS entrie

[sqlalchemy] Re: [Sqlalchemy-users] Objects with just some fields

2007-05-09 Thread Mike Orr
The actual SQL time is 1.04 second for this ORM-inspired query: SELECT entries.category AS entries_category, entries.title AS entries_title, entries.thumb200 AS entries_thumb200, entries.creator AS entries_creator, entries.doctype AS entries_doctype, entries.filename AS entries_filename, entries.

[sqlalchemy] Re: [Sqlalchemy-users] Objects with just some fields

2007-05-09 Thread Mike Orr
On 5/8/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > On May 8, 2007, at 8:47 PM, Mike Orr wrote: > > > > > I noticed the ORM was taking a few seconds longer in my batch job. > > > > Today I converted my web application from Select to ORM so I could add > > some methods to the mapped classes,

[sqlalchemy] Re: database reflection

2007-05-09 Thread Michael Bayer
On May 9, 2007, at 8:27 AM, Antipin Aleksei wrote: > > Hi > > I'm studying examples of using database in pylons. SQLAlchemy is most > commonly used here. But I don't understand why most of them use > explicit > column declaration. > I want to use Postgres database which supports ALTER table st

[sqlalchemy] Re: elixir, sqlalchemy & myqldb: Error connectiong to local socket

2007-05-09 Thread King Simon-NFHD78
Pirkka wrote: > > I started migrating from ActiveMapper to Elixir, and have been > wrestling with this for hours: > > DBAPIError: (Connection failed) (OperationalError) (2005, "Unknown > MySQL server host '/Applications/MAMP/tmp/mysql/mysql.sock' (1)") > > Here are the command parameters that s

[sqlalchemy] elixir, sqlalchemy & myqldb: Error connectiong to local socket

2007-05-09 Thread pirkka
I started migrating from ActiveMapper to Elixir, and have been wrestling with this for hours: DBAPIError: (Connection failed) (OperationalError) (2005, "Unknown MySQL server host '/Applications/MAMP/tmp/mysql/mysql.sock' (1)") Here are the command parameters that sqlalchemy is using to open the

[sqlalchemy] database reflection

2007-05-09 Thread Antipin Aleksei
Hi I'm studying examples of using database in pylons. SQLAlchemy is most commonly used here. But I don't understand why most of them use explicit column declaration. I want to use Postgres database which supports ALTER table statement. Following those examples if I need to change column name f

[sqlalchemy] Re: Duplicating a row?

2007-05-09 Thread Sébastien LELONG
> what is the common pattern to duplicate a row? > [...] What's the common way to do that? I personnally do this as following (don't know if it's the common pattern): # row is a RowProxy object from a table.select(blabla) type(row) => mytable.insert(dict(row.items())).execute() Hope

[sqlalchemy] Re: Column name mapping problem in 0.3.7 (firebird)

2007-05-09 Thread Oleg Deribas
Hello, Michael Bayer said the following on 08.05.2007 20:57: > overheard at firebird developer meeting: > > "hey, whats the longest table names should be ?" > "obviously, 31 characters." > "hey yeah. 31 does it for me. brilliant !" Just for reference. Here is (slightly outdated) information

[sqlalchemy] Duplicating a row?

2007-05-09 Thread Andreas Jung
Hi, what is the common pattern to duplicate a row? I have several cases where I obtain a row and need to insert it with some slightly modifications back into the table. I've written a small copy method for that but it is ugly code. What's the common way to do that? Andreas pgpOYYmiHG4WV.pgp