[sqlalchemy] Plugging explain analyze - is it possible easily

2007-11-29 Thread Marcin Kasperski
Well, I had a dream. In this dream I could write something like sqlalchemy.default.autoexplain = True in my pylons config and it caused all my select and update statements being executed with (here it is Postgres backend) EXPLAIN ANALYZE SELECT col1, col2 FROM ... Why bother?

[sqlalchemy] SQLAlchemy denormalization

2007-11-29 Thread PaStIcHiO
Is there any way to store in a column the result of a call of an object method? I have seen something similar here. i = 0 def mydefault(): global i i += 1 return i t = Table(mytable, meta, # function-based default Column('id', Integer, primary_key=True, default=mydefault),

[sqlalchemy] Inheritance and eager loading - is contains_eager the answer?

2007-11-29 Thread Martin Pengelly-Phillips
Hi there, I have been using sqlalchemy for the past month with great success. However, recently I came across an unexpected situation. Essentially the results I was retrieving from the database via an ORM query were not including all the related attributes despite indicating eager loading on

[sqlalchemy] Getting a list of parameters from a select object

2007-11-29 Thread Samuel
Hi, I am trying to get a list of parameters from a Select object. In other words, given the following code: select = table.select(or_(table.c.id == 10, table.c.name == test)) I am trying to get the following list: [10, test]. I tried select.compile().parameters, which returns None. Any hints?

[sqlalchemy] Re: Inheritance and eager loading - is contains_eager the answer?

2007-11-29 Thread Michael Bayer
so, this was something very small and is fixed in r3843. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this

[sqlalchemy] Re: Inheritance and eager loading - is contains_eager the answer?

2007-11-29 Thread Martin Pengelly-Phillips
Ah, thanks for the quick response Mike - I'll keep an eye out for the fix. Martin On Nov 29, 3:05 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Nov 29, 2007, at 7:54 AM, Martin Pengelly-Phillips wrote: Hi there, I have been using sqlalchemy for the past month with great success.

[sqlalchemy] Re: SQLAlchemy denormalization.

2007-11-29 Thread Michael Bayer
On Nov 29, 2007, at 8:10 AM, PaStIcHiO wrote: Hi to everyone: i have a question for you, since i haven't found the solution in the docs. Is there such a way to store in a extra column an information that belongs to some property of an object? I'll try to be clear with an example: I

[sqlalchemy] Re: SQLAlchemy denormalization.

2007-11-29 Thread Rick Morrison
Another technique to think about would be to enumerate the child addresses with a small integer value, say sequence. You can then add the order_by to the relation to fetch the addresses in sequence order, and by convention the first address in the result list -- the one with min(sequence) in the

[sqlalchemy] Re: Getting a list of parameters from a select object

2007-11-29 Thread Samuel
On Nov 29, 4:49 pm, Michael Bayer [EMAIL PROTECTED] wrote: assuming youre using 0.3 youd have to call select.compile().construct_params({}). The method doesn't exist (at least not in the MySQL engine I am using (with sqlalchemy 0.3)), but while looking for the correct name I found that

[sqlalchemy] odd adjancency list w/ join_depth behavior

2007-11-29 Thread Kapil Thangavelu
hi folks, i seem to be running into a bug or misconfiguration with sqlalchemy's tree handling.. the table and mapping themselves seem fairly innocuous concepts_table = Table(concepts, metadata, Column(id, types.Integer, primary_key=True), Column(name,

[sqlalchemy] Re: odd adjancency list w/ join_depth behavior

2007-11-29 Thread Michael Bayer
nah its a bug...will fix in a few On Nov 29, 2007, at 12:25 PM, Kapil Thangavelu wrote: from sqlalchemy import Column, MetaData, Table, types, ForeignKey, Index, create_engine from sqlalchemy.orm import mapper, relation, backref, session from sqlalchemy.orm.collections import

[sqlalchemy] what happens when another process changes my data?

2007-11-29 Thread Chris Withers
Hi All, I'm a real newbie when it comes to SQL Alchemy and I'm curious to know what happens when another process changes the relational data that the object model is built from? How is the object model invalidated such that it is updated in this case? cheers, Chris -- Simplistix - Content

[sqlalchemy] mapper relations with foreign_keys=

2007-11-29 Thread Rick Morrison
Just noticed that for mappers that use tables that do not define foreign keys, specifying only 'primaryjoin=' plus 'foreign_keys=' doesn't seem to be sufficient to define the relationship, adding 'remote_side=' fixed it. Also for such mappers, if there is a 'backref', the backref doesn't seem to

[sqlalchemy] Problem with long identifiers for indexes generated by SQLAlchemy in Oracle 9i

2007-11-29 Thread Jason R. Coombs
Hello. I've run into a problem with sqlalchemy 0.3.12dev (svn trunk) on Oracle 9i where I get an exception identifier too long. This is on table creation where the the column is Column( 'signer_accountid', index=True ) and the tablename is 'signed_documents'. The index generated is

[sqlalchemy] Re: mapper relations with foreign_keys=

2007-11-29 Thread Michael Bayer
On Nov 29, 2007, at 6:09 PM, Rick Morrison wrote: Just noticed that for mappers that use tables that do not define foreign keys, specifying only 'primaryjoin=' plus 'foreign_keys=' doesn't seem to be sufficient to define the relationship, adding 'remote_side=' fixed it. Also for