sqlalchemy-tickets Mailing List for SQLAlchemy (Page 94)
Brought to you by:
zzzeek
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(174) |
Apr
(50) |
May
(71) |
Jun
(129) |
Jul
(113) |
Aug
(141) |
Sep
(82) |
Oct
(142) |
Nov
(97) |
Dec
(72) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(159) |
Feb
(213) |
Mar
(156) |
Apr
(151) |
May
(58) |
Jun
(166) |
Jul
(296) |
Aug
(198) |
Sep
(89) |
Oct
(133) |
Nov
(150) |
Dec
(122) |
| 2008 |
Jan
(144) |
Feb
(65) |
Mar
(71) |
Apr
(69) |
May
(143) |
Jun
(111) |
Jul
(113) |
Aug
(159) |
Sep
(81) |
Oct
(135) |
Nov
(107) |
Dec
(200) |
| 2009 |
Jan
(168) |
Feb
(109) |
Mar
(141) |
Apr
(128) |
May
(119) |
Jun
(132) |
Jul
(136) |
Aug
(154) |
Sep
(151) |
Oct
(181) |
Nov
(223) |
Dec
(169) |
| 2010 |
Jan
(103) |
Feb
(209) |
Mar
(201) |
Apr
(183) |
May
(134) |
Jun
(113) |
Jul
(110) |
Aug
(159) |
Sep
(138) |
Oct
(96) |
Nov
(116) |
Dec
(94) |
| 2011 |
Jan
(97) |
Feb
(188) |
Mar
(157) |
Apr
(158) |
May
(118) |
Jun
(102) |
Jul
(137) |
Aug
(113) |
Sep
(104) |
Oct
(108) |
Nov
(91) |
Dec
(162) |
| 2012 |
Jan
(189) |
Feb
(136) |
Mar
(153) |
Apr
(142) |
May
(90) |
Jun
(141) |
Jul
(67) |
Aug
(77) |
Sep
(113) |
Oct
(68) |
Nov
(101) |
Dec
(122) |
| 2013 |
Jan
(60) |
Feb
(77) |
Mar
(77) |
Apr
(129) |
May
(189) |
Jun
(155) |
Jul
(106) |
Aug
(123) |
Sep
(53) |
Oct
(142) |
Nov
(78) |
Dec
(102) |
| 2014 |
Jan
(143) |
Feb
(93) |
Mar
(35) |
Apr
(26) |
May
(27) |
Jun
(41) |
Jul
(45) |
Aug
(27) |
Sep
(37) |
Oct
(24) |
Nov
(22) |
Dec
(20) |
| 2015 |
Jan
(17) |
Feb
(15) |
Mar
(34) |
Apr
(55) |
May
(33) |
Jun
(31) |
Jul
(27) |
Aug
(17) |
Sep
(22) |
Oct
(26) |
Nov
(27) |
Dec
(22) |
| 2016 |
Jan
(20) |
Feb
(24) |
Mar
(23) |
Apr
(13) |
May
(17) |
Jun
(14) |
Jul
(31) |
Aug
(23) |
Sep
(24) |
Oct
(31) |
Nov
(23) |
Dec
(16) |
| 2017 |
Jan
(24) |
Feb
(20) |
Mar
(27) |
Apr
(24) |
May
(28) |
Jun
(18) |
Jul
(18) |
Aug
(23) |
Sep
(30) |
Oct
(17) |
Nov
(12) |
Dec
(12) |
| 2018 |
Jan
(27) |
Feb
(23) |
Mar
(13) |
Apr
(19) |
May
(21) |
Jun
(29) |
Jul
(11) |
Aug
(22) |
Sep
(14) |
Oct
(9) |
Nov
(24) |
Dec
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-03 19:43:21
|
#1068: render 'SELECT foo() AS x .. ORDER BY x' by default
-----------------------------------+-------------------------------
Reporter: jek | Owner: anyone
Type: enhancement | Status: closed
Priority: high | Milestone: 0.9.0
Component: sql | Severity: major - 1-3 hours
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+-------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* status_field: in progress => completed/closed
Comment:
so far seems to work on all database platforms (even oracle). Will see if
users report issues on older versions of those platforms.
diff:@82c11cc94b41323caeecc9990d1d87ed9fed4b7c:f8325d9dbb52d0da140f3403ce915645ae4a5a9c
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1068#comment:17>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-03 17:55:32
|
#2504: alternative driver for firebird (fdb)
-----------------------------------+-------------------------------
Reporter: treeve | Owner: zzzeek
Type: enhancement | Status: closed
Priority: medium | Milestone: 0.8.xx
Component: firebird | Severity: major - 1-3 hours
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+-------------------------------
Changes (by zzzeek):
* status: new => closed
* status_field: needs questions answered => completed/closed
* resolution: => fixed
* milestone: 0.x.xx => 0.8.xx
Comment:
great, 2.5.2 is fine and the fdb driver works as implemented, I've made it
the default in 0.9. r82c11cc94b41323caeec
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2504#comment:7>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-03 02:51:16
|
#2739: disalllow None in filter()/where()/and_() ?
--------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.0
Component: sql | Severity: minor - half an hour
Keywords: | Progress State: not decided upon
--------------------+---------------------------------------
things are inconsistent right now, and I dont really know what it means to
say filter(None) or filter(None, None). so just disallow it.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2739>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:42:27
|
#1452: mysql update... order by
------------------------------+----------------------------------
Reporter: guest | Owner: zzzeek
Type: enhancement | Status: new
Priority: low | Milestone: blue sky
Component: sql | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: on hold |
------------------------------+----------------------------------
Changes (by zzzeek):
* status_field: needs questions answered => on hold
* milestone: 0.x.xx => blue sky
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1452#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:39:44
|
#2678: SAVEPOINT doesn't seem to entirely work w/ MSSQL/pyodbc/windows
---------------------------+-------------------------------
Reporter: zzzeek | Owner:
Type: defect | Status: new
Priority: medium | Milestone: 0.x.xx
Component: mssql | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in queue |
---------------------------+-------------------------------
Changes (by zzzeek):
* milestone: 0.8.xx => 0.x.xx
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2678#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:39:05
|
#2677: add "on mark as delete" event
------------------------------+-------------------------------
Reporter: ods | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.8.xx
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in queue |
------------------------------+-------------------------------
Comment (by zzzeek):
for here I would like to:
1. add detach() event, however docs need to stress that this can't be
called in the case where the Session is garbage collected without
close/expunge first
2. add delete() event
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2677#comment:10>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:33:57
|
#2626: unticketed "database.dbo" SQL server feature incorrect?
---------------------------+-------------------------------
Reporter: zzzeek | Owner:
Type: defect | Status: new
Priority: medium | Milestone: 0.x.xx
Component: mssql | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in queue |
---------------------------+-------------------------------
Changes (by zzzeek):
* milestone: 0.8.xx => 0.x.xx
Comment:
why `[]`? why not just use quotes `"`? SQL server allows real quotes
too.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2626#comment:5>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:30:52
|
#2728: potential glitch in schema calcs for metadata.reflect
------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.8.xx
Component: schema | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: needs tests |
------------------------------+-------------------------------
Description changed by zzzeek:
Old description:
> {{{
> #!diff
> diff -r cfb0f9ca14f82c9ba06c4d5cbc992f821eb2234e lib/sqlalchemy/schema.py
> --- a/lib/sqlalchemy/schema.py Wed May 15 15:46:29 2013 -0400
> +++ b/lib/sqlalchemy/schema.py Thu May 16 12:58:47 2013 -0400
> @@ -2716,20 +2716,28 @@
> if schema is not None:
> reflect_opts['schema'] = schema
>
> - available = util.OrderedSet(bind.engine.table_names(schema,
> -
> connection=conn))
> + available = util.OrderedSet(bind.engine.table_names(schema,
> connection=conn))
> if views:
> available.update(
> bind.dialect.get_view_names(conn, schema)
> )
>
> + if schema is not None:
> + available_w_schema = util.OrderedSet(["%s.%s" % (schema,
> name)
> + for name in available])
> + else:
> + available_w_schema = available
> +
> current = set(self.tables.iterkeys())
>
> if only is None:
> - load = [name for name in available if name not in
> current]
> + load = [name for name, schname in
> + zip(available, available_w_schema)
> + if schname not in current]
> elif util.callable(only):
> - load = [name for name in available
> - if name not in current and only(name, self)]
> + load = [name for name, schname
> + in zip(available, available_w_schema)
> + if schname not in current and only(name, self)]
> else:
> missing = [name for name in only if name not in
> available]
> if missing:
> }}}
New description:
{{{
#!diff
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py
index 3a74cbd..3d59e82 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -2711,13 +2711,22 @@ class MetaData(SchemaItem):
bind.dialect.get_view_names(conn, schema)
)
+ if schema is not None:
+ available_w_schema = util.OrderedSet(["%s.%s" % (schema,
name)
+ for name in available])
+ else:
+ available_w_schema = available
+
current = set(self.tables)
if only is None:
- load = [name for name in available if name not in
current]
+ load = [name for name, schname in
+ zip(available, available_w_schema)
+ if schname not in current]
elif util.callable(only):
- load = [name for name in available
- if name not in current and only(name, self)]
+ load = [name for name, schname in
+ zip(available, available_w_schema)
+ if schname not in current and only(name,
self)]
else:
missing = [name for name in only if name not in
available]
if missing:
}}}
--
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2728#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:30:31
|
#2728: potential glitch in schema calcs for metadata.reflect
------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.8.xx
Component: schema | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: needs tests |
------------------------------+-------------------------------
Changes (by zzzeek):
* priority: medium => high
Comment:
the bug is with same-named tables in different schemas:
{{{
#!python
from sqlalchemy import *
m = MetaData()
t1 = Table('t', m, Column('id', Integer, primary_key=True))
t2 = Table('t', m,
Column('id1', ForeignKey('t.id')),
schema="test_schema"
)
e = create_engine("postgresql://scott:tiger@localhost/test")
m.create_all(e)
try:
m2 = MetaData()
m2.reflect(e, schema="test_schema")
m3 = MetaData()
m3.reflect(e)
m3.reflect(e, schema="test_schema")
print [(t.name, t.schema) for t in m2.tables.values()]
print [(t.name, t.schema) for t in m3.tables.values()]
finally:
m.drop_all(e)
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2728#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:18:12
|
#2727: ProgrammingError when autoload from PostgreSQL (Amazon Redshift)
---------------------------+----------------------------------
Reporter: ashkop | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.x.xx
Component: postgres | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: on hold |
---------------------------+----------------------------------
Changes (by zzzeek):
* status_field: in queue => on hold
* milestone: 0.8.xx => 0.x.xx
Comment:
I need a single SQL statement that does the job here.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2727#comment:11>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:16:55
|
#2715: add more explicit documentation/flags for the many gaerdbms DBAPI options
--------------------------------+--------------------------------------
Reporter: moraes | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.8.xx
Component: documentation | Severity: minor - half an hour
Resolution: | Keywords: gaerdbms, mysql, dialect
Progress State: in queue |
--------------------------------+--------------------------------------
Changes (by zzzeek):
* component: engine => documentation
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2715#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:15:53
|
#2161: Py3k support for the C extension
-------------------------------+-------------------------------
Reporter: ged | Owner: pjenvey
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.xx
Component: cextensions | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: needs review |
-------------------------------+-------------------------------
Changes (by zzzeek):
* severity: no triage selected yet => major - 1-3 hours
* milestone: 0.8.xx => 0.9.xx
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2161#comment:19>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:14:49
|
#1390: postgresql regular expression operators
------------------------------+----------------------------------
Reporter: guest | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: postgres | Severity: minor - half an hour
Resolution: | Keywords: match
Progress State: needs tests |
------------------------------+----------------------------------
Changes (by zzzeek):
* milestone: 0.8.xx => 0.9.0
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1390#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:14:09
|
#1068: render 'SELECT foo() AS x .. ORDER BY x' by default
------------------------------+-------------------------------
Reporter: jek | Owner: anyone
Type: enhancement | Status: new
Priority: high | Milestone: 0.9.0
Component: sql | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in progress |
------------------------------+-------------------------------
Changes (by zzzeek):
* milestone: 0.8.xx => 0.9.0
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1068#comment:16>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:13:51
|
#2685: default schema as an execution argument
------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: high | Milestone: 0.9.0
Component: engine | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: needs tests |
------------------------------+-------------------------------
Changes (by zzzeek):
* milestone: 0.8.xx => 0.9.0
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2685#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:12:02
|
Batch modification to #2581, #2670, #2706 by zzzeek: priority to medium -- Tickets URL: <http://www.sqlalchemy.org/trac/query?id=2581%2C2670%2C2706> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:10:45
|
#2355: implement pyodbc + mssql + py3k
------------------------------+-------------------------------
Reporter: guest | Owner:
Type: enhancement | Status: new
Priority: high | Milestone: 0.9.xx
Component: mssql | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in queue |
------------------------------+-------------------------------
Changes (by zzzeek):
* milestone: 0.8.xx => 0.9.xx
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2355#comment:8>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:10:21
|
#2738: SQLAlchemy should throw an exception if there are multiple foreign keys to
relate
------------------------------+----------------------------------
Reporter: Svenstaro | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.8.xx
Component: schema | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: needs tests |
------------------------------+----------------------------------
Changes (by zzzeek):
* status_field: in queue => needs tests
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2738#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-02 00:09:50
|
#2738: SQLAlchemy should throw an exception if there are multiple foreign keys to
relate
----------------------------+----------------------------------
Reporter: Svenstaro | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.8.xx
Component: schema | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: in queue |
----------------------------+----------------------------------
Changes (by zzzeek):
* priority: medium => high
* status_field: awaiting triage => in queue
* component: cextensions => schema
* severity: no triage selected yet => minor - half an hour
* milestone: => 0.8.xx
Comment:
yeah wow, weird how nobody finds these for so long.
Here's that:
{{{
#!python
from sqlalchemy import *
m = MetaData()
t1 = Table('t', m,
Column('id', Integer, primary_key=True)
)
t2 = Table('t2', m,
Column('id1', ForeignKey('t.id')),
Column('id2', ForeignKey('t.id')),
)
s = select([t2]).alias()
print t1.join(s)
}}}
here's the patch:
{{{
#!diff
index 3a74cbd..1febb1b 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -1134,7 +1134,9 @@ class Column(SchemaItem, expression.ColumnClause):
information is not transferred.
"""
- fk = [ForeignKey(f.column) for f in self.foreign_keys]
+
+ fk = [ForeignKey(f.column, _constraint=f.constraint)
+ for f in self.foreign_keys]
if name is None and self.name is None:
raise exc.InvalidRequestError("Cannot initialize a sub-
selectable"
" with this Column object until it's 'name' has "
}}}
need to also test `print id(fk.constraint.elements[0])`, etc. should go
into test_selectable.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2738#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-01 07:39:09
|
#2738: SQLAlchemy should throw an exception if there are multiple foreign keys to
relate
-------------------------+-----------------------------------------
Reporter: Svenstaro | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: cextensions | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
-------------------------+-----------------------------------------
The attached code generates something like this:
SELECT "group".id AS group_id
FROM "group" JOIN (SELECT "user".type AS type, deriveduser.id AS id,
"user".id AS id, deriveduser.preference1_id AS preference1_id,
deriveduser.preference2_id AS preference2_id, deriveduser.preference3_id
AS preference3_id, deriveduser.group_id AS group_id, count(:param_1) AS
deriveduser_count
FROM "user" JOIN deriveduser ON "user".id = deriveduser.id GROUP BY
deriveduser.group_id) AS anon_1 ON "group".id = anon_1.preference1_id AND
"group".id = anon_1.preference2_id AND "group".id = anon_1.preference3_id
AND "group".id = anon_1.group_id
Isn't this actually ill behavior that should throw an exception if the
join is ambiguous as it is in this case?
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2738>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-05-31 19:40:00
|
#2587: flatten joined-inheritance join targets on individual tables
------------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: orm | Severity: very major - up to 2 days
Resolution: | Keywords:
Progress State: in queue |
------------------------------+---------------------------------------
Comment (by zzzeek):
how to make query(A).join(A.joinedinh) work:
{{{
#!diff
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 79fd61c..3d7f376 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -1871,10 +1871,7 @@ class Query(object):
aliased_entity = right_mapper and \
not right_is_aliased and \
(
- right_mapper.with_polymorphic or
- isinstance(
- right_mapper.mapped_table,
- expression.Join)
+ right_mapper.with_polymorphic
)
if not need_adapter and (create_aliases or aliased_entity):
diff --git a/lib/sqlalchemy/sql/expression.py
b/lib/sqlalchemy/sql/expression.py
index 5820cb1..b95cf14 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -4215,7 +4215,8 @@ class FromGrouping(FromClause):
# this could be
# self.element.foreign_keys
# see SelectableTest.test_join_condition
- return set()
+ return self.element.foreign_keys
+# return set()
@property
def _hide_froms(self):
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2587#comment:6>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-05-31 19:32:13
|
#2587: flatten joined-inheritance join targets on individual tables
------------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: orm | Severity: very major - up to 2 days
Resolution: | Keywords:
Progress State: in queue |
------------------------------+---------------------------------------
Comment (by zzzeek):
that unnested call goes right here:
{{{
#!diff
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index ddc0dd8..3e5a607 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -501,7 +501,7 @@ class AliasedClass(object):
use_mapper_path=False):
mapper = _class_to_mapper(cls)
if alias is None:
- alias = mapper._with_polymorphic_selectable.alias(name=name)
+ alias =
mapper._with_polymorphic_selectable.unnested_alias(name=name)
self._aliased_insp = AliasedInsp(
self,
mapper,
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2587#comment:5>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-05-31 19:28:35
|
#2587: flatten joined-inheritance join targets on individual tables
------------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: orm | Severity: very major - up to 2 days
Resolution: | Keywords:
Progress State: in queue |
------------------------------+---------------------------------------
Comment (by zzzeek):
also:
when we join from A to a mapper "B join C" and we are aliasing, as in
eager loading:
{{{
orm_join(A, BC.alias())
SELECT a.id AS a_id, anon_1.b_id AS anon_1_b_id, anon_1.c_id AS
anon_1_c_id
FROM a JOIN (
SELECT b.id AS b_id, c.id AS c_id FROM
b JOIN c ON b.id=c.id
) AS anon_1 ON a.id=anon_1.b_id
}}}
we can do the "flattened" thing, where we don't create the subquery, but
again produce the same labels:
{{{
orm_join(A, BC.unnessted_alias())
SELECT a.id AS a_id, anon_1_b.id AS anon_1_b_id, anon_1_c.id AS
anon_1_c_id
FROM a JOIN (b AS anon_1_b JOIN c AS anon_1_c ON anon_1_b.id=anon_1_c.id)
ON a.id=anon_1_b_id
}}}
again, we get the same labeling conventions and everything, we here just
change how `Alias` represents its contents. Perhaps `JoinedAlias`
subclass.
The above query, when run through the previous compiler "subquery the
nested joins" converter, gets:
{{{
SELECT a.id AS a_id, anon_2.anon_1_b_id AS anon_1_b_id, anon_2.anon_1_c_id
AS anon_1_c_id
FROM a JOIN (
SELECT anon_1_b.id AS anon_1_b_id, anon_1_c.id AS anon_1_c_id
FROM b AS anon_1_b JOIN c AS anon_1_c ON anon_1_b.id=anon_1_c.id
) AS anon_2
ON a.id=anon_2.anon_1_b_id
}}}
and it works
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2587#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-05-31 19:09:21
|
#2587: flatten joined-inheritance join targets on individual tables
------------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: orm | Severity: very major - up to 2 days
Resolution: | Keywords:
Progress State: in queue |
------------------------------+---------------------------------------
Comment (by zzzeek):
another thought. push it into the compiler (copied from #2369, applies
more closely here).
{{{
#!sql
# nested join:
SELECT
a.x AS a_x, a.y AS a_y,
b.x AS b_x, b.y AS b_y,
c.x AS c_x, c.y AS c_y
FROM a JOIN (
b JOIN c on b.id=c.id
) on a.id=b.id
# currently, ORM would rewrite this as:
SELECT
a.x AS a_x, a.y AS a_y,
anon_1.b_x AS anon_1_b_x,
anon_1.b_y AS anon_1_b_y,
anon_1.c_x AS anon_1_c_x,
anon_1.c_y AS anon_1_c_y
FROM a JOIN (
SELECT b.id AS b_id, b.x AS b_x, b.y AS b_y, c.x AS c_x,
c.y AS c_y
FROM b JOIN c on b.id=c.id
) AS anon_1 on a.id=anon_1.b_id
# but if we could get compiler to rewrite as:
SELECT
a.x AS a_x, a.y AS a_y,
anon_1.b_x AS b_x,
anon_1.b_y AS b_y,
anon_1.c_x AS c_x,
anon_1.c_y AS c_y
FROM a JOIN (
SELECT b.id AS b_id, b.x AS b_x, b.y AS b_y, c.x AS c_x,
c.y AS c_y
FROM b JOIN c on b.id=c.id
) AS anon_1 on a.id=anon_1.b_id
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2587#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-05-31 19:04:42
|
#2369: many-to-many + single table joined eager fails since we don't parenthesize
joins
---------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.0
Component: orm | Severity: very major - up to 2 days
Resolution: | Keywords:
Progress State: in queue |
---------------------------+---------------------------------------
Comment (by zzzeek):
another thought. push it into the compiler.
{{{
#!sql
# nested join:
SELECT
a.x AS a_x, a.y AS a_y,
b.x AS b_x, b.y AS b_y,
c.x AS c_x, c.y AS c_y
FROM a JOIN (
b JOIN c on b.id=c.id
) on a.id=b.id
# currently, ORM would rewrite this as:
SELECT
a.x AS a_x, a.y AS a_y,
anon_1.b_x AS anon_1_b_x,
anon_1.b_y AS anon_1_b_y,
anon_1.c_x AS anon_1_c_x,
anon_1.c_y AS anon_1_c_y
FROM a JOIN (
SELECT b.id AS b_id, b.x AS b_x, b.y AS b_y, c.x AS c_x,
c.y AS c_y
FROM b JOIN c on b.id=c.id
) AS anon_1 on a.id=anon_1.b_id
# but if we could get compiler to rewrite as:
SELECT
a.x AS a_x, a.y AS a_y,
anon_1.b_x AS b_x,
anon_1.b_y AS b_y,
anon_1.c_x AS c_x,
anon_1.c_y AS c_y
FROM a JOIN (
SELECT b.id AS b_id, b.x AS b_x, b.y AS b_y, c.x AS c_x,
c.y AS c_y
FROM b JOIN c on b.id=c.id
) AS anon_1 on a.id=anon_1.b_id
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2369#comment:6>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|