I have a Self-Referential Many-to-Many Relationship situation where the
right_nodes = relationship(Node,
secondary=node_to_node,
primaryjoin=id==node_to_node.c.left_node_id,
secondaryjoin=id==node_to_node.c.right_node_id,
On Aug 20, 2012, at 6:07 PM, adolfo wrote:
I have a Self-Referential Many-to-Many Relationship situation where the
right_nodes = relationship(Node,
secondary=node_to_node,
primaryjoin=id==node_to_node.c.left_node_id,
Thanks Michael.
The question is: how can I use that trick as a relation?
I can do:
session.query(Node).outerjoin(Node.right_nodes)
and
session.query(Node).outerjoin(Node.left_nodes)
but not
session.query(Node).outerjoin(Node.all_nodes)
and that is what I'm looking for. I mean the
Hello,
I have a need to perform an upsert query with PostgreSQL. the following
SQL query achieves this goal:
WITH upsert AS (
UPDATE metric k SET k.count = k.count + 5
WHERE event = foo AND interval = D and date = whatever
RETURNING k.*
)
INSERT INTO metric (event, interval, date, count)
On Aug 20, 2012, at 7:08 PM, adolfo wrote:
Thanks Michael.
The question is: how can I use that trick as a relation?
I can do:
session.query(Node).outerjoin(Node.right_nodes)
and
session.query(Node).outerjoin(Node.left_nodes)
but not
On Aug 20, 2012, at 7:28 PM, Mitchell Hashimoto wrote:
Hello,
I have a need to perform an upsert query with PostgreSQL. the following SQL
query achieves this goal:
WITH upsert AS (
UPDATE metric k SET k.count = k.count + 5
WHERE event = foo AND interval = D and date = whatever