15
Fixed erroneous self_group() call in expression package.
19
:released: Sat Jan 16 2010
25
The copy() method on Column now supports uninitialized,
26
unnamed Column objects. This allows easy creation of
27
declarative helpers which place common columns on multiple
34
Default generators like Sequence() translate correctly
35
across a copy() operation.
41
Sequence() and other DefaultGenerator objects are accepted
42
as the value for the "default" and "onupdate" keyword
43
arguments of Column, in addition to being accepted
50
Fixed a column arithmetic bug that affected column
51
correspondence for cloned selectables which contain
52
free-standing column expressions. This bug is
53
generally only noticeable when exercising newer
54
ORM behavior only availble in 0.6 via,
55
but is more correct at the SQL expression level
62
The extract() function, which was slightly improved in
63
0.5.7, needed a lot more work to generate the correct
64
typecast (the typecasts appear to be necessary in PG's
65
EXTRACT quite a lot of the time). The typecast is
66
now generated using a rule dictionary based
67
on PG's documentation for date/time/interval arithmetic.
68
It also accepts text() constructs again, which was broken
75
Recognize more errors as disconnections.
79
:released: Sat Dec 26 2009
85
contains_eager() now works with the automatically
86
generated subquery that results when you say
87
"query(Parent).join(Parent.somejoinedsubclass)", i.e.
88
when Parent joins to a joined-table-inheritance subclass.
89
Previously contains_eager() would erroneously add the
90
subclass table to the query separately producing a
91
cartesian product. An example is in the ticket
98
query.options() now only propagate to loaded objects
99
for potential further sub-loads only for options where
100
such behavior is relevant, keeping
101
various unserializable options like those generated
102
by contains_eager() out of individual instance states.
108
Session.execute() now locates table- and
109
mapper-specific binds based on a passed
110
in expression which is an insert()/update()/delete()
117
Session.merge() now properly overwrites a many-to-one or
118
uselist=False attribute to None if the attribute
119
is also None in the given object to be merged.
125
Fixed a needless select which would occur when merging
126
transient objects that contained a null primary key
133
Mutable collection passed to the "extension" attribute
134
of relation(), column_property() etc. will not be mutated
135
or shared among multiple instrumentation calls, preventing
136
duplicate extensions, such as backref populators,
137
from being inserted into the list.
143
Fixed the call to get_committed_value() on CompositeProperty.
149
Fixed bug where Query would crash if a join() with no clear
150
"left" side were called when a non-mapped column entity
151
appeared in the columns list.
157
Fixed bug whereby composite columns wouldn't load properly
158
when configured on a joined-table subclass, introduced in
159
version 0.5.6 as a result of the fix for. thx to Scott Torborg.
165
The "use get" behavior of many-to-one relations, i.e. that a
166
lazy load will fallback to the possibly cached query.get()
167
value, now works across join conditions where the two compared
168
types are not exactly the same class, but share the same
169
"affinity" - i.e. Integer and SmallInteger. Also allows
170
combinations of reflected and non-reflected types to work
171
with 0.5 style type reflection, such as PGText/Text (note 0.6
172
reflects types as their generic versions).
178
Fixed bug in query.update() when passing Cls.attribute
179
as keys in the value dict and using synchronize_session='expire'
186
Fixed bug in two-phase transaction whereby commit() method
187
didn't set the full state which allows subsequent close()
194
Fixed the "numeric" paramstyle, which apparently is the
195
default paramstyle used by Informixdb.
201
Repeat expressions in the columns clause of a select
202
are deduped based on the identity of each clause element,
203
not the actual string. This allows positional
204
elements to render correctly even if they all render
205
identically, such as "qmark" style bind parameters.
211
The cursor associated with connection pool connections
212
(i.e. _CursorFairy) now proxies `__iter__()` to the
213
underlying cursor correctly.
219
types now support an "affinity comparison" operation, i.e.
220
that an Integer/SmallInteger are "compatible", or
221
a Text/String, PickleType/Binary, etc. Part of.
227
Fixed bug preventing alias() of an alias() from being
228
cloned or adapted (occurs frequently in ORM operations).
234
sqlite dialect properly generates CREATE INDEX for a table
235
that is in an alternate schema.
241
Added support for reflecting the DOUBLE PRECISION type,
242
via a new postgres.PGDoublePrecision object.
243
This is postgresql.DOUBLE_PRECISION in 0.6.
249
Added support for reflecting the INTERVAL YEAR TO MONTH
250
and INTERVAL DAY TO SECOND syntaxes of the INTERVAL
257
Corrected the "has_sequence" query to take current schema,
258
or explicit sequence-stated schema, into account.
264
Fixed the behavior of extract() to apply operator
265
precedence rules to the "::" operator when applying
266
the "timestamp" cast - ensures proper parenthesization.
272
Changed the name of TrustedConnection to
273
Trusted_Connection when constructing pyodbc connect
280
The "table_names" dialect function, used by MetaData
281
.reflect(), omits "index overflow tables", a system
282
table generated by Oracle when "index only tables"
283
with overflow are used. These tables aren't accessible
284
via SQL and can't be reflected.
290
A column can be added to a joined-table declarative
291
superclass after the class has been constructed
292
(i.e. via class-level attribute assignment), and
293
the column will be propagated down to
294
subclasses. This is the reverse
295
situation as that of, fixed in 0.5.6.
301
Fixed a slight inaccuracy in the sharding example.
302
Comparing equivalence of columns in the ORM is best
303
accomplished using col1.shares_lineage(col2).
309
Removed unused `load()` method from ShardedQuery.
313
:released: Sat Sep 12 2009
319
Fixed bug whereby inheritance discriminator part of a
320
composite primary key would fail on updates.
327
Fixed bug which disallowed one side of a many-to-many
328
bidirectional reference to declare itself as "viewonly"
334
Added an assertion that prevents a @validates function
335
or other AttributeExtension from loading an unloaded
336
collection such that internal state may be corrupted.
342
Fixed bug which prevented two entities from mutually
343
replacing each other's primary key values within a single
344
flush() for some orderings of operations.
350
Fixed an obscure issue whereby a joined-table subclass
351
with a self-referential eager load on the base class
352
would populate the related object's "subclass" table with
353
data from the "subclass" table of the parent.
359
relations() now have greater ability to be "overridden",
360
meaning a subclass that explicitly specifies a relation()
361
overriding that of the parent class will be honored
362
during a flush. This is currently to support
363
many-to-many relations from concrete inheritance setups.
364
Outside of that use case, YMMV.
370
Squeezed a few more unnecessary "lazy loads" out of
371
relation(). When a collection is mutated, many-to-one
372
backrefs on the other side will not fire off to load
373
the "old" value, unless "single_parent=True" is set.
374
A direct assignment of a many-to-one still loads
375
the "old" value in order to update backref collections
376
on that value, which may be present in the session
377
already, thus maintaining the 0.5 behavioral contract.
383
Fixed bug whereby a load/refresh of joined table
384
inheritance attributes which were based on
385
column_property() or similar would fail to evaluate.
391
Improved support for MapperProperty objects overriding
392
that of an inherited mapper for non-concrete
393
inheritance setups - attribute extensions won't randomly
394
collide with each other.
400
UPDATE and DELETE do not support ORDER BY, LIMIT, OFFSET,
401
etc. in standard SQL. Query.update() and Query.delete()
402
now raise an exception if any of limit(), offset(),
403
order_by(), group_by(), or distinct() have been
410
Added AttributeExtension to sqlalchemy.orm.__all__
416
Improved error message when query() is called with
417
a non-SQL /entity expression.
423
Using False or 0 as a polymorphic discriminator now
424
works on the base class as well as a subclass.
430
Added enable_assertions(False) to Query which disables
431
the usual assertions for expected state - used
432
by Query subclasses to engineer custom state.. See
433
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/PreFilteredQuery
440
Fixed recursion issue which occured if a mapped object's
441
`__len__()` or `__nonzero__()` method resulted in state
448
Fixed incorrect exception raise in
449
Weak/StrongIdentityMap.add()
455
Fixed the error message for "could not find a FROM clause"
456
in query.join() which would fail to issue correctly
457
if the query was against a pure SQL construct.
463
Fixed a somewhat hypothetical issue which would result
464
in the wrong primary key being calculated for a mapper
465
using the old polymorphic_union function - but this
472
Fixed column.copy() to copy defaults and onupdates.
478
Fixed a bug in extract() introduced in 0.5.4 whereby
479
the string "field" argument was getting treated as a
480
ClauseElement, causing various errors within more
481
complex SQL transformations.
487
Unary expressions such as DISTINCT propagate their
488
type handling to result sets, allowing conversions like
489
unicode and such to take place.
495
Fixed bug in Table and Column whereby passing empty
496
dict for "info" argument would raise an exception.
502
Backported 0.6 fix for Oracle alias names not getting
509
The collection proxies produced by associationproxy are now
510
pickleable. A user-defined proxy_factory however
511
is still not pickleable unless it defines __getstate__
518
Declarative will raise an informative exception if
519
__table_args__ is passed as a tuple with no dict argument.
520
Improved documentation.
526
Table objects declared in the MetaData can now be used
527
in string expressions sent to primaryjoin/secondaryjoin/
528
secondary - the name is pulled from the MetaData of the
535
A column can be added to a joined-table subclass after
536
the class has been constructed (i.e. via class-level
537
attribute assignment). The column is added to the underlying
538
Table as always, but now the mapper will rebuild its
539
"join" to include the new column, instead of raising
540
an error about "no such column, use column_property()
547
Added examples into the test suite so they get exercised
548
regularly and cleaned up a couple deprecation warnings.
552
:released: Mon Jul 13 2009
558
unit tests have been migrated from unittest to nose. See
559
README.unittests for information on how to run the tests.
565
The "foreign_keys" argument of relation() will now propagate
566
automatically to the backref in the same way that primaryjoin
567
and secondaryjoin do. For the extremely rare use case where
568
the backref of a relation() has intentionally different
569
"foreign_keys" configured, both sides now need to be
570
configured explicity (if they do in fact require this setting,
571
see the next note...).
577
...the only known (and really, really rare) use case where a
578
different foreign_keys setting was used on the
579
forwards/backwards side, a composite foreign key that
580
partially points to its own columns, has been enhanced such
581
that the fk->itself aspect of the relation won't be used to
582
determine relation direction.
588
Session.mapper is now *deprecated*.
590
Call session.add() if you'd like a free-standing object to be
591
part of your session. Otherwise, a DIY version of
592
Session.mapper is now documented at
593
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper
594
The method will remain deprecated throughout 0.6.
600
Fixed Query being able to join() from individual columns of a
601
joined-table subclass entity, i.e. query(SubClass.foo,
602
SubcClass.bar).join(<anything>). In most cases, an error
603
"Could not find a FROM clause to join from" would be
604
raised. In a few others, the result would be returned in terms
605
of the base class rather than the subclass - so applications
606
which relied on this erroneous result need to be
613
Fixed a bug involving contains_eager(), which would apply
614
itself to a secondary (i.e. lazy) load in a particular rare
615
case, producing cartesian products. improved the targeting of
616
query.options() on secondary loads overall.
622
Fixed bug introduced in 0.5.4 whereby Composite types fail
623
when default-holding columns are flushed.
629
Fixed another 0.5.4 bug whereby mutable attributes
630
(i.e. PickleType) wouldn't be deserialized correctly when the
631
whole object was serialized.
637
Fixed bug whereby session.is_modified() would raise an
638
exception if any synonyms were in use.
644
Fixed potential memory leak whereby previously pickled objects
645
placed back in a session would not be fully garbage collected
646
unless the Session were explicitly closed out.
652
Fixed bug whereby list-based attributes, like pickletype and
653
PGArray, failed to be merged() properly.
659
Repaired non-working attributes.set_committed_value function.
665
Trimmed the pickle format for InstanceState which should
666
further reduce the memory footprint of pickled instances. The
667
format should be backwards compatible with that of 0.5.4 and
674
sqlalchemy.orm.join and sqlalchemy.orm.outerjoin are now
675
added to __all__ in sqlalchemy.orm.*.
681
Fixed bug where Query exception raise would fail when
682
a too-short composite primary key value were passed to
689
Removed an obscure feature of execute() (including connection,
690
engine, Session) whereby a bindparam() construct can be sent
691
as a key to the params dictionary. This usage is undocumented
692
and is at the core of an issue whereby the bindparam() object
693
created implicitly by a text() construct may have the same
694
hash value as a string placed in the params dictionary and may
695
result in an inappropriate match when computing the final bind
696
parameters. Internal checks for this condition would add
697
significant latency to the critical task of parameter
698
rendering, so the behavior is removed. This is a backwards
699
incompatible change for any application that may have been
700
using this feature, however the feature has never been
707
Implemented recreate() for StaticPool.
711
:released: Tue May 26 2009
717
Repaired the printing of SQL exceptions which are not
718
based on parameters or are not executemany() style.
724
Deprecated the hardcoded TIMESTAMP function, which when
725
used as func.TIMESTAMP(value) would render "TIMESTAMP value".
726
This breaks on some platforms as PostgreSQL doesn't allow
727
bind parameters to be used in this context. The hard-coded
728
uppercase is also inappropriate and there's lots of other
729
PG casts that we'd need to support. So instead, use
730
text constructs i.e. select(["timestamp '12/05/09'"]).
734
:released: Mon May 18 2009
740
Fixed an attribute error introduced in 0.5.4 which would
741
occur when merge() was used with an incomplete object.
745
:released: Sun May 17 2009
751
Significant performance enhancements regarding Sessions/flush()
752
in conjunction with large mapper graphs, large numbers of
755
- Removed all* O(N) scanning behavior from the flush() process,
756
i.e. operations that were scanning the full session,
757
including an extremely expensive one that was erroneously
758
assuming primary key values were changing when this
761
* one edge case remains which may invoke a full scan,
762
if an existing primary key attribute is modified
765
- The Session's "weak referencing" behavior is now *full* -
766
no strong references whatsoever are made to a mapped object
767
or related items/collections in its __dict__. Backrefs and
768
other cycles in objects no longer affect the Session's ability
769
to lose all references to unmodified objects. Objects with
770
pending changes still are maintained strongly until flush.
773
The implementation also improves performance by moving
774
the "resurrection" process of garbage collected items
775
to only be relevant for mappings that map "mutable"
776
attributes (i.e. PickleType, composite attrs). This removes
777
overhead from the gc process and simplifies internal
780
If a "mutable" attribute change is the sole change on an object
781
which is then dereferenced, the mapper will not have access to
782
other attribute state when the UPDATE is issued. This may present
783
itself differently to some MapperExtensions.
785
The change also affects the internal attribute API, but not
786
the AttributeExtension interface nor any of the publically
787
documented attribute functions.
789
- The unit of work no longer genererates a graph of "dependency"
790
processors for the full graph of mappers during flush(), instead
791
creating such processors only for those mappers which represent
792
objects with pending changes. This saves a tremendous number
793
of method calls in the context of a large interconnected
796
- Cached a wasteful "table sort" operation that previously
797
occured multiple times per flush, also removing significant
798
method call count from flush().
800
- Other redundant behaviors have been simplified in
807
Modified query_cls on DynamicAttributeImpl to accept a full
808
mixin version of the AppenderQuery, which allows subclassing
815
The "polymorphic discriminator" column may be part of a
816
primary key, and it will be populated with the correct
823
Fixed the evaluator not being able to evaluate IS NULL clauses.
829
Fixed the "set collection" function on "dynamic" relations to
830
initiate events correctly. Previously a collection could only
831
be assigned to a pending parent instance, otherwise modified
832
events would not be fired correctly. Set collection is now
833
compatible with merge(), fixes.
839
Allowed pickling of PropertyOption objects constructed with
840
instrumented descriptors; previously, pickle errors would occur
841
when pickling an object which was loaded with a descriptor-based
842
option, such as query.options(eagerload(MyClass.foo)).
848
Lazy loader will not use get() if the "lazy load" SQL clause
849
matches the clause used by get(), but contains some parameters
850
hardcoded. Previously the lazy strategy would fail with the
851
get(). Ideally get() would be used with the hardcoded
852
parameters but this would require further development.
858
MapperOptions and other state associated with query.options()
859
is no longer bundled within callables associated with each
860
lazy/deferred-loading attribute during a load.
861
The options are now associated with the instance's
862
state object just once when it's populated. This removes
863
the need in most cases for per-instance/attribute loader
864
objects, improving load speed and memory overhead for
865
individual instances.
871
Fixed another location where autoflush was interfering
872
with session.merge(). autoflush is disabled completely
873
for the duration of merge() now.
879
Fixed bug which prevented "mutable primary key" dependency
880
logic from functioning properly on a one-to-one
887
Fixed bug in relation(), introduced in 0.5.3,
888
whereby a self referential relation
889
from a base class to a joined-table subclass would
890
not configure correctly.
896
Fixed obscure mapper compilation issue when inheriting
897
mappers are used which would result in un-initialized
904
Fixed documentation for session weak_identity_map -
905
the default value is True, indicating a weak
906
referencing map in use.
912
Fixed a unit of work issue whereby the foreign
913
key attribute on an item contained within a collection
914
owned by an object being deleted would not be set to
915
None if the relation() was self-referential.
921
Fixed Query.update() and Query.delete() failures with eagerloaded
928
It is now an error to specify both columns of a binary primaryjoin
929
condition in the foreign_keys or remote_side collection. Whereas
930
previously it was just nonsensical, but would succeed in a
931
non-deterministic way.
934
:tags: ticket: 594, 1341, schema
937
Added a quote_schema() method to the IdentifierPreparer class
938
so that dialects can override how schemas get handled. This
939
enables the MSSQL dialect to treat schemas as multipart
940
identifiers, such as 'database.owner'.
946
Back-ported the "compiler" extension from SQLA 0.6. This
947
is a standardized interface which allows the creation of custom
948
ClauseElement subclasses and compilers. In particular it's
949
handy as an alternative to text() when you'd like to
950
build a construct that has database-specific compilations.
951
See the extension docs for details.
957
Exception messages are truncated when the list of bound
958
parameters is larger than 10, preventing enormous
959
multi-page exceptions from filling up screens and logfiles
960
for large executemany() statements.
966
``sqlalchemy.extract()`` is now dialect sensitive and can
967
extract components of timestamps idiomatically across the
968
supported databases, including SQLite.
974
Fixed __repr__() and other _get_colspec() methods on
975
ForeignKey constructed from __clause_element__() style
976
construct (i.e. declarative columns).
982
Reflecting a FOREIGN KEY construct will take into account
983
a dotted schema.tablename combination, if the foreign key
984
references a table in a remote schema.
990
Modified how savepoint logic works to prevent it from
991
stepping on non-savepoint oriented routines. Savepoint
992
support is still very experimental.
998
Added in reserved words for MSSQL that covers version 2008
999
and all prior versions.
1005
Corrected problem with information schema not working with a
1006
binary collation based database. Cleaned up information schema
1007
since it is only used by mssql now.
1013
Corrected the SLBoolean type so that it properly treats only 1
1020
Corrected the float type so that it correctly maps to a
1021
SLFloat type when being reflected.
1027
Fixed adding of deferred or other column properties to a
1032
:released: Tue Mar 24 2009
1038
The "objects" argument to session.flush() is deprecated.
1039
State which represents the linkage between a parent and
1040
child object does not support "flushed" status on
1041
one side of the link and not the other, so supporting
1042
this operation leads to misleading results.
1048
Query now implements __clause_element__() which produces
1049
its selectable, which means a Query instance can be accepted
1050
in many SQL expressions, including col.in_(query),
1051
union(query1, query2), select([foo]).select_from(query),
1058
Query.join() can now construct multiple FROM clauses, if
1059
needed. Such as, query(A, B).join(A.x).join(B.y)
1060
might say SELECT A.*, B.* FROM A JOIN X, B JOIN Y.
1061
Eager loading can also tack its joins onto those
1062
multiple FROM clauses.
1068
Fixed bug in dynamic_loader() where append/remove events
1069
after construction time were not being propagated to the
1070
UOW to pick up on flush().
1076
Fixed bug where column_prefix wasn't being checked before
1077
not mapping an attribute that already had class-level
1084
a session.expire() on a particular collection attribute
1085
will clear any pending backref additions as well, so that
1086
the next access correctly returns only what was present
1087
in the database. Presents some degree of a workaround for, although we are considering removing the
1088
flush([objects]) feature altogether.
1094
Session.scalar() now converts raw SQL strings to text()
1095
the same way Session.execute() does and accepts same
1096
alternative **kw args.
1102
improvements to the "determine direction" logic of
1103
relation() such that the direction of tricky situations
1104
like mapper(A.join(B)) -> relation-> mapper(B) can be
1111
When flushing partial sets of objects using session.flush([somelist]),
1112
pending objects which remain pending after the operation won't
1113
inadvertently be added as persistent.
1119
Added "post_configure_attribute" method to InstrumentationManager,
1120
so that the "listen_for_events.py" example works again.
1126
a forward and complementing backwards reference which are both
1127
of the same direction, i.e. ONETOMANY or MANYTOONE,
1128
is now detected, and an error message is raised.
1129
Saves crazy CircularDependencyErrors later on.
1135
Fixed bugs in Query regarding simultaneous selection of
1136
multiple joined-table inheritance entities with common base
1139
- previously the adaption applied to "B" on
1140
"A JOIN B" would be erroneously partially applied
1143
- comparisons on relations (i.e. A.related==someb)
1144
were not getting adapted when they should.
1146
- Other filterings, like
1147
query(A).join(A.bs).filter(B.foo=='bar'), were erroneously
1148
adapting "B.foo" as though it were an "A".
1154
Fixed adaptation of EXISTS clauses via any(), has(), etc.
1155
in conjunction with an aliased object on the left and
1156
of_type() on the right.
1162
Added an attribute helper method ``set_committed_value`` in
1163
sqlalchemy.orm.attributes. Given an object, attribute name,
1164
and value, will set the value on the object as part of its
1165
"committed" state, i.e. state that is understood to have
1166
been loaded from the database. Helps with the creation of
1167
homegrown collection loaders and such.
1173
Query won't fail with weakref error when a non-mapper/class
1174
instrumented descriptor is passed, raises
1175
"Invalid column expession".
1181
Query.group_by() properly takes into account aliasing applied
1182
to the FROM clause, such as with select_from(), using
1183
with_polymorphic(), or using from_self().
1189
An alias() of a select() will convert to a "scalar subquery"
1190
when used in an unambiguously scalar context, i.e. it's used
1191
in a comparison operation. This applies to
1192
the ORM when using query.subquery() as well.
1198
Fixed missing _label attribute on Function object, others
1199
when used in a select() with use_labels (such as when used
1200
in an ORM column_property()).
1206
anonymous alias names now truncate down to the max length
1207
allowed by the dialect. More significant on DBs like
1208
Oracle with very small character limits.
1214
the __selectable__() interface has been replaced entirely
1215
by __clause_element__().
1221
The per-dialect cache used by TypeEngine to cache
1222
dialect-specific types is now a WeakKeyDictionary.
1223
This to prevent dialect objects from
1224
being referenced forever for an application that
1225
creates an arbitrarily large number of engines
1226
or dialects. There is a small performance penalty
1227
which will be resolved in 0.6.
1233
Fixed SQLite reflection methods so that non-present
1234
cursor.description, which triggers an auto-cursor
1235
close, will be detected so that no results doesn't
1236
fail on recent versions of pysqlite which raise
1237
an error when fetchone() called with no rows present.
1243
Index reflection won't fail when an index with
1244
multiple expressions is encountered.
1250
Added PGUuid and PGBit types to
1251
sqlalchemy.databases.postgres.
1257
Refection of unknown PG types won't crash when those
1258
types are specified within a domain.
1264
Preliminary support for pymssql 1.0.1
1270
Corrected issue on mssql where max_identifier_length was
1271
not being respected.
1277
Fixed a recursive pickling issue in serializer, triggered
1278
by an EXISTS or other embedded FROM construct.
1284
Declarative locates the "inherits" class using a search
1285
through __bases__, to skip over mixins that are local
1292
Declarative figures out joined-table inheritance primary join
1293
condition even if "inherits" mapper argument is given
1300
Declarative will properly interpret the "foreign_keys" argument
1301
on a backref() if it's a string.
1307
Declarative will accept a table-bound column as a property
1308
when used in conjunction with __table__, if the column is already
1309
present in __table__. The column will be remapped to the given
1310
key the same way as when added to the mapper() properties dict.
1314
:released: Sat Jan 24 2009
1320
Further refined 0.5.1's warning about delete-orphan cascade
1321
placed on a many-to-many relation. First, the bad news:
1322
the warning will apply to both many-to-many as well as
1323
many-to-one relations. This is necessary since in both
1324
cases, SQLA does not scan the full set of potential parents
1325
when determining "orphan" status - for a persistent object
1326
it only detects an in-python de-association event to establish
1327
the object as an "orphan". Next, the good news: to support
1328
one-to-one via a foreign key or assocation table, or to
1329
support one-to-many via an association table, a new flag
1330
single_parent=True may be set which indicates objects
1331
linked to the relation are only meant to have a single parent.
1332
The relation will raise an error if multiple parent-association
1333
events occur within Python.
1339
Adjusted the attribute instrumentation change from 0.5.1 to
1340
fully establish instrumentation for subclasses where the mapper
1341
was created after the superclass had already been fully
1348
Fixed bug in delete-orphan cascade whereby two one-to-one
1349
relations from two different parent classes to the same target
1350
class would prematurely expunge the instance.
1356
Fixed an eager loading bug whereby self-referential eager
1357
loading would prevent other eager loads, self referential or not,
1358
from joining to the parent JOIN properly. Thanks to Alex K
1359
for creating a great test case.
1365
session.expire() and related methods will not expire() unloaded
1366
deferred attributes. This prevents them from being needlessly
1367
loaded when the instance is refreshed.
1373
query.join()/outerjoin() will now properly join an aliased()
1374
construct to the existing left side, even if query.from_self()
1375
or query.select_from(someselectable) has been called.
1381
Further fixes to the "percent signs and spaces in column/table
1382
names" functionality.
1388
Restored convert_unicode handling. Results were being passed
1389
on through without conversion.
1395
Really fixing the decimal handling this time..
1398
:tags: Ticket:1289, mssql
1401
Modified table reflection code to use only kwargs when
1402
constructing tables.
1406
:released: Sat Jan 17 2009
1412
Removed an internal join cache which could potentially leak
1413
memory when issuing query.join() repeatedly to ad-hoc
1420
The "clear()", "save()", "update()", "save_or_update()"
1421
Session methods have been deprecated, replaced by
1422
"expunge_all()" and "add()". "expunge_all()" has also
1423
been added to ScopedSession.
1429
Modernized the "no mapped table" exception and added a more
1430
explicit __table__/__tablename__ exception to declarative.
1436
Concrete inheriting mappers now instrument attributes which
1437
are inherited from the superclass, but are not defined for
1438
the concrete mapper itself, with an InstrumentedAttribute that
1439
issues a descriptive error when accessed.
1445
Added a new `relation()` keyword `back_populates`. This
1446
allows configuation of backreferences using explicit
1447
relations. This is required when creating
1448
bidirectional relations between a hierarchy of concrete
1449
mappers and another class.
1455
Test coverage added for `relation()` objects specified on
1462
Query.from_self() as well as query.subquery() both disable
1463
the rendering of eager joins inside the subquery produced.
1464
The "disable all eager joins" feature is available publically
1465
via a new query.enable_eagerloads() generative.
1471
Added a rudimental series of set operations to Query that
1472
receive Query objects as arguments, including union(),
1473
union_all(), intersect(), except_(), insertsect_all(),
1474
except_all(). See the API documentation for
1475
Query.union() for examples.
1481
Fixed bug that prevented Query.join() and eagerloads from
1482
attaching to a query that selected from a union or aliased union.
1488
A short documentation example added for bidirectional
1489
relations specified on concrete mappers.
1495
Mappers now instrument class attributes upon construction
1496
with the final InstrumentedAttribute object which remains
1497
persistent. The `_CompileOnAttr`/`__getattribute__()`
1498
methodology has been removed. The net effect is that
1499
Column-based mapped class attributes can now be used fully
1500
at the class level without invoking a mapper compilation
1501
operation, greatly simplifying typical usage patterns
1508
ColumnProperty (and front-end helpers such as ``deferred``) no
1509
longer ignores unknown **keyword arguments.
1515
Fixed a bug with the unitofwork's "row switch" mechanism,
1516
i.e. the conversion of INSERT/DELETE into an UPDATE, when
1517
combined with joined-table inheritance and an object
1518
which contained no defined values for the child table where
1519
an UPDATE with no SET clause would be rendered.
1525
Using delete-orphan on a many-to-many relation is deprecated.
1526
This produces misleading or erroneous results since SQLA does
1527
not retrieve the full list of "parents" for m2m. To get delete-orphan
1528
behavior with an m2m table, use an explcit association class
1529
so that the individual association row is treated as a parent.
1535
delete-orphan cascade always requires delete cascade. Specifying
1536
delete-orphan without delete now raises a deprecation warning.
1542
Improved the methodology to handling percent signs in column
1543
names from. Added more tests. MySQL and
1544
PostgreSQL dialects still do not issue correct CREATE TABLE
1545
statements for identifiers with percent signs in them.
1551
Index now accepts column-oriented InstrumentedAttributes
1552
(i.e. column-based mapped class attributes) as column
1559
Column with no name (as in declarative) won't raise a
1560
NoneType error when it's string output is requsted
1561
(such as in a stack trace).
1567
Fixed bug when overriding a Column with a ForeignKey
1568
on a reflected table, where derived columns (i.e. the
1569
"virtual" columns of a select, etc.) would inadvertently
1570
call upon schema-level cleanup logic intended only
1571
for the original column.
1577
Can now specify Column objects on subclasses which have no
1578
table of their own (i.e. use single table inheritance).
1579
The columns will be appended to the base table, but only
1580
mapped by the subclass.
1586
For both joined and single inheriting subclasses, the subclass
1587
will only map those columns which are already mapped on the
1588
superclass and those explicit on the subclass. Other
1589
columns that are present on the `Table` will be excluded
1590
from the mapping by default, which can be disabled
1591
by passing a blank `exclude_properties` collection to the
1592
`__mapper_args__`. This is so that single-inheriting
1593
classes which define their own columns are the only classes
1594
to map those columns. The effect is actually a more organized
1595
mapping than you'd normally get with explicit `mapper()`
1596
calls unless you set up the `exclude_properties` arguments
1603
It's an error to add new Column objects to a declarative class
1604
that specified an existing table using __table__.
1610
Added the missing keywords from MySQL 4.1 so they get escaped
1617
Corrected handling of large decimal values with more robust
1618
tests. Removed string manipulation on floats.
1624
Modified the do_begin handling in mssql to use the Cursor not
1625
the Connection so it is DBAPI compatible.
1631
Corrected SAVEPOINT support on adodbapi by changing the
1632
handling of savepoint_release, which is unsupported on mssql.
1636
:released: Tue Jan 06 2009
1642
Documentation has been converted to Sphinx. In particular,
1643
the generated API documentation has been constructed into a
1644
full blown "API Reference" section which organizes editorial
1645
documentation combined with generated docstrings. Cross
1646
linking between sections and API docs are vastly improved, a
1647
javascript-powered search feature is provided, and a full
1648
index of all classes, functions and members is provided.
1654
setup.py now imports setuptools only optionally. If not
1655
present, distutils is used. The new "pip" installer is
1656
recommended over easy_install as it installs in a more
1663
added an extremely basic illustration of a PostGIS integration
1664
to the examples folder.
1670
Query.with_polymorphic() now accepts a third argument
1671
"discriminator" which will replace the value of
1672
mapper.polymorphic_on for that query. Mappers themselves no
1673
longer require polymorphic_on to be set, even if the mapper
1674
has a polymorphic_identity. When not set, the mapper will
1675
load non-polymorphically by default. Together, these two
1676
features allow a non-polymorphic concrete inheritance setup to
1677
use polymorphic loading on a per-query basis, since concrete
1678
setups are prone to many issues when used polymorphically in
1685
dynamic_loader accepts a query_class= to customize the Query
1686
classes used for both the dynamic collection and the queries
1693
query.order_by() accepts None which will remove any pending
1694
order_by state from the query, as well as cancel out any
1695
mapper/relation configured ordering. This is primarily useful
1696
for overriding the ordering specified on a dynamic_loader().
1702
RowProxy objects can be used in place of dictionary arguments
1703
sent to connection.execute() and friends.
1709
Added a new description_encoding attribute on the dialect that
1710
is used for encoding the column name when processing the
1711
metadata. This usually defaults to utf-8.
1717
Added in a new MSGenericBinary type. This maps to the Binary
1718
type so it can implement the specialized behavior of treating
1719
length specified types as fixed-width Binary types and
1720
non-length types as an unbound variable length Binary type.
1726
Added in new types: MSVarBinary and MSImage.
1732
Added in the MSReal, MSNText, MSSmallDateTime, MSTime,
1733
MSDateTimeOffset, and MSDateTime2 types
1739
Table reflection now stores the actual DefaultClause value for
1746
bugfixes, behavioral changes
1752
Exceptions raised during compile_mappers() are now preserved
1753
to provide "sticky behavior" - if a hasattr() call on a
1754
pre-compiled mapped attribute triggers a failing compile and
1755
suppresses the exception, subsequent compilation is blocked
1756
and the exception will be reiterated on the next compile()
1757
call. This issue occurs frequently when using declarative.
1763
property.of_type() is now recognized on a single-table
1764
inheriting target, when used in the context of
1765
prop.of_type(..).any()/has(), as well as
1766
query.join(prop.of_type(...)).
1772
query.join() raises an error when the target of the join
1773
doesn't match the property-based attribute - while it's
1774
unlikely anyone is doing this, the SQLAlchemy author was
1775
guilty of this particular loosey-goosey behavior.
1781
Fixed bug when using weak_instance_map=False where modified
1782
events would not be intercepted for a flush().
1788
Fixed some deep "column correspondence" issues which could
1789
impact a Query made against a selectable containing multiple
1790
versions of the same table, as well as unions and similar
1791
which contained the same table columns in different column
1792
positions at different levels.
1798
Custom comparator classes used in conjunction with
1799
column_property(), relation() etc. can define new comparison
1800
methods on the Comparator, which will become available via
1801
__getattr__() on the InstrumentedAttribute. In the case of
1802
synonym() or comparable_property(), attributes are resolved
1803
first on the user-defined descriptor, then on the user-defined
1810
Added ScopedSession.is_active accessor.
1816
Can pass mapped attributes and column objects as keys to
1823
Mapped attributes passed to the values() of an expression
1824
level insert() or update() will use the keys of the mapped
1825
columns, not that of the mapped attribute.
1831
Corrected problem with Query.delete() and Query.update() not
1832
working properly with bind parameters.
1838
Query.select_from(), from_statement() ensure that the given
1839
argument is a FromClause, or Text/Select/Union, respectively.
1845
Query() can be passed a "composite" attribute as a column
1846
expression and it will be expanded. Somewhat related to.
1852
Query() is a little more robust when passed various column
1853
expressions such as strings, clauselists, text() constructs
1854
(which may mean it just raises an error more nicely).
1860
first() works as expected with Query.from_statement().
1866
Fixed bug introduced in 0.5rc4 involving eager loading not
1867
functioning for properties which were added to a mapper
1868
post-compile using add_property() or equivalent.
1874
Fixed bug where many-to-many relation() with viewonly=True
1875
would not correctly reference the link between
1882
Duplicate items in a list-based collection will be maintained
1883
when issuing INSERTs to a "secondary" table in a many-to-many
1884
relation. Assuming the m2m table has a unique or primary key
1885
constraint on it, this will raise the expected constraint
1886
violation instead of silently dropping the duplicate
1887
entries. Note that the old behavior remains for a one-to-many
1888
relation since collection entries in that case don't result in
1889
INSERT statements and SQLA doesn't manually police
1896
Query.add_column() can accept FromClause objects in the same
1897
manner as session.query() can.
1903
Comparison of many-to-one relation to NULL is properly
1904
converted to IS NOT NULL based on not_().
1910
Extra checks added to ensure explicit
1911
primaryjoin/secondaryjoin are ClauseElement instances, to
1912
prevent more confusing errors later on.
1918
Improved mapper() check for non-class classes.
1924
comparator_factory argument is now documented and supported by
1925
all MapperProperty types, including column_property(),
1926
relation(), backref(), and synonym().
1932
Changed the name of PropertyLoader to RelationProperty, to be
1933
consistent with all the other names. PropertyLoader is still
1934
present as a synonym.
1938
:tickets: 1099, 1228
1940
fixed "double iter()" call causing bus errors in shard API,
1941
removed errant result.close() left over from the 0.4
1948
made Session.merge cascades not trigger autoflush. Fixes
1949
merged instances getting prematurely inserted with missing
1956
Two fixes to help prevent out-of-band columns from being
1957
rendered in polymorphic_union inheritance scenarios (which
1958
then causes extra tables to be rendered in the FROM clause
1959
causing cartesian products):
1961
- improvements to "column adaption" for a->b->c inheritance
1962
situations to better locate columns that are related to
1963
one another via multiple levels of indirection, rather
1964
than rendering the non-adapted column.
1966
- the "polymorphic discriminator" column is only rendered
1967
for the actual mapper being queried against. The column
1968
won't be "pulled in" from a subclass or superclass mapper
1969
since it's not needed.
1975
Fixed shard_id argument on ShardedSession.execute().
1981
Columns can again contain percent signs within their
1988
sqlalchemy.sql.expression.Function is now a public class. It
1989
can be subclassed to provide user-defined SQL functions in an
1990
imperative style, including with pre-established behaviors.
1991
The postgis.py example illustrates one usage of this.
1997
PickleType now favors == comparison by default, if the
1998
incoming object (such as a dict) implements __eq__(). If the
1999
object does not implement __eq__() and mutable=True, a
2000
deprecation warning is raised.
2006
Fixed the import weirdness in sqlalchemy.sql to not export
2013
Using the same ForeignKey object repeatedly raises an error
2014
instead of silently failing later.
2020
Added NotImplementedError for params() method on
2021
Insert/Update/Delete constructs. These items currently don't
2022
support this functionality, which also would be a little
2023
misleading compared to values().
2029
Reflected foreign keys will properly locate their referenced
2030
column, even if the column was given a "key" attribute
2031
different from the reflected name. This is achieved via a new
2032
flag on ForeignKey/ForeignKeyConstraint called "link_to_name",
2033
if True means the given name is the referred-to column's name,
2034
not its assigned key.
2040
select() can accept a ClauseList as a column in the same way
2041
as a Table or other selectable and the interior expressions
2042
will be used as column elements.
2048
the "passive" flag on session.is_modified() is correctly
2049
propagated to the attribute manager.
2055
union() and union_all() will not whack any order_by() that has
2056
been applied to the select()s inside. If you union() a
2057
select() with order_by() (presumably to support LIMIT/OFFSET),
2058
you should also call self_group() on it to apply parenthesis.
2064
Connection.invalidate() checks for closed status to avoid
2071
NullPool supports reconnect on failure behavior.
2077
Added a mutex for the initial pool creation when using
2078
pool.manage(dbapi). This prevents a minor case of "dogpile"
2079
behavior which would otherwise occur upon a heavy load
2086
_execute_clauseelement() goes back to being a private method.
2087
Subclassing Connection is not needed now that ConnectionProxy
2091
:tags: documentation
2092
:tickets: 1149, 1200
2097
:tags: documentation
2100
Added note about create_session() defaults.
2103
:tags: documentation
2106
Added section about metadata.reflect().
2109
:tags: documentation
2112
Updated `TypeDecorator` section.
2115
:tags: documentation
2118
Rewrote the "threadlocal" strategy section of the docs due to
2119
recent confusion over this feature.
2122
:tags: documentation
2125
Removed badly out of date 'polymorphic_fetch' and
2126
'select_table' docs from inheritance, reworked the second half
2127
of "joined table inheritance".
2130
:tags: documentation
2133
Documented `comparator_factory` kwarg, added new doc section
2134
"Custom Comparators".
2140
Refactored the Date/Time types. The ``smalldatetime`` data
2141
type no longer truncates to a date only, and will now be
2142
mapped to the MSSmallDateTime type.
2148
Corrected an issue with Numerics to accept an int.
2154
Mapped ``char_length`` to the ``LEN()`` function.
2160
If an ``INSERT`` includes a subselect the ``INSERT`` is
2161
converted from an ``INSERT INTO VALUES`` construct to a
2162
``INSERT INTO SELECT`` construct.
2168
If the column is part of a ``primary_key`` it will be ``NOT
2169
NULL`` since MSSQL doesn't allow ``NULL`` in primary_key
2176
``MSBinary`` now returns a ``BINARY`` instead of an
2177
``IMAGE``. This is a backwards incompatible change in that
2178
``BINARY`` is a fixed length data type whereas ``IMAGE`` is a
2179
variable length data type.
2185
``get_default_schema_name`` is now reflected from the database
2186
based on the user's default schema. This only works with MSSQL
2193
Added collation support through the use of a new collation
2194
argument. This is supported on the following types: char,
2195
nchar, varchar, nvarchar, text, ntext.
2201
Changes to the connection string parameters favor DSN as the
2202
default specification for pyodbc. See the mssql.py docstring
2203
for detailed usage instructions.
2209
Added experimental support of savepoints. It currently does
2210
not work fully with sessions.
2216
Support for three levels of column nullability: NULL, NOT
2217
NULL, and the database's configured default. The default
2218
Column configuration (nullable=True) will now generate NULL in
2219
the DDL. Previously no specification was emitted and the
2220
database default would take effect (usually NULL, but not
2221
always). To explicitly request the database default,
2222
configure columns with nullable=None and no specification will
2223
be emitted in DDL. This is backwards incompatible
2230
"%" signs in text() constructs are automatically escaped to
2231
"%%". Because of the backwards incompatible nature of this
2232
change, a warning is emitted if '%%' is detected in the
2239
Calling alias.execute() in conjunction with
2240
server_side_cursors won't raise AttributeError.
2246
Added Index reflection support to PostgreSQL, using a great
2247
patch we long neglected, submitted by Ken
2254
Adjusted the format of create_xid() to repair two-phase
2255
commit. We now have field reports of Oracle two-phase commit
2256
working properly with this change.
2262
Added OracleNVarchar type, produces NVARCHAR2, and also
2263
subclasses Unicode so that convert_unicode=True by default.
2264
NVARCHAR2 reflects into this type automatically so these
2265
columns pass unicode on a reflected table with no explicit
2266
convert_unicode=True flags.
2272
Fixed bug which was preventing out params of certain types
2273
from being received; thanks a ton to huddlej at wwu.edu !
2279
"%" signs in text() constructs are automatically escaped to
2280
"%%". Because of the backwards incompatible nature of this
2281
change, a warning is emitted if '%%' is detected in the
2288
Fixed bug in exception raise when FK columns not present
2295
Fixed bug involving reflection of a remote-schema table with a
2296
foreign key ref to another table in that schema.
2299
:tags: associationproxy
2302
The association proxy properties are make themselves available
2303
at the class level, e.g. MyClass.aproxy. Previously this
2310
The full list of arguments accepted as string by backref()
2311
includes 'primaryjoin', 'secondaryjoin', 'secondary',
2312
'foreign_keys', 'remote_side', 'order_by'.
2316
:released: Fri Nov 14 2008
2322
Query.count() has been enhanced to do the "right thing" in a
2323
wider variety of cases. It can now count multiple-entity
2324
queries, as well as column-based queries. Note that this means
2325
if you say query(A, B).count() without any joining criterion,
2326
it's going to count the cartesian product of A*B. Any query
2327
which is against column-based entities will automatically
2328
issue "SELECT count(1) FROM (SELECT...)" so that the real
2329
rowcount is returned, meaning a query such as
2330
query(func.count(A.name)).count() will return a value of one,
2331
since that query would return one row.
2337
Lots of performance tuning. A rough guesstimate over various
2338
ORM operations places it 10% faster over 0.5.0rc3, 25-30% over
2345
bugfixes and behavioral changes
2351
global "propigate"->"propagate" change.
2357
Adjustments to the enhanced garbage collection on
2358
InstanceState to better guard against errors due to lost
2365
Query.get() returns a more informative error message when
2366
executed against multiple entities.
2370
:tickets: 1140, 1221
2372
Restored NotImplementedError on Cls.relation.in_()
2378
Fixed PendingDeprecationWarning involving order_by parameter
2385
Removed the 'properties' attribute of the Connection object,
2386
Connection.info should be used.
2392
Restored "active rowcount" fetch before ResultProxy autocloses
2393
the cursor. This was removed in 0.5rc3.
2399
Rearranged the `load_dialect_impl()` method in `TypeDecorator`
2400
such that it will take effect even if the user-defined
2401
`TypeDecorator` uses another `TypeDecorator` as its impl.
2407
Added support for Currency type.
2413
Functions were not return their result.
2419
Corrected problem with joins. Access only support LEFT OUTER
2420
or INNER not just JOIN by itself.
2426
Lots of cleanup and fixes to correct problems with limit and
2433
Correct situation where subqueries as part of a binary
2434
expression need to be translated to use the IN and NOT IN
2441
Fixed E Notation issue that prevented the ability to insert
2442
decimal values less than 1E-6.
2448
Corrected problems with reflection when dealing with schemas,
2449
particularly when those schemas are the default
2456
Corrected problem with casting a zero length item to a
2457
varchar. It now correctly adjusts the CAST.
2463
Can now use a custom "inherit_condition" in __mapper_args__
2464
when using declarative.
2470
fixed string-based "remote_side", "order_by" and others not
2471
propagating correctly when used in backref().
2475
:released: Fri Nov 07 2008
2481
Added two new hooks to SessionExtension: after_bulk_delete()
2482
and after_bulk_update(). after_bulk_delete() is called after
2483
a bulk delete() operation on a query. after_bulk_update() is
2484
called after a bulk update() operation on a query.
2490
SQL compiler optimizations and complexity reduction. The call
2491
count for compiling a typical select() construct is 20% less
2498
Dialects can now generate label names of adjustable
2499
length. Pass in the argument "label_length=<value>" to
2500
create_engine() to adjust how many characters max will be
2501
present in dynamically generated column labels, i.e.
2502
"somecolumn AS somelabel". Any value less than 6 will result
2503
in a label of minimal size, consisting of an underscore and a
2504
numeric counter. The compiler uses the value of
2505
dialect.max_identifier_length as a default.
2511
Added a new extension sqlalchemy.ext.serializer. Provides
2512
Serializer/Deserializer "classes" which mirror
2513
Pickle/Unpickle, as well as dumps() and loads(). This
2514
serializer implements an "external object" pickler which keeps
2515
key context-sensitive objects, including engines, sessions,
2516
metadata, Tables/Columns, and mappers, outside of the pickle
2517
stream, and can later restore the pickle using any
2518
engine/metadata/session provider. This is used not for
2519
pickling regular object instances, which are pickleable
2520
without any special logic, but for pickling expression objects
2521
and full Query objects, such that all mapper/engine/session
2522
dependencies can be restored at unpickle time.
2528
Wrote a docstring for Oracle dialect. Apparently that Ohloh
2529
"few source code comments" label is starting to sting :).
2535
Removed FIRST_ROWS() optimize flag when using LIMIT/OFFSET,
2536
can be reenabled with optimize_limits=True create_engine()
2543
bugfixes and behavioral changes
2549
"not equals" comparisons of simple many-to-one relation to an
2550
instance will not drop into an EXISTS clause and will compare
2551
foreign key columns instead.
2557
Removed not-really-working use cases of comparing a collection
2558
to an iterable. Use contains() to test for collection
2565
Improved the behavior of aliased() objects such that they more
2566
accurately adapt the expressions generated, which helps
2567
particularly with self-referential comparisons.
2573
Fixed bug involving primaryjoin/secondaryjoin conditions
2574
constructed from class-bound attributes (as often occurs when
2575
using declarative), which later would be inappropriately
2576
aliased by Query, particularly with the various EXISTS based
2583
Fixed bug when using multiple query.join() with an
2584
aliased-bound descriptor which would lose the left alias.
2590
Improved weakref identity map memory management to no longer
2591
require mutexing, resurrects garbage collected instance on a
2592
lazy basis for an InstanceState with pending changes.
2598
InstanceState object now removes circular references to itself
2599
upon disposal to keep it outside of cyclic garbage collection.
2605
relation() won't hide unrelated ForeignKey errors inside of
2606
the "please specify primaryjoin" message when determining join
2613
Fixed bug in Query involving order_by() in conjunction with
2614
multiple aliases of the same class (will add tests in)
2620
When using Query.join() with an explicit clause for the ON
2621
clause, the clause will be aliased in terms of the left side
2622
of the join, allowing scenarios like query(Source).
2623
from_self().join((Dest, Source.id==Dest.source_id)) to work
2630
polymorphic_union() function respects the "key" of each Column
2631
if they differ from the column's name.
2637
Repaired support for "passive-deletes" on a many-to-one
2638
relation() with "delete" cascade.
2644
Fixed bug in composite types which prevented a primary-key
2645
composite type from being mutated.
2651
Added more granularity to internal attribute access, such that
2652
cascade and flush operations will not initialize unloaded
2653
attributes and collections, leaving them intact for a
2654
lazy-load later on. Backref events still initialize attrbutes
2655
and collections for pending instances.
2661
Simplified the check for ResultProxy "autoclose without
2662
results" to be based solely on presence of
2663
cursor.description. All the regexp-based guessing about
2664
statements returning rows has been removed.
2670
Direct execution of a union() construct will properly set up
2671
result-row processing.
2677
The internal notion of an "OID" or "ROWID" column has been
2678
removed. It's basically not used by any dialect, and the
2679
possibility of its usage with psycopg2's cursor.lastrowid is
2680
basically gone now that INSERT..RETURNING is available.
2686
Removed "default_order_by()" method on all FromClause objects.
2692
Repaired the table.tometadata() method so that a passed-in
2693
schema argument is propagated to ForeignKey constructs.
2699
Slightly changed behavior of IN operator for comparing to
2700
empty collections. Now results in inequality comparison
2701
against self. More portable, but breaks with stored procedures
2702
that aren't pure functions.
2708
Setting the auto_convert_lobs to False on create_engine() will
2709
also instruct the OracleBinary type to return the cx_oracle
2710
LOB object unchanged.
2716
Fixed foreign key reflection in the edge case where a Table's
2717
explicit schema= is the same as the schema (database) the
2718
connection is attached to.
2724
No longer expects include_columns in table reflection to be
2731
Fixed bug preventing declarative-bound "column" objects from
2732
being used in column_mapped_collection().
2738
util.flatten_iterator() func doesn't interpret strings with
2739
__iter__() methods as iterators, such as in pypy.
2743
:released: Sun Oct 12 2008
2749
Fixed bug involving read/write relation()s that contain
2750
literal or other non-column expressions within their
2751
primaryjoin condition equated to a foreign key column.
2757
"non-batch" mode in mapper(), a feature which allows mapper
2758
extension methods to be called as each instance is
2759
updated/inserted, now honors the insert order of the objects
2766
Fixed RLock-related bug in mapper which could deadlock upon
2767
reentrant mapper compile() calls, something that occurs when
2768
using declarative constructs inside of ForeignKey objects.
2774
ScopedSession.query_property now accepts a query_cls factory,
2775
overriding the session's configured query_cls.
2781
Fixed shared state bug interfering with ScopedSession.mapper's
2782
ability to apply default __init__ implementations on object
2789
Fixed up slices on Query (i.e. query[x:y]) to work properly
2790
for zero length slices, slices with None on either end.
2796
Added an example illustrating Celko's "nested sets" as a
2803
contains_eager() with an alias argument works even when
2804
the alias is embedded in a SELECT, as when sent to the
2805
Query via query.select_from().
2811
contains_eager() usage is now compatible with a Query that
2812
also contains a regular eager load and limit/offset, in that
2813
the columns are added to the Query-generated subquery.
2819
session.execute() will execute a Sequence object passed to
2820
it (regression from 0.4).
2826
Removed the "raiseerror" keyword argument from object_mapper()
2827
and class_mapper(). These functions raise in all cases
2828
if the given class/instance is not mapped.
2834
Fixed session.transaction.commit() on a autocommit=False
2835
session not starting a new transaction.
2841
Some adjustments to Session.identity_map's weak referencing
2842
behavior to reduce asynchronous GC side effects.
2848
Adjustment to Session's post-flush accounting of newly
2849
"clean" objects to better protect against operating on
2850
objects as they're asynchronously gc'ed.
2856
column.in_(someselect) can now be used as a columns-clause
2857
expression without the subquery bleeding into the FROM clause
2863
Overhauled SQLite date/time bind/result processing to use
2864
regular expressions and format strings, rather than
2865
strptime/strftime, to generically support pre-1900 dates,
2866
dates with microseconds.
2872
String's (and Unicode's, UnicodeText's, etc.) convert_unicode
2873
logic disabled in the sqlite dialect, to adjust for pysqlite
2874
2.5.0's new requirement that only Python unicode objects are
2876
http://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html
2882
Temporary tables are now reflectable.
2888
Oracle will detect string-based statements which contain
2889
comments at the front before a SELECT as SELECT statements.
2893
:released: Thu Sep 11 2008
2899
Query now has delete() and update(values) methods. This allows
2900
to perform bulk deletes/updates with the Query object.
2906
The RowTuple object returned by Query(*cols) now features
2907
keynames which prefer mapped attribute names over column keys,
2908
column keys over column names, i.e. Query(Class.foo,
2909
Class.bar) will have names "foo" and "bar" even if those are
2910
not the names of the underlying Column objects. Direct Column
2911
objects such as Query(table.c.col) will return the "key"
2912
attribute of the Column.
2918
Added scalar() and value() methods to Query, each return a
2919
single scalar value. scalar() takes no arguments and is
2920
roughly equivalent to first()[0], value()
2921
takes a single column expression and is roughly equivalent to
2922
values(expr).next()[0].
2928
Improved the determination of the FROM clause when placing SQL
2929
expressions in the query() list of entities. In particular
2930
scalar subqueries should not "leak" their inner FROM objects
2931
out into the enclosing query.
2937
Joins along a relation() from a mapped class to a mapped
2938
subclass, where the mapped subclass is configured with single
2939
table inheritance, will include an IN clause which limits the
2940
subtypes of the joined class to those requested, within the ON
2941
clause of the join. This takes effect for eager load joins as
2942
well as query.join(). Note that in some scenarios the IN
2943
clause will appear in the WHERE clause of the query as well
2944
since this discrimination has multiple trigger points.
2950
AttributeExtension has been refined such that the event
2951
is fired before the mutation actually occurs. Additionally,
2952
the append() and set() methods must now return the given value,
2953
which is used as the value to be used in the mutation operation.
2954
This allows creation of validating AttributeListeners which
2955
raise before the action actually occurs, and which can change
2956
the given value into something else before its used.
2962
column_property(), composite_property(), and relation() now
2963
accept a single or list of AttributeExtensions using the
2964
"extension" keyword argument.
2970
query.order_by().get() silently drops the "ORDER BY" from
2971
the query issued by GET but does not raise an exception.
2977
Added a Validator AttributeExtension, as well as a
2978
@validates decorator which is used in a similar fashion
2979
as @reconstructor, and marks a method as validating
2980
one or more mapped attributes.
2986
class.someprop.in_() raises NotImplementedError pending the
2987
implementation of "in_" for relation
2993
Fixed primary key update for many-to-many collections where
2994
the collection had not been loaded yet
3000
Fixed bug whereby deferred() columns with a group in conjunction
3001
with an otherwise unrelated synonym() would produce
3002
an AttributeError during deferred load.
3008
The before_flush() hook on SessionExtension takes place before
3009
the list of new/dirty/deleted is calculated for the final
3010
time, allowing routines within before_flush() to further
3011
change the state of the Session before the flush proceeds.
3017
The "extension" argument to Session and others can now
3018
optionally be a list, supporting events sent to multiple
3019
SessionExtension instances. Session places SessionExtensions
3020
in Session.extensions.
3026
Reentrant calls to flush() raise an error. This also serves
3027
as a rudimentary, but not foolproof, check against concurrent
3028
calls to Session.flush().
3034
Improved the behavior of query.join() when joining to
3035
joined-table inheritance subclasses, using explicit join
3036
criteria (i.e. not on a relation).
3042
@orm.attributes.reconstitute and
3043
MapperExtension.reconstitute have been renamed to
3044
@orm.reconstructor and MapperExtension.reconstruct_instance
3050
Fixed @reconstructor hook for subclasses which inherit from a
3057
The composite() property type now supports a
3058
__set_composite_values__() method on the composite class which
3059
is required if the class represents state using attribute
3060
names other than the column's keynames; default-generated
3061
values now get populated properly upon flush. Also,
3062
composites with attributes set to None compare correctly.
3068
The 3-tuple of iterables returned by attributes.get_history()
3069
may now be a mix of lists and tuples. (Previously members
3076
Fixed bug whereby changing a primary key attribute on an
3077
entity where the attribute's previous value had been expired
3078
would produce an error upon flush().
3084
Fixed custom instrumentation bug whereby get_instance_dict()
3085
was not called for newly constructed instances not loaded
3092
Session.delete() adds the given object to the session if
3093
not already present. This was a regression bug from 0.4.
3099
The `echo_uow` flag on `Session` is deprecated, and unit-of-work
3100
logging is now application-level only, not per-session level.
3106
Removed conflicting `contains()` operator from
3107
`InstrumentedAttribute` which didn't accept `escape` kwaarg.
3113
Fixed bug whereby mapper couldn't initialize if a composite
3114
primary key referenced another table that was not defined
3121
Fixed exception throw which would occur when string-based
3122
primaryjoin condition was used in conjunction with backref.
3128
Added "sorted_tables" accessor to MetaData, which returns
3129
Table objects sorted in order of dependency as a list.
3130
This deprecates the MetaData.table_iterator() method.
3131
The "reverse=False" keyword argument has also been
3132
removed from util.sort_tables(); use the Python
3133
'reversed' function to reverse the results.
3139
The 'length' argument to all Numeric types has been renamed
3140
to 'scale'. 'length' is deprecated and is still accepted
3147
Dropped 0.3-compatibility for user defined types
3148
(convert_result_value, convert_bind_param).
3154
Temporarily rolled back the "ORDER BY" enhancement from. This feature is on hold pending further
3161
The exists() construct won't "export" its contained list
3162
of elements as FROM clauses, allowing them to be used more
3163
effectively in the columns clause of a SELECT.
3169
and_() and or_() now generate a ColumnElement, allowing
3170
boolean expressions as result columns, i.e.
3171
select([and_(1, 0)]).
3177
Bind params now subclass ColumnElement which allows them to be
3178
selectable by orm.query (they already had most ColumnElement
3185
Added select_from() method to exists() construct, which becomes
3186
more and more compatible with a regular select().
3192
Added func.min(), func.max(), func.sum() as "generic functions",
3193
which basically allows for their return type to be determined
3194
automatically. Helps with dates on SQLite, decimal types,
3201
added decimal.Decimal as an "auto-detect" type; bind parameters
3202
and generic functions will set their type to Numeric when a
3209
The 'length' argument to MSInteger, MSBigInteger, MSTinyInteger,
3210
MSSmallInteger and MSYear has been renamed to 'display_width'.
3216
Added MSMediumInteger type.
3222
the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without
3223
the parenthesis, which seem to get in the way when using in
3224
conjunction with executemany().
3230
limit/offset no longer uses ROW NUMBER OVER to limit rows,
3231
and instead uses subqueries in conjunction with a special
3232
Oracle optimization comment. Allows LIMIT/OFFSET to work
3233
in conjunction with DISTINCT.
3239
has_sequence() now takes the current "schema" argument into
3246
added BFILE to reflected type names
3249
:version: 0.5.0beta3
3250
:released: Mon Aug 04 2008
3256
The "entity_name" feature of SQLAlchemy mappers has been
3257
removed. For rationale, see http://tinyurl.com/6nm2ne
3263
the "autoexpire" flag on Session, sessionmaker(), and
3264
scoped_session() has been renamed to "expire_on_commit". It
3265
does not affect the expiration behavior of rollback().
3271
fixed endless loop bug which could occur within a mapper's
3272
deferred load of inherited attributes.
3278
a legacy-support flag "_enable_transaction_accounting" flag
3279
added to Session which when False, disables all
3280
transaction-level object accounting, including expire on
3281
rollback, expire on commit, new/deleted list maintenance, and
3288
The 'cascade' parameter to relation() accepts None as a value,
3289
which is equivalent to no cascades.
3295
A critical fix to dynamic relations allows the "modified"
3296
history to be properly cleared after a flush().
3302
user-defined @properties on a class are detected and left in
3303
place during mapper initialization. This means that a
3304
table-bound column of the same name will not be mapped at all
3305
if a @property is in the way (and the column is not remapped
3306
to a different name), nor will an instrumented attribute from
3307
an inherited class be applied. The same rules apply for names
3308
excluded using the include_properties/exclude_properties
3315
Added a new SessionExtension hook called after_attach(). This
3316
is called at the point of attachment for objects via add(),
3317
add_all(), delete(), and merge().
3323
A mapper which inherits from another, when inheriting the
3324
columns of its inherited mapper, will use any reassigned
3325
property names specified in that inheriting mapper.
3326
Previously, if "Base" had reassigned "base_id" to the name
3327
"id", "SubBase(Base)" would still get an attribute called
3328
"base_id". This could be worked around by explicitly stating
3329
the column in each submapper as well but this is fairly
3330
unworkable and also impossible when using declarative.
3336
Fixed a series of potential race conditions in Session whereby
3337
asynchronous GC could remove unmodified, no longer referenced
3338
items from the session as they were present in a list of items
3339
to be processed, typically during session.expunge_all() and
3346
Some improvements to the _CompileOnAttr mechanism which should
3347
reduce the probability of "Attribute x was not replaced during
3348
compile" warnings. (this generally applies to SQLA hackers,
3355
Fixed bug whereby the "unsaved, pending instance" FlushError
3356
raised for a pending orphan would not take superclass mappers
3357
into account when generating the list of relations responsible
3364
func.count() with no arguments renders as COUNT(*), equivalent
3365
to func.count(text('*')).
3371
simple label names in ORDER BY expressions render as
3372
themselves, and not as a re-statement of their corresponding
3373
expression. This feature is currently enabled only for
3374
SQLite, MySQL, and PostgreSQL. It can be enabled on other
3375
dialects as each is shown to support this
3382
Class-bound attributes sent as arguments to relation()'s
3383
remote_side and foreign_keys parameters are now accepted,
3384
allowing them to be used with declarative. Additionally fixed
3385
bugs involving order_by being specified as a class-bound
3386
attribute in conjunction with eager loading.
3392
declarative initialization of Columns adjusted so that
3393
non-renamed columns initialize in the same way as a non
3394
declarative mapper. This allows an inheriting mapper to set
3395
up its same-named "id" columns in particular such that the
3396
parent "id" column is favored over the child column, reducing
3397
database round trips when this value is requested.
3403
Quoting of MSEnum values for use in CREATE TABLE is now
3404
optional & will be quoted on demand as required. (Quoting was
3405
always optional for use with existing tables.)
3408
:version: 0.5.0beta2
3409
:released: Mon Jul 14 2008
3415
In addition to expired attributes, deferred attributes also
3416
load if their data is present in the result set.
3422
session.refresh() raises an informative error message if the
3423
list of attributes does not include any column-based
3430
query() raises an informative error message if no columns or
3431
mappers are specified.
3437
lazy loaders now trigger autoflush before proceeding. This
3438
allows expire() of a collection or scalar relation to function
3439
properly in the context of autoflush.
3445
column_property() attributes which represent SQL expressions
3446
or columns that are not present in the mapped tables (such as
3447
those from views) are automatically expired after an INSERT or
3448
UPDATE, assuming they have not been locally modified, so that
3449
they are refreshed with the most recent data upon access.
3455
Fixed explicit, self-referential joins between two
3456
joined-table inheritance mappers when using query.join(cls,
3463
Fixed query.join() when used in conjunction with a
3464
columns-only clause and an SQL-expression ON clause in the
3471
The "allow_column_override" flag from mapper() has been
3472
removed. This flag is virtually always misunderstood. Its
3473
specific functionality is available via the
3474
include_properties/exclude_properties mapper arguments.
3480
Repaired `__str__()` method on Query.
3486
Session.bind gets used as a default even when table/mapper
3487
specific binds are defined.
3493
Added prefixes option to `Table` that accepts a list of
3494
strings to insert after CREATE in the CREATE TABLE statement.
3500
Unicode, UnicodeText types now set "assert_unicode" and
3501
"convert_unicode" by default, but accept overriding
3502
**kwargs for these values.
3508
Added new match() operator that performs a full-text search.
3509
Supported on PostgreSQL, SQLite, MySQL, MS-SQL, and Oracle
3516
Modified SQLite's representation of "microseconds" to match
3517
the output of str(somedatetime), i.e. in that the microseconds
3518
are represented as fractional seconds in string format. This
3519
makes SQLA's SQLite date type compatible with datetimes that
3520
were saved directly using Pysqlite (which just calls str()).
3521
Note that this is incompatible with the existing microseconds
3522
values in a SQLA 0.4 generated SQLite database file.
3524
To get the old behavior globally:
3526
from sqlalchemy.databases.sqlite import DateTimeMixin
3527
DateTimeMixin.__legacy_microseconds__ = True
3529
To get the behavior on individual DateTime types:
3531
t = sqlite.SLDateTime()
3532
t.__legacy_microseconds__ = True
3534
Then use "t" as the type on the Column.
3540
SQLite Date, DateTime, and Time types only accept Python
3541
datetime objects now, not strings. If you'd like to format
3542
dates as strings yourself with SQLite, use a String type. If
3543
you'd like them to return datetime objects anyway despite
3544
their accepting strings as input, make a TypeDecorator around
3545
String - SQLA doesn't encourage this pattern.
3551
Declarative supports a __table_args__ class variable, which is
3552
either a dictionary, or tuple of the form (arg1, arg2, ...,
3553
{kwarg1:value, ...}) which contains positional + kw arguments
3554
to be passed to the Table constructor.
3557
:version: 0.5.0beta1
3558
:released: Thu Jun 12 2008
3564
The "__init__" trigger/decorator added by mapper now attempts
3565
to exactly mirror the argument signature of the original
3566
__init__. The pass-through for '_sa_session' is no longer
3567
implicit- you must allow for this keyword argument in your
3574
ClassState is renamed to ClassManager.
3580
Classes may supply their own InstrumentationManager by
3581
providing a __sa_instrumentation_manager__ property.
3587
Custom instrumentation may use any mechanism to associate a
3588
ClassManager with a class and an InstanceState with an
3589
instance. Attributes on those objects are still the default
3590
association mechanism used by SQLAlchemy's native
3597
Moved entity_name, _sa_session_id, and _instance_key from the
3598
instance object to the instance state. These values are still
3599
available in the old way, which is now deprecated, using
3600
descriptors attached to the class. A deprecation warning will
3601
be issued when accessed.
3607
The _prepare_instrumentation alias for prepare_instrumentation
3614
sqlalchemy.exceptions has been renamed to sqlalchemy.exc. The
3615
module may be imported under either name.
3621
ORM-related exceptions are now defined in sqlalchemy.orm.exc.
3622
ConcurrentModificationError, FlushError, and
3623
UnmappedColumnError compatibility aliases are installed in
3624
sqlalchemy.exc during the import of sqlalchemy.orm.
3630
sqlalchemy.logging has been renamed to sqlalchemy.log.
3636
The transitional sqlalchemy.log.SADeprecationWarning alias for
3637
the warning's definition in sqlalchemy.exc has been removed.
3643
exc.AssertionError has been removed and usage replaced with
3644
Python's built-in AssertionError.
3650
The behavior of MapperExtensions attached to multiple,
3651
entity_name= primary mappers for a single class has been
3652
altered. The first mapper() defined for a class is the only
3653
mapper eligible for the MapperExtension 'instrument_class',
3654
'init_instance' and 'init_failed' events. This is backwards
3655
incompatible; previously the extensions of last mapper defined
3656
would receive these events.
3662
Added support for returning values from inserts (2.0+ only),
3663
updates and deletes (2.1+ only).
3669
global "propigate"->"propagate" change.
3675
polymorphic_union() function respects the "key" of each
3676
Column if they differ from the column's name.
3682
Fixed 0.4-only bug preventing composite columns
3683
from working properly with inheriting mappers
3689
Fixed RLock-related bug in mapper which could deadlock upon
3690
reentrant mapper compile() calls, something that occurs when
3691
using declarative constructs inside of ForeignKey objects.
3698
Fixed bug in composite types which prevented a primary-key
3699
composite type from being mutated.
3705
Added ScopedSession.is_active accessor.
3711
Class-bound accessor can be used as the argument to
3712
relation() order_by.
3718
Fixed shard_id argument on ShardedSession.execute().
3724
Connection.invalidate() checks for closed status
3725
to avoid attribute errors.
3731
NullPool supports reconnect on failure behavior.
3737
The per-dialect cache used by TypeEngine to cache
3738
dialect-specific types is now a WeakKeyDictionary.
3739
This to prevent dialect objects from
3740
being referenced forever for an application that
3741
creates an arbitrarily large number of engines
3742
or dialects. There is a small performance penalty
3743
which will be resolved in 0.6.
3749
Fixed SQLite reflection methods so that non-present
3750
cursor.description, which triggers an auto-cursor
3751
close, will be detected so that no results doesn't
3752
fail on recent versions of pysqlite which raise
3753
an error when fetchone() called with no rows present.
3759
Added Index reflection support to Postgres, using a
3760
great patch we long neglected, submitted by
3767
Fixed bug in exception raise when FK columns not present
3774
Fixed bug which was preventing out params of certain types
3775
from being received; thanks a ton to huddlej at wwu.edu !