sqlalchemy-tickets Mailing List for SQLAlchemy (Page 91)
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-15 19:30:21
|
#2759: query._adapt_polymorphic_element should try to adapt based on entities
before tables
-----------------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: closed
Priority: highest | Milestone: 0.8.xx
Component: orm | Severity: minor - half an hour
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+----------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* status_field: in progress => completed/closed
Comment:
rb92007da7d9cd7453a master
raee826890c7570fcf39 rabd17f4daffd2f9 0.8
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2759#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-15 19:01:03
|
#2759: query._adapt_polymorphic_element should try to adapt based on entities
before tables
---------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: highest | Milestone: 0.8.xx
Component: orm | Severity: minor - half an hour
Keywords: | Progress State: in progress
---------------------+---------------------------------------
{{{
#!python
from sqlalchemy import *
from sqlalchemy.ext.declarative.api import declarative_base
from sqlalchemy.orm import *
Base = declarative_base()
class A(Base):
__tablename__ = 'a'
id = Column(Integer, primary_key=True)
name = Column(String(20), nullable=False)
class B(A):
__tablename__ = 'b'
id = Column(Integer, ForeignKey('a.id'), primary_key=True)
class C(A):
__tablename__ = 'c'
id = Column(Integer, ForeignKey('a.id'), primary_key=True)
bid = Column(Integer, ForeignKey('b.id'))
class D(A):
__tablename__ = 'd'
id = Column(Integer, ForeignKey('a.id'), primary_key=True)
cid = Column(Integer, ForeignKey('b.id'))
s = Session()
q = s.query(B.name, C.name, D.name).select_from(B).\
join(C, C.bid == B.id).\
join(D, D.cid == C.id)
btoc = q._from_obj[0].left
ac_adapted = btoc.right.element.left
c_adapted = btoc.right.element.right
assert ac_adapted.element is A.__table__
assert c_adapted.element is C.__table__
ctod = q._from_obj[0].right
ad_adapted = ctod.left
d_adapted = ctod.right
assert ad_adapted.element is A.__table__
assert d_adapted.element is D.__table__
bname, cname, dname = q._entities
b_name_adapted = bname._resolve_expr_against_query_aliases(q,
bname.column, None)
c_name_adapted = cname._resolve_expr_against_query_aliases(q,
cname.column, None)
d_name_adapted = dname._resolve_expr_against_query_aliases(q,
dname.column, None)
assert bool(b_name_adapted == A.__table__.c.name)
assert bool(c_name_adapted == ac_adapted.c.name)
assert bool(d_name_adapted == ad_adapted.c.name)
assert str(q.with_labels().statement.compile()).startswith(
"SELECT a.name AS a_name, a_1.name AS a_1_name, a_2.name AS
a_2_name")
}}}
patch:
{{{
#!diff
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -203,12 +203,17 @@ class Query(object):
self._polymorphic_adapters.pop(m.local_table, None)
def _adapt_polymorphic_element(self, element):
- if isinstance(element, expression.FromClause):
- search = element
- elif hasattr(element, 'table'):
- search = element.table
- else:
- search = None
+ search = None
+ if "parententity" in element._annotations:
+ search = element._annotations['parententity']
+ if search not in self._polymorphic_adapters:
+ search = None
+
+ if search is None:
+ if isinstance(element, expression.FromClause):
+ search = element
+ elif hasattr(element, 'table'):
+ search = element.table
if search is not None:
alias = self._polymorphic_adapters.get(search, None)
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2759>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-12 20:24:40
|
#1939: Automatic expiration of related properties (objects or collections), i.e.
when the FK attribute changes. you know, this thing.
-----------------------------------+-------------------------------
Reporter: kentbower | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.x.xx
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: not decided upon |
-----------------------------------+-------------------------------
Comment (by zzzeek):
recipe added, [wiki:UsageRecipes/ExpireRelationshipOnFKChange]
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1939#comment:15>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-11 14:18:10
|
#2757: Firebird types are not translated correctly
------------------------------+----------------------------------
Reporter: rstuart4133 | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.8.xx
Component: firebird | Severity: minor - half an hour
Resolution: | Keywords:
Progress State: in queue |
------------------------------+----------------------------------
Changes (by zzzeek):
* priority: medium => high
* milestone: => 0.8.xx
* severity: no triage selected yet => minor - half an hour
* status_field: awaiting triage => in queue
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2757#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-11 14:16:42
|
#2758: Time field types
-----------------------------------+------------------------------------
Reporter: iurie | Owner:
Type: defect | Status: closed
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected yet
Resolution: worksforme | Keywords:
Progress State: completed/closed |
-----------------------------------+------------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => worksforme
* status_field: awaiting triage => completed/closed
Comment:
this issue was resolved in r5f0f975b8b105e151a110.
please upgrade to 0.8 if you're going to run Python 3 + mysqlconnector,
there's no more 0.7 releases planned.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2758#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-11 14:08:55
|
#2757: Firebird types are not translated correctly
----------------------------------+------------------------------------
Reporter: rstuart4133 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: firebird | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by zzzeek):
closed #1860 as duplicate
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2757#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-11 14:08:34
|
#1860: reflects on firebird INTEGER as BIGINT, BIGINT as NUMERIC
-----------------------------------+----------------------------------
Reporter: guest | Owner: zzzeek
Type: defect | Status: closed
Priority: medium | Milestone: 0.x.xx
Component: firebird | Severity: minor - half an hour
Resolution: duplicate | Keywords:
Progress State: completed/closed |
-----------------------------------+----------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => duplicate
* status_field: needs questions answered => completed/closed
Comment:
see #2757 which has a patch
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1860#comment:5>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-11 08:26:01
|
#2758: Time field types
--------------------+-----------------------------------------
Reporter: iurie | Owner:
Type: defect | Status: new
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
--------------------+-----------------------------------------
Running SQLAlchemy 0.7.10 + MySqlConnector 1.0.10
File "C:\Python33\lib\site-packages\sqlalchemy\orm\query.py", line 2349,
in instances
rows = [process[0](row, None) for row in fetch]
File "C:\Python33\lib\site-packages\sqlalchemy\orm\query.py", line 2349,
in <listcomp>
rows = [process[0](row, None) for row in fetch]
File "C:\Python33\lib\site-packages\sqlalchemy\orm\mapper.py", line
2120, in _instance
populate_state(state, dict_, row, isnew, only_load_props)
File "C:\Python33\lib\site-packages\sqlalchemy\orm\mapper.py", line
1974, in populate_state
populator(state, dict_, row)
File "C:\Python33\lib\site-packages\sqlalchemy\orm\strategies.py", line
150, in fetch_col
dict_[key] = row[col]
File "C:\Python33\lib\site-packages\sqlalchemy\engine\base.py", line
2635, in __getitem__
return processor(self._row[index])
File "C:\Python33\lib\site-packages\sqlalchemy\dialects\mysql\base.py",
line 676, in process
return time(minutes / 60, minutes % 60, seconds - minutes * 60)
TypeError: integer argument expected, got float
As can be seen from trace datetime.time waits for an integer value not
float so args need to be cast.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2758>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-11 06:50:26
|
#2757: Firebird types are not translated correctly
-------------------------+-----------------------------------------
Reporter: rstuart4133 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: firebird | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
-------------------------+-----------------------------------------
The firebird backend translates Firebird's types incorrectly.
Firstly, a firebird LONG is 32 bits, a INT64 is 64 bigs. Secondly, all
firebird integer types have a precision and scale. If they are 0 the raw
type can be used, otherwise NUMERIC must be used.
The attached patch fixes the problem. The patch is for 0.7.8, but master
looks the same.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2757>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-10 17:54:34
|
#2755: composite w/ aliases broken
-----------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: closed
Priority: high | Milestone: 0.8.xx
Component: orm | 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:
r6d0b2f34d2b829d92e173 0.8
rb614a24c5ddf4c7c7aa45e1eaeb3f master
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2755#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-10 17:53:34
|
#2754: Ordering by composite column gives sqlite3 OperationalError
-----------------------------------+--------------------------------
Reporter: sorcererofdm | Owner: zzzeek
Type: defect | Status: closed
Priority: highest | Milestone: 0.8.xx
Component: orm | Severity: major - 1-3 hours
Resolution: fixed | Keywords: composite order by
Progress State: completed/closed |
-----------------------------------+--------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* status_field: in progress => completed/closed
Comment:
r9dba65b381a53d01 0.8
r58c8c4ce77d1e0e9 master
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2754#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-10 17:36:27
|
#2756: enhancements for PropComparator adaption vs. AliasedClass, etc.
--------------------+------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: task | Status: new
Priority: high | Milestone: 0.9.0
Component: orm | Severity: major - 1-3 hours
Keywords: | Progress State: in queue
--------------------+------------------------------------
in descriptor_props.py:
{{{
@util.memoized_property
def _comparable_elements(self):
if self.adapter:
# we need to do a little fudging here because
# the adapter function we're given only accepts
# ColumnElements, but our prop._comparable_elements is
returning
# InstrumentedAttribute, because we support the use case
# of composites that refer to relationships. The better
# solution here is to open up how AliasedClass interacts
# with PropComparators so more context is available.
return [self.adapter(x.__clause_element__())
for x in self.prop._comparable_elements]
else:
return self.prop._comparable_elements
}}}
determine if we can change the signature of `PropComparator.adapted` to
expect a more contextual object. Would need to see who calls this method
besides `AliasedClass`, might produce some backwards-incompatible
behavior.
See also #2755, #2754.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2756>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-10 16:58:28
|
#2755: composite w/ aliases broken
--------------------+------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.8.xx
Component: orm | Severity: major - 1-3 hours
Keywords: | Progress State: in progress
--------------------+------------------------------------
{{{
def test_comparator_aliased(self):
+ Graph, Edge, Point = (self.classes.Graph,
+ self.classes.Edge,
+ self.classes.Point)
+
+ sess = self._fixture()
+
+ g = sess.query(Graph).first()
+ ea = aliased(Edge)
+ assert sess.query(ea).\
+ filter(ea.start != Point(3, 4)).first() is \
+ g.edges[1]
+
+
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2755>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-10 16:34:56
|
#2753: rewrite strings of same-outered joins to be flat?
-----------------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: closed
Priority: medium | Milestone: 0.9.0
Component: sql | Severity: minor - half an hour
Resolution: worksforme | Keywords:
Progress State: completed/closed |
-----------------------------------+----------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => worksforme
* status_field: in queue => completed/closed
Comment:
nah, user says he's getting 100% good query plans with nesting on MySQL,
we're good, don't care much about SQLite here.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2753#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-10 03:21:43
|
#2754: Ordering by composite column gives sqlite3 OperationalError
-------------------------------+--------------------------------
Reporter: sorcererofdm | Owner: zzzeek
Type: defect | Status: new
Priority: highest | Milestone: 0.8.xx
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords: composite order by
Progress State: in progress |
-------------------------------+--------------------------------
Changes (by zzzeek):
* type: enhancement => defect
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2754#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-10 03:21:34
|
#2754: Ordering by composite column gives sqlite3 OperationalError
-------------------------------+--------------------------------
Reporter: sorcererofdm | Owner: zzzeek
Type: enhancement | Status: new
Priority: highest | Milestone: 0.8.xx
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords: composite order by
Progress State: in progress |
-------------------------------+--------------------------------
Changes (by zzzeek):
* priority: medium => highest
* milestone: 0.9.0 => 0.8.xx
* severity: minor - half an hour => major - 1-3 hours
* status_field: in queue => in progress
Comment:
this can be a bug fix but there's a lot wrong with composites and
aliased() right now that has to be bundled with it.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2754#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-10 02:54:15
|
#2754: Ordering by composite column gives sqlite3 OperationalError
-------------------------------+----------------------------------
Reporter: sorcererofdm | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: orm | Severity: minor - half an hour
Resolution: | Keywords: composite order by
Progress State: in queue |
-------------------------------+----------------------------------
Changes (by zzzeek):
* keywords: sqlite, declarative, composite columns, order_by clause =>
composite order by
* type: defect => enhancement
* milestone: => 0.9.0
* component: declarative => orm
* status_field: awaiting triage => in queue
Comment:
OK ordering by a composite attribute like that hasn't been considered
before, so a bit of an enhancement. that it works at all is a surprise.
what is really desired here is if a ClauseList (which is what
Vertex.start.__clause_element__() is) is passed to order_by(), order_by()
figures out to unwrap the clause list. This would be a fairly
widespread behavior so some care would need to be applied to make sure it
doesn't go too far (such as ordering by a Tuple).
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2754#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-10 02:23:41
|
#2754: Ordering by composite column gives sqlite3 OperationalError
-------------------------------------+-------------------------------------
Reporter: sorcererofdm | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: declarative | Severity: minor - half an
Keywords: sqlite, declarative, | hour
composite columns, order_by | Progress State: awaiting triage
clause |
-------------------------------------+-------------------------------------
Right now query.order_by(composite) gives a sqlite3 operational error,
because the rendered SQL is ORDER BY (composite_val1, composite_val2,
composite_val3) instead of ORDER BY composite_val1, composite_val2,
composite_val3. (The parenthesis is causing an error)
For example, consider the code below modified from the documentation.
{{{
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative.api import declarative_base
from sqlalchemy.orm import relationship, composite
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, String
import itertools
Base = declarative_base()
class Point(object):
def __init__(self, x, y):
self.x = x
self.y = y
def __composite_values__(self):
return self.x, self.y
def __repr__(self):
return "Point(x=%r, y=%r)" % (self.x, self.y)
def __eq__(self, other):
return isinstance(other, Point) and \
other.x == self.x and \
other.y == self.y
def __ne__(self, other):
return not self.__eq__(other)
class Vertex(Base):
__tablename__ = 'vertice'
id = Column(Integer, primary_key=True)
x1 = Column(Integer)
y1 = Column(Integer)
x2 = Column(Integer)
y2 = Column(Integer)
start = composite(Point, x1, y1)
end = composite(Point, x2, y2)
if __name__ == '__main__':
engine = create_engine('sqlite:///:memory:')
Session = sessionmaker(engine)
session = Session()
Base.metadata.create_all(engine)
pts = [((1, 2), (3, 4)),
((2, 3), (1, 5)),
((0, 5), (6, 3))]
session.add_all(itertools.starmap(
lambda a, b: Vertex(start=Point(*a),
end=Point(*b)),
pts))
}}}
We run the following in the console:
{{{
>>> q = session.query(Vertex).order_by(Vertex.start)
>>> q
Out[1]: <sqlalchemy.orm.query.Query at 0x3bc1f30>
>>> str(q)
Out[1]: 'SELECT vertice.id AS vertice_id, vertice.x1 AS vertice_x1,
vertice.y1 AS vertice_y1, vertice.x2 AS vertice_x2, vertice.y2 AS
vertice_y2 \nFROM vertice ORDER BY (vertice.x1, vertice.y1)'
>>> q.all()
Traceback (most recent call last):
File "C:\Anaconda\Lib\site-packages\IPython\core\interactiveshell.py",
line 2731, in run_code
exec code_obj in self.user_global_ns, self.user_ns
File "<ipython-input-1-511354a8265d>", line 1, in <module>
q.all()
File "C:\Python27\lib\site-
packages\sqlalchemy-0.8.0-py2.7.egg\sqlalchemy\orm\query.py", line 2140,
in all
return list(self)
File "C:\Python27\lib\site-
packages\sqlalchemy-0.8.0-py2.7.egg\sqlalchemy\orm\query.py", line 2252,
in __iter__
return self._execute_and_instances(context)
File "C:\Python27\lib\site-
packages\sqlalchemy-0.8.0-py2.7.egg\sqlalchemy\orm\query.py", line 2267,
in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "C:\Python27\lib\site-
packages\sqlalchemy-0.8.0-py2.7.egg\sqlalchemy\engine\base.py", line 664,
in execute
params)
File "C:\Python27\lib\site-
packages\sqlalchemy-0.8.0-py2.7.egg\sqlalchemy\engine\base.py", line 764,
in _execute_clauseelement
compiled_sql, distilled_params
File "C:\Python27\lib\site-
packages\sqlalchemy-0.8.0-py2.7.egg\sqlalchemy\engine\base.py", line 878,
in _execute_context
context)
File "C:\Python27\lib\site-
packages\sqlalchemy-0.8.0-py2.7.egg\sqlalchemy\engine\base.py", line 871,
in _execute_context
context)
File "C:\Python27\lib\site-
packages\sqlalchemy-0.8.0-py2.7.egg\sqlalchemy\engine\default.py", line
320, in do_execute
cursor.execute(statement, parameters)
OperationalError: (OperationalError) near ",": syntax error u'SELECT
vertice.id AS vertice_id, vertice.x1 AS vertice_x1, vertice.y1 AS
vertice_y1, vertice.x2 AS vertice_x2, vertice.y2 AS vertice_y2 \nFROM
vertice ORDER BY (vertice.x1, vertice.y1)' ()
}}}
Whereas, if we directly execute the correct SQL, without the parenthesis,
{{{
>>> session.execute(u'SELECT vertice.id AS vertice_id, vertice.x1 AS
vertice_x1, vertice.y1 AS vertice_y1, vertice.x2 AS vertice_x2, vertice.y2
AS vertice_y2 \nFROM vertice ORDER BY vertice.x1, vertice.y1' )
Out[1]: <sqlalchemy.engine.result.ResultProxy at 0x3bc1d70>
>>> _.fetchall()
Out[1]: [(3, 0, 5, 6, 3), (1, 1, 2, 3, 4), (2, 2, 3, 1, 5)]
}}}
We get the right result back, albeit not wrapped in Vertex objects
So it seems like a fairly simple bug.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2754>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-10 00:57:44
|
#2753: rewrite strings of same-outered joins to be flat?
-------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: sql | Severity: minor - half an hour
Keywords: | Progress State: in queue
-------------------------+---------------------------------------
i.e.:
a left outer join (b left outer join c)
have the compiler reassemble the joins before rendering based on them all
being "outer" or "inner".
then, many of the joins that the SQLite compiler turns into subqueries
won't be so.
we can always flatten out `a <J> (b <J> (c <J> (...)))`, as long as all J
are the same, right? computer scientist in the house?
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2753>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-09 20:17:56
|
#2752: have the pool participate in engine logging for commit/rollback
-----------------------------------+----------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: closed
Priority: high | Milestone: 0.8.xx
Component: pool | Severity: minor - half an hour
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+----------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* status_field: in progress => completed/closed
Comment:
having it be part of engine looks pretty bad, this is really a pool
function so I've kept it within pool logging.
r65f5887e9a824ee1b50592
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2752#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-09 19:29:57
|
#2752: have the pool participate in engine logging for commit/rollback
-------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: high | Milestone: 0.8.xx
Component: pool | Severity: minor - half an hour
Keywords: | Progress State: in progress
-------------------------+---------------------------------------
lots of people are confused by this
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2752>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 23:03:31
|
#2587: flatten joined-inheritance join targets on individual tables
-----------------------------------+--------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: closed
Priority: medium | Milestone: 0.9.0
Component: orm | Severity: refactor - over two days
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+--------------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* severity: very major - up to 2 days => refactor - over two days
* status_field: in queue => completed/closed
Comment:
it's as good as it's going to get. Also committed some tests/tweaks for
Oracle 8.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2587#comment:8>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 19:30:50
|
#2671: in place codebase for py2x, py3x
-----------------------------------+--------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: task | Status: closed
Priority: medium | Milestone: 0.9.0
Component: (none) | Severity: refactor - over two days
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+--------------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* status_field: in queue => completed/closed
Comment:
this is done, over the course of many changesets.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2671#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 19:25:05
|
#2715: add more explicit documentation/flags for the many gaerdbms DBAPI options
-----------------------------------+--------------------------------------
Reporter: moraes | Owner: zzzeek
Type: enhancement | Status: closed
Priority: medium | Milestone: 0.8.xx
Component: mysql | Severity: minor - half an hour
Resolution: fixed | Keywords: gaerdbms, mysql, dialect
Progress State: completed/closed |
-----------------------------------+--------------------------------------
Changes (by zzzeek):
* status: new => closed
* component: documentation => mysql
* resolution: => fixed
* status_field: in queue => completed/closed
Comment:
r06a2ce55a1043 0.8
diff:@d5363fc:c8f9831 master
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2715#comment:5>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2013-06-08 19:01:17
|
#2704: mysql_length doesn't work for composites
-----------------------------------+----------------------------------
Reporter: zzzeek | Owner:
Type: defect | Status: closed
Priority: medium | Milestone: 0.8.xx
Component: mysql | Severity: minor - half an hour
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+----------------------------------
Changes (by zzzeek):
* status: new => closed
* resolution: => fixed
* status_field: in queue => completed/closed
Comment:
diff:@a341e1c:a80bb53 master
diff:@45f8ff8:3f60069 0.8
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2704#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|