- EagerLoader looks more carefully for the correct Table/Join/FromClause to bind its outer join onto
- sqlite boolean datatype converts bind params from python booleans to integer
- took out assertion raise from 'name' property of CompoundSelect
the given from_obj. this makes it possible to produce custom joins and
outerjoins in queries without the main table getting added twice.
[ticket:315]
+- eagerloading is adjusted to look in more complicated from clauses
+when attaching to the query.
- added join_to and outerjoin_to transformative methods to SelectResults,
to build up join/outerjoin conditions based on property names. also
added select_from to explicitly set from_obj parameter.
+- sqlite boolean datatype converts False/True to 0/1 by default
0.2.8
- cleanup on connection methods + documentation. custom DBAPI
class SLBoolean(sqltypes.Boolean):
def get_col_spec(self):
return "BOOLEAN"
+ def convert_bind_param(self, value, dialect):
+ return value and 1 or 0
def convert_result_value(self, value, dialect):
if value is None:
return None
if hasattr(statement, '_outerjoin'):
towrap = statement._outerjoin
else:
- towrap = self.localparent.mapped_table
-
+ for (fromclause, finder) in [(x, sql_util.TableFinder(x)) for x in statement.froms]:
+ if self.localparent.mapped_table in finder:
+ towrap = fromclause
+ break
+ else:
+ raise exceptions.InvalidRequestError("EagerLoader cannot locate a clause with which to outer join to, in query '%s'" % str(statement))
+
if self.secondaryjoin is not None:
statement._outerjoin = sql.outerjoin(towrap, self.eagersecondary, self.eagerprimary).outerjoin(self.eagertarget, self.eagersecondaryjoin)
if self.order_by is False and self.secondary.default_order_by() is not None:
self.order_by(*kwargs.get('order_by', [None]))
self._col_map = {}
-# name = property(lambda s:s.keyword + " statement")
- def _foo(self):
- raise "this is a temporary assertion while we refactor SQL to not call 'name' on non-table Selectables"
- name = property(lambda s:s._foo()) #"SELECT statement")
+ name = property(lambda s:s.keyword + " statement")
def _locate_oid_column(self):
return self.selects[0].oid_column
"""forms the base for INSERT, UPDATE, and DELETE statements."""
def _process_colparams(self, parameters):
"""receives the "values" of an INSERT or UPDATE statement and constructs
- appropriate ind parameters."""
+ appropriate bind parameters."""
if parameters is None:
return None