Mike Bayer [Thu, 15 Oct 2009 20:15:19 +0000 (20:15 +0000)]
- query.from_self(), query.union(), others which do a
"SELECT * from (SELECT...)" type of nesting will do
a better job translating column expressions within the subquery
to the columns clause of the outer query. This is
potentially backwards incompatible with 0.5, in that this
may break queries with literal expressions that do not have labels
applied (i.e. literal('foo'), etc.)
[ticket:1568]
Mike Bayer [Thu, 15 Oct 2009 19:08:35 +0000 (19:08 +0000)]
- mapping to a select() construct now requires that you
make an alias() out of it distinctly. This to eliminate
confusion over such issues as [ticket:1542]
Mike Bayer [Thu, 15 Oct 2009 18:41:02 +0000 (18:41 +0000)]
- an executemany() now requires that all bound parameter
sets require that all keys are present which are
present in the first bound parameter set. The structure
and behavior of an insert/update statement is very much
determined by the first parameter set, including which
defaults are going to fire off, and a minimum of
guesswork is performed with all the rest so that performance
is not impacted. For this reason defaults would otherwise
silently "fail" for missing parameters, so this is now guarded
against. [ticket:1566]
Mike Bayer [Thu, 15 Oct 2009 16:09:59 +0000 (16:09 +0000)]
- DefaultRunner and subclasses have been removed. The job
of this object has been simplified and moved into
ExecutionContext. Dialects which support sequences should
add a `fire_sequence()` method to their execution context
implementation. [ticket:1566]
Mike Bayer [Mon, 12 Oct 2009 22:29:08 +0000 (22:29 +0000)]
- `expression.null()` is fully understood the same way
None is when comparing an object/collection-referencing
attribute within query.filter(), filter_by(), etc.
[ticket:1415]
Mike Bayer [Mon, 12 Oct 2009 00:11:00 +0000 (00:11 +0000)]
- added "ddl" argument to the "on" callable of DDLElement [ticket:1538]
- fixed the imports in the "postgres" cleanup dialect
- renamed "schema_item" attribute/argument of DDLElement
to "target".
Mike Bayer [Sun, 11 Oct 2009 17:16:53 +0000 (17:16 +0000)]
- RowProxy objects are now pickleable, i.e. the object returned
by result.fetchone(), result.fetchall() etc.
- the "named tuple" objects returned when iterating a
Query() are now pickleable.
Mike Bayer [Sat, 10 Oct 2009 16:51:05 +0000 (16:51 +0000)]
- the setuptools entrypoint for external dialects is now
called "sqlalchemy.dialects". external dialects need to be changed to work with 0.6 in any case.
Mike Bayer [Mon, 5 Oct 2009 22:11:06 +0000 (22:11 +0000)]
- the mechanics of "backref" have been fully merged into the
finer grained "back_populates" system, and take place entirely
within the _generate_backref() method of RelationProperty. This
makes the initialization procedure of RelationProperty
simpler and allows easier propagation of settings (such as from
subclasses of RelationProperty) into the reverse reference.
The internal BackRef() is gone and backref() returns a plain
tuple that is understood by RelationProperty.
Mike Bayer [Fri, 2 Oct 2009 22:23:30 +0000 (22:23 +0000)]
- query.options() now only propagate to loaded objects
for potential further sub-loads only for options where
such behavior is relevant, keeping
various unserializable options like those generated
by contains_eager() out of individual instance states.
[ticket:1553]
Mike Bayer [Thu, 1 Oct 2009 23:00:02 +0000 (23:00 +0000)]
- boolean, int, and float arguments count as "cache key" values for inspector info_cache()
- added awareness of sqlite implicit auto indexes [ticket:1551]
Philip Jenvey [Thu, 24 Sep 2009 02:11:56 +0000 (02:11 +0000)]
merge from branches/clauseelement-nonzero
adds a __nonzero__ to _BinaryExpression to avoid faulty comparisons during hash
collisions (which only occur on Jython)
fixes #1547
Mike Bayer [Fri, 18 Sep 2009 20:04:45 +0000 (20:04 +0000)]
- query.join() has been reworked to provide more consistent
behavior and more flexibility (includes [ticket:1537])
- query.select_from() accepts multiple clauses to produce
multiple comma separated entries within the FROM clause.
Useful when selecting from multiple-homed join() clauses.
Mike Bayer [Wed, 16 Sep 2009 19:48:22 +0000 (19:48 +0000)]
- contains_eager() now works with the automatically
generated subquery that results when you say
"query(Parent).join(Parent.somejoinedsubclass)", i.e.
when Parent joins to a joined-table-inheritance subclass.
Previously contains_eager() would erroneously add the
subclass table to the query separately producing a
cartesian product. An example is in the ticket
description. [ticket:1543]
Revisited Firebird's keywords set
Several keywords were missing, and various words were wrongly included
in the set. I took the current list of keywords out of "keywords.cpp", filtering
out effective reserverd words with a simple script that created a dummy table
with a field named after each word.
While this fixes a few tests (for example, those creating a table with a "start"
field, a Firebird reserverd words not previously registered as such), it may
introduce a backward incompatibility with previous SA releases: should this be
not wanted, I will add previous non-reserved-words to the set.
Mike Bayer [Sat, 12 Sep 2009 20:28:10 +0000 (20:28 +0000)]
- Table objects declared in the MetaData can now be used
in string expressions sent to primaryjoin/secondaryjoin/
secondary - the name is pulled from the MetaData of the
declarative base. [ticket:1527]
Mike Bayer [Sat, 12 Sep 2009 19:59:39 +0000 (19:59 +0000)]
- Added an assertion that prevents a @validates function
or other AttributeExtension from loading an unloaded
collection such that internal state may be corrupted.
[ticket:1526]
Mike Bayer [Sat, 5 Sep 2009 03:29:20 +0000 (03:29 +0000)]
- the Binary type now returns data as a Python string
(or a "bytes" type in Python 3), instead of the built-
in "buffer" type. This allows symmetric round trips
of binary data. [ticket:1524]
Mike Bayer [Tue, 1 Sep 2009 22:55:59 +0000 (22:55 +0000)]
- Fixed bug which prevented two entities from mutually
replacing each other's primary key values within a single
flush() for some orderings of operations. [ticket:1519]
Mike Bayer [Tue, 1 Sep 2009 22:26:23 +0000 (22:26 +0000)]
- A column can be added to a joined-table subclass after
the class has been constructed (i.e. via class-level
attribute assignment). The column is added to the underlying
Table as always, but now the mapper will rebuild its
"join" to include the new column, instead of raising
an error about "no such column, use column_property()
instead". [ticket:1523]
- added an additional test in test_mappers for "added nonexistent column",
even though this test is already in test_query its more appropriate within
"mapper configuration" tests.
Mike Bayer [Tue, 1 Sep 2009 22:14:22 +0000 (22:14 +0000)]
- Fixed the error message for "could not find a FROM clause"
in query.join() which would fail to issue correctly
if the query was against a pure SQL construct.
[ticket:1522]
Mike Bayer [Mon, 31 Aug 2009 20:54:19 +0000 (20:54 +0000)]
- the allow_null_pks flag on mapper() is deprecated, and
the feature is turned "on" by default. This means that
a row which has a non-null value for any of its primary key
columns will be considered an identity. The need for this
scenario typically only occurs when mapping to an outer join.
[ticket:1339]
- streamlined the NULL check to use set operations
Mike Bayer [Mon, 31 Aug 2009 20:38:14 +0000 (20:38 +0000)]
- Inserting NULL into a primary key + foreign key column
will allow the "not null constraint" error to raise,
not an attempt to execute a nonexistent "col_id_seq"
sequence. [ticket:1516]
- autoincrement SELECT statements, i.e. those which
select from a procedure that modifies rows, now work
with server-side cursor mode (the named cursor isn't
used for such statements.)
Gaëtan de Menten [Mon, 31 Aug 2009 15:14:28 +0000 (15:14 +0000)]
Remove NCLOB from types.__all__, since it's not defined there. Not sure if this
is the proper fix but the former situation made it impossible to do "from
sqlalchemy.types import *", which Elixir does.
Mike Bayer [Fri, 28 Aug 2009 20:29:08 +0000 (20:29 +0000)]
- Fixed an obscure issue whereby a joined-table subclass
with a self-referential eager load on the base class
would populate the related object's "subclass" table with
data from the "subclass" table of the parent.
[ticket:1485]
Mike Bayer [Mon, 10 Aug 2009 04:48:00 +0000 (04:48 +0000)]
- simplify MySQLIdentifierPreparer into standard pattern,
thus allowing easy subclassing
- move % sign logic for MySQLIdentifierPreparer into MySQLdb dialect
- paramterize the escape/unescape quote char in IdentifierPreparer
- cut out MySQLTableDefinitionParser cruft
Mike Bayer [Sun, 9 Aug 2009 23:46:06 +0000 (23:46 +0000)]
- the Oracle dialect now features NUMBER which intends
to act justlike Oracle's NUMBER type. It is the primary
numeric type returned by table reflection and attempts
to return Decimal()/float/int based on the precision/scale
parameters. [ticket:885]
Mike Bayer [Sun, 9 Aug 2009 22:11:40 +0000 (22:11 +0000)]
- PG: somewhat better support for % signs in table/column names;
psycopg2 can't handle a bind parameter name of
%(foobar)s however and SQLA doesn't want to add overhead
just to treat that one non-existent use case.
[ticket:1279]
- MySQL: somewhat better support for % signs in table/column names;
MySQLdb can't handle % signs in SQL when executemany() is used,
and SQLA doesn't want to add overhead just to treat that one
non-existent use case. [ticket:1279]
Mike Bayer [Sat, 8 Aug 2009 22:21:02 +0000 (22:21 +0000)]
- added **kw to ClauseElement.compare(), so that we can smarten up the "use_get" operation
- many-to-one relation to a joined-table subclass now uses get()
for a simple load (known as the "use_get" condition),
i.e. Related->Sub(Base), without the need
to redefine the primaryjoin condition in terms of the base
table. [ticket:1186]
- specifying a foreign key with a declarative column,
i.e. ForeignKey(MyRelatedClass.id) doesn't break the "use_get"
condition from taking place [ticket:1492]
Mike Bayer [Sat, 8 Aug 2009 15:26:43 +0000 (15:26 +0000)]
- turned on auto-returning for oracle, some errors
- added make_transient() [ticket:1052]
- ongoing refactor of compiler _get_colparams() (more to come)