Hi,
with our old homegrown SQL-wrapping we enjoyed the possibility to time each
sql-query to drill down on performance bottlenecks.
This is currently not possible for us using SA. So I'd like to ask how to
approach this. I found some references on the net talking about profiling in
Hi,
This is my first post. I want to know, if is possible, I connect to
postgresql at the same time. Example: I have a webpage which shows
five results that their data have stored in the same database or not
(but all postgresql). So, my idea is using sqlalchemy pool connection
call these five
recipe which sounds similar to your old approach here:
http://techspot.zzzeek.org/?p=31
On Feb 12, 2009, at 5:27 AM, Diez B. Roggisch wrote:
Hi,
with our old homegrown SQL-wrapping we enjoyed the possibility to
time each
sql-query to drill down on performance bottlenecks.
This is
a single pool expects to connect to a single database URL, since it
pools all connections equally and doesn't store details regarding the
characteristics of individual connections.
If you want to pull results from multiple databases, you'd have to use
multiple pool and/or Engine objects
I've got a fairly simple database made with django and accessed via sqlsoup.
(finally got some time to take more of a look at the tutorial, which helped a
little :)
The two tables are
devmap_device
id
device_name
manufacturer_id
devmap_manufacturer
id
manufacturer_name
I tried to
Hi All,
Can someone tell me why this script:
from datetime import datetime
from sqlalchemy import create_engine, Table, Column, Integer, String,
DateTime, ForeignKey
from sqlalchemy.orm import sessionmaker, relation, backref
from sqlalchemy.ext.declarative import declarative_base
engine =
On Feb 12, 2009, at 12:09 PM, Chris Withers wrote:
session = sessionmaker(bind=engine)()
unit = Unit(id=1,name='unit 1')
session.merge(unit)
session.add(Record(
timestamp = datetime.now(),
unit = unit,
))
session.merge(Unit(id=2,name='unit 2'))
Michael Bayer wrote:
On Feb 12, 2009, at 12:09 PM, Chris Withers wrote:
session = sessionmaker(bind=engine)()
unit = Unit(id=1,name='unit 1')
session.merge(unit)
session.add(Record(
timestamp = datetime.now(),
unit = unit,
))
I've been working on breaking Dialect.reflecttable into components so
that they can be used independently (e.g. get_columns, get_foreign_keys,
etc). One of the original goals was to be able to do away with
reflecttable and have the Inspector, engine.reflection.Inspector,
construct the table
Many thanks Michael, your instructions were spot-on. In the process of
following your instructions I decided to switch from using
ext.declarative to a non-declarative style (define tables, define
Python objects, setting up the mapping, the works :-).
Regretfully while trying to work out the rest
is this joined inheritance or concrete?
IMO if Product inherits Node, they has to have same PK?
On Thursday 12 February 2009 23:56:12 Bruce van der Kooij wrote:
Many thanks Michael, your instructions were spot-on. In the process
of following your instructions I decided to switch from using
Hi All,
With the model from my previous post, I'm looking to find the latest
Record for a particular Unit.
Someone on #sqlalchemy suggested this:
unit = session.query(Unit).filter(Unit.id==3).first()
record = unit.records.order_by(Record.date.desc()).first()
...however, this gives me:
Chris Withers wrote:
record = unit.records.order_by(Record.date.desc()).first()
oops, I meant:
record = unit.records.order_by(Record.timestamp.desc()).first()
...however, this still gives me:
AttributeError: 'InstrumentedList' object has no attribute 'order_by'
How should I be looking to do
use the relation as a join path, and then whatever
filtering/ordering
try:
unit.join(Unit.records).order_by(Record.date.desc()).first()
or
unit.join('records').order_by(Record.date.desc()).first()
--~--~-~--~~~---~--~~
You received this message because
14 matches
Mail list logo