| 1 |
-*- coding: utf-8; fill-column: 68 -*- |
|---|
| 2 |
|
|---|
| 3 |
======= |
|---|
| 4 |
CHANGES |
|---|
| 5 |
======= |
|---|
| 6 |
|
|---|
| 7 |
user_defined_state |
|---|
| 8 |
================== |
|---|
| 9 |
|
|---|
| 10 |
- The "__init__" trigger/decorator added by mapper now attempts |
|---|
| 11 |
to exactly mirror the argument signature of the original |
|---|
| 12 |
__init__. The pass-through for '_sa_session' is no longer |
|---|
| 13 |
implicit- you must allow for this keyword argument in your |
|---|
| 14 |
constructor. |
|---|
| 15 |
|
|---|
| 16 |
- ClassState is renamed to ClassManager. |
|---|
| 17 |
|
|---|
| 18 |
- Classes may supply their own InstrumentationManager by |
|---|
| 19 |
providing a __sa_instrumentation_manager__ property. |
|---|
| 20 |
|
|---|
| 21 |
- Custom instrumentation may use any mechanism to associate a |
|---|
| 22 |
ClassManager with a class and an InstanceState with an |
|---|
| 23 |
instance. Attributes on those objects are still the default |
|---|
| 24 |
association mechanism used by SQLAlchemy's native |
|---|
| 25 |
instrumentation. |
|---|
| 26 |
|
|---|
| 27 |
- Moved entity_name, _sa_session_id, and _instance_key from the |
|---|
| 28 |
instance object to the instance state. These values are still |
|---|
| 29 |
available in the old way, which is now deprecated, using |
|---|
| 30 |
descriptors attached to the class. A deprecation warning will |
|---|
| 31 |
be issued when accessed. |
|---|
| 32 |
|
|---|
| 33 |
- attribute savepoint/rollback capability has been added. For |
|---|
| 34 |
starters, this takes effect within the flush() call, so that |
|---|
| 35 |
attribute changes which occur within flush() are rolled back |
|---|
| 36 |
when the flush fails. Since it's primarily new primary key |
|---|
| 37 |
values that get assigned within flush(), expiring those |
|---|
| 38 |
attributes is not an option. The next place we might use |
|---|
| 39 |
savepoints is within SAVEPOINT transactions, since rolling |
|---|
| 40 |
back to a savepoint is a transaction-contained operation. |
|---|
| 41 |
|
|---|
| 42 |
- The _prepare_instrumentation alias for prepare_instrumentation |
|---|
| 43 |
has been removed. |
|---|
| 44 |
|
|---|
| 45 |
- sqlalchemy.exceptions has been renamed to sqlalchemy.exc. The |
|---|
| 46 |
module may be imported under either name. |
|---|
| 47 |
|
|---|
| 48 |
- ORM-related exceptions are now defined in sqlalchemy.orm.exc. |
|---|
| 49 |
ConcurrentModificationError, FlushError, and |
|---|
| 50 |
UnmappedColumnError compatibility aliases are installed in |
|---|
| 51 |
sqlalchemy.exc during the import of sqlalchemy.orm. |
|---|
| 52 |
|
|---|
| 53 |
- sqlalchemy.logging has been renamed to sqlalchemy.log. |
|---|
| 54 |
|
|---|
| 55 |
- The transitional sqlalchemy.log.SADeprecationWarning alias for |
|---|
| 56 |
the warning's definition in sqlalchemy.exc has been removed. |
|---|
| 57 |
|
|---|
| 58 |
- exc.AssertionError has been removed and usage replaced with |
|---|
| 59 |
Python's built-in AssertionError. |
|---|
| 60 |
|
|---|
| 61 |
- The behavior of MapperExtensions attached to multiple, |
|---|
| 62 |
entity_name= primary mappers for a single class has been |
|---|
| 63 |
altered. The first mapper() defined for a class is the only |
|---|
| 64 |
mapper eligible for the MapperExtension 'instrument_class', |
|---|
| 65 |
'init_instance' and 'init_failed' events. This is backwards |
|---|
| 66 |
incompatible; previously the extensions of last mapper defined |
|---|
| 67 |
would receive these events. |
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
0.4.6 |
|---|
| 71 |
===== |
|---|
| 72 |
- orm |
|---|
| 73 |
- Fix to the recent relation() refactoring which fixes |
|---|
| 74 |
exotic viewonly relations which join between local and |
|---|
| 75 |
remote table multiple times, with a common column shared |
|---|
| 76 |
between the joins. |
|---|
| 77 |
|
|---|
| 78 |
- Also re-established viewonly relation() configurations |
|---|
| 79 |
that join across multiple tables. |
|---|
| 80 |
|
|---|
| 81 |
- Added experimental relation() flag to help with |
|---|
| 82 |
primaryjoins across functions, etc., |
|---|
| 83 |
_local_remote_pairs=[tuples]. This complements a complex |
|---|
| 84 |
primaryjoin condition allowing you to provide the |
|---|
| 85 |
individual column pairs which comprise the relation's |
|---|
| 86 |
local and remote sides. Also improved lazy load SQL |
|---|
| 87 |
generation to handle placing bind params inside of |
|---|
| 88 |
functions and other expressions. (partial progress |
|---|
| 89 |
towards [ticket:610]) |
|---|
| 90 |
|
|---|
| 91 |
- Fixed "concatenate tuple" bug which could occur with |
|---|
| 92 |
Query.order_by() if clause adaption had taken place. |
|---|
| 93 |
[ticket:1027] |
|---|
| 94 |
|
|---|
| 95 |
- Removed ancient assertion that mapped selectables require |
|---|
| 96 |
"alias names" - the mapper creates its own alias now if |
|---|
| 97 |
none is present. Though in this case you need to use the |
|---|
| 98 |
class, not the mapped selectable, as the source of column |
|---|
| 99 |
attributes - so a warning is still issued. |
|---|
| 100 |
|
|---|
| 101 |
- fixes to the "exists" function involving inheritance (any(), has(), |
|---|
| 102 |
~contains()); the full target join will be rendered into the |
|---|
| 103 |
EXISTS clause for relations that link to subclasses. |
|---|
| 104 |
|
|---|
| 105 |
- restored usage of append_result() extension method for primary |
|---|
| 106 |
query rows, when the extension is present and only a single- |
|---|
| 107 |
entity result is being returned. |
|---|
| 108 |
|
|---|
| 109 |
- Also re-established viewonly relation() configurations that |
|---|
| 110 |
join across multiple tables. |
|---|
| 111 |
|
|---|
| 112 |
- removed ancient assertion that mapped selectables require |
|---|
| 113 |
"alias names" - the mapper creates its own alias now if |
|---|
| 114 |
none is present. Though in this case you need to use |
|---|
| 115 |
the class, not the mapped selectable, as the source of |
|---|
| 116 |
column attributes - so a warning is still issued. |
|---|
| 117 |
|
|---|
| 118 |
- refined mapper._save_obj() which was unnecessarily calling |
|---|
| 119 |
__ne__() on scalar values during flush [ticket:1015] |
|---|
| 120 |
|
|---|
| 121 |
- added a feature to eager loading whereby subqueries set |
|---|
| 122 |
as column_property() with explicit label names (which is not |
|---|
| 123 |
necessary, btw) will have the label anonymized when |
|---|
| 124 |
the instance is part of the eager join, to prevent |
|---|
| 125 |
conflicts with a subquery or column of the same name |
|---|
| 126 |
on the parent object. [ticket:1019] |
|---|
| 127 |
|
|---|
| 128 |
- set-based collections |=, -=, ^= and &= are stricter about |
|---|
| 129 |
their operands and only operate on sets, frozensets or |
|---|
| 130 |
subclasses of the collection type. Previously, they would |
|---|
| 131 |
accept any duck-typed set. |
|---|
| 132 |
|
|---|
| 133 |
- added an example dynamic_dict/dynamic_dict.py, illustrating |
|---|
| 134 |
a simple way to place dictionary behavior on top of |
|---|
| 135 |
a dynamic_loader. |
|---|
| 136 |
|
|---|
| 137 |
- declarative extension |
|---|
| 138 |
- Joined table inheritance mappers use a slightly relaxed |
|---|
| 139 |
function to create the "inherit condition" to the parent |
|---|
| 140 |
table, so that other foreign keys to not-yet-declared |
|---|
| 141 |
Table objects don't trigger an error. |
|---|
| 142 |
|
|---|
| 143 |
- fixed reentrant mapper compile hang when |
|---|
| 144 |
a declared attribute is used within ForeignKey, |
|---|
| 145 |
ie. ForeignKey(MyOtherClass.someattribute) |
|---|
| 146 |
|
|---|
| 147 |
- sql |
|---|
| 148 |
- Added COLLATE support via the .collate(<collation>) |
|---|
| 149 |
expression operator and collate(<expr>, <collation>) sql |
|---|
| 150 |
function. |
|---|
| 151 |
|
|---|
| 152 |
- Fixed bug with union() when applied to non-Table connected |
|---|
| 153 |
select statements |
|---|
| 154 |
|
|---|
| 155 |
- improved behavior of text() expressions when used as |
|---|
| 156 |
FROM clauses, such as select().select_from(text("sometext")) |
|---|
| 157 |
[ticket:1014] |
|---|
| 158 |
|
|---|
| 159 |
- Column.copy() respects the value of "autoincrement", |
|---|
| 160 |
fixes usage with Migrate [ticket:1021] |
|---|
| 161 |
|
|---|
| 162 |
- engines |
|---|
| 163 |
- Pool listeners can now be provided as a dictionary of |
|---|
| 164 |
callables or a (possibly partial) duck-type of |
|---|
| 165 |
PoolListener, your choice. |
|---|
| 166 |
|
|---|
| 167 |
- added "rollback_returned" option to Pool which will |
|---|
| 168 |
disable the rollback() issued when connections are |
|---|
| 169 |
returned. This flag is only safe to use with a database |
|---|
| 170 |
which does not support transactions (i.e. MySQL/MyISAM). |
|---|
| 171 |
|
|---|
| 172 |
-ext |
|---|
| 173 |
- set-based association proxies |=, -=, ^= and &= are |
|---|
| 174 |
stricter about their operands and only operate on sets, |
|---|
| 175 |
frozensets or other association proxies. Previously, they |
|---|
| 176 |
would accept any duck-typed set. |
|---|
| 177 |
|
|---|
| 178 |
- mssql |
|---|
| 179 |
- Added "odbc_autotranslate" parameter to engine / dburi |
|---|
| 180 |
parameters. Any given string will be passed through to the |
|---|
| 181 |
ODBC connection string as: |
|---|
| 182 |
|
|---|
| 183 |
"AutoTranslate=%s" % odbc_autotranslate |
|---|
| 184 |
|
|---|
| 185 |
[ticket:1005] |
|---|
| 186 |
|
|---|
| 187 |
- Added "odbc_options" parameter to engine / dburi |
|---|
| 188 |
parameters. The given string is simply appended to the |
|---|
| 189 |
SQLAlchemy-generated odbc connection string. |
|---|
| 190 |
|
|---|
| 191 |
This should obviate the need of adding a myriad of ODBC |
|---|
| 192 |
options in the future. |
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
- firebird |
|---|
| 196 |
- Handle the "SUBSTRING(:string FROM :start FOR :length)" |
|---|
| 197 |
builtin. |
|---|
| 198 |
|
|---|
| 199 |
0.4.5 |
|---|
| 200 |
===== |
|---|
| 201 |
- orm |
|---|
| 202 |
- A small change in behavior to session.merge() - existing |
|---|
| 203 |
objects are checked for based on primary key attributes, not |
|---|
| 204 |
necessarily _instance_key. So the widely requested |
|---|
| 205 |
capability, that: |
|---|
| 206 |
|
|---|
| 207 |
x = MyObject(id=1) |
|---|
| 208 |
x = sess.merge(x) |
|---|
| 209 |
|
|---|
| 210 |
will in fact load MyObject with id #1 from the database if |
|---|
| 211 |
present, is now available. merge() still copies the state |
|---|
| 212 |
of the given object to the persistent one, so an example |
|---|
| 213 |
like the above would typically have copied "None" from all |
|---|
| 214 |
attributes of "x" onto the persistent copy. These can be |
|---|
| 215 |
reverted using session.expire(x). |
|---|
| 216 |
|
|---|
| 217 |
- Also fixed behavior in merge() whereby collection elements |
|---|
| 218 |
present on the destination but not the merged collection |
|---|
| 219 |
were not being removed from the destination. |
|---|
| 220 |
|
|---|
| 221 |
- Added a more aggressive check for "uncompiled mappers", |
|---|
| 222 |
helps particularly with declarative layer [ticket:995] |
|---|
| 223 |
|
|---|
| 224 |
- The methodology behind "primaryjoin"/"secondaryjoin" has |
|---|
| 225 |
been refactored. Behavior should be slightly more |
|---|
| 226 |
intelligent, primarily in terms of error messages which |
|---|
| 227 |
have been pared down to be more readable. In a slight |
|---|
| 228 |
number of scenarios it can better resolve the correct |
|---|
| 229 |
foreign key than before. |
|---|
| 230 |
|
|---|
| 231 |
- Added comparable_property(), adds query Comparator |
|---|
| 232 |
behavior to regular, unmanaged Python properties |
|---|
| 233 |
|
|---|
| 234 |
- the functionality of query.with_polymorphic() has |
|---|
| 235 |
been added to mapper() as a configuration option. |
|---|
| 236 |
|
|---|
| 237 |
It's set via several forms: |
|---|
| 238 |
with_polymorphic='*' |
|---|
| 239 |
with_polymorphic=[mappers] |
|---|
| 240 |
with_polymorphic=('*', selectable) |
|---|
| 241 |
with_polymorphic=([mappers], selectable) |
|---|
| 242 |
|
|---|
| 243 |
This controls the default polymorphic loading strategy |
|---|
| 244 |
for inherited mappers. When a selectable is not given, |
|---|
| 245 |
outer joins are created for all joined-table inheriting |
|---|
| 246 |
mappers requested. Note that the auto-create of joins |
|---|
| 247 |
is not compatible with concrete table inheritance. |
|---|
| 248 |
|
|---|
| 249 |
The existing select_table flag on mapper() is now |
|---|
| 250 |
deprecated and is synonymous with |
|---|
| 251 |
with_polymorphic('*', select_table). Note that the |
|---|
| 252 |
underlying "guts" of select_table have been |
|---|
| 253 |
completely removed and replaced with the newer, |
|---|
| 254 |
more flexible approach. |
|---|
| 255 |
|
|---|
| 256 |
The new approach also automatically allows eager loads |
|---|
| 257 |
to work for subclasses, if they are present, for |
|---|
| 258 |
example |
|---|
| 259 |
sess.query(Company).options( |
|---|
| 260 |
eagerload_all( |
|---|
| 261 |
[Company.employees.of_type(Engineer), 'machines'] |
|---|
| 262 |
)) |
|---|
| 263 |
to load Company objects, their employees, and the |
|---|
| 264 |
'machines' collection of employees who happen to be |
|---|
| 265 |
Engineers. A "with_polymorphic" Query option should be |
|---|
| 266 |
introduced soon as well which would allow per-Query |
|---|
| 267 |
control of with_polymorphic() on relations. |
|---|
| 268 |
|
|---|
| 269 |
- added two "experimental" features to Query, |
|---|
| 270 |
"experimental" in that their specific name/behavior |
|---|
| 271 |
is not carved in stone just yet: _values() and |
|---|
| 272 |
_from_self(). We'd like feedback on these. |
|---|
| 273 |
|
|---|
| 274 |
- _values(*columns) is given a list of column |
|---|
| 275 |
expressions, and returns a new Query that only |
|---|
| 276 |
returns those columns. When evaluated, the return |
|---|
| 277 |
value is a list of tuples just like when using |
|---|
| 278 |
add_column() or add_entity(), the only difference is |
|---|
| 279 |
that "entity zero", i.e. the mapped class, is not |
|---|
| 280 |
included in the results. This means it finally makes |
|---|
| 281 |
sense to use group_by() and having() on Query, which |
|---|
| 282 |
have been sitting around uselessly until now. |
|---|
| 283 |
|
|---|
| 284 |
A future change to this method may include that its |
|---|
| 285 |
ability to join, filter and allow other options not |
|---|
| 286 |
related to a "resultset" are removed, so the feedback |
|---|
| 287 |
we're looking for is how people want to use |
|---|
| 288 |
_values()...i.e. at the very end, or do people prefer |
|---|
| 289 |
to continue generating after it's called. |
|---|
| 290 |
|
|---|
| 291 |
- _from_self() compiles the SELECT statement for the |
|---|
| 292 |
Query (minus any eager loaders), and returns a new |
|---|
| 293 |
Query that selects from that SELECT. So basically you |
|---|
| 294 |
can query from a Query without needing to extract the |
|---|
| 295 |
SELECT statement manually. This gives meaning to |
|---|
| 296 |
operations like query[3:5]._from_self().filter(some |
|---|
| 297 |
criterion). There's not much controversial here |
|---|
| 298 |
except that you can quickly create highly nested |
|---|
| 299 |
queries that are less efficient, and we want feedback |
|---|
| 300 |
on the naming choice. |
|---|
| 301 |
|
|---|
| 302 |
- query.order_by() and query.group_by() will accept |
|---|
| 303 |
multiple arguments using *args (like select() |
|---|
| 304 |
already does). |
|---|
| 305 |
|
|---|
| 306 |
- Added some convenience descriptors to Query: |
|---|
| 307 |
query.statement returns the full SELECT construct, |
|---|
| 308 |
query.whereclause returns just the WHERE part of the |
|---|
| 309 |
SELECT construct. |
|---|
| 310 |
|
|---|
| 311 |
- Fixed/covered case when using a False/0 value as a |
|---|
| 312 |
polymorphic discriminator. |
|---|
| 313 |
|
|---|
| 314 |
- Fixed bug which was preventing synonym() attributes from |
|---|
| 315 |
being used with inheritance |
|---|
| 316 |
|
|---|
| 317 |
- Fixed SQL function truncation of trailing underscores |
|---|
| 318 |
[ticket:996] |
|---|
| 319 |
|
|---|
| 320 |
- When attributes are expired on a pending instance, an |
|---|
| 321 |
error will not be raised when the "refresh" action is |
|---|
| 322 |
triggered and no result is found. |
|---|
| 323 |
|
|---|
| 324 |
- Session.execute can now find binds from metadata |
|---|
| 325 |
|
|---|
| 326 |
- Adjusted the definition of "self-referential" to be any |
|---|
| 327 |
two mappers with a common parent (this affects whether or |
|---|
| 328 |
not aliased=True is required when joining with Query). |
|---|
| 329 |
|
|---|
| 330 |
- Made some fixes to the "from_joinpoint" argument to |
|---|
| 331 |
query.join() so that if the previous join was aliased and |
|---|
| 332 |
this one isn't, the join still happens successfully. |
|---|
| 333 |
|
|---|
| 334 |
- Assorted "cascade deletes" fixes: |
|---|
| 335 |
- Fixed "cascade delete" operation of dynamic relations, |
|---|
| 336 |
which had only been implemented for foreign-key |
|---|
| 337 |
nulling behavior in 0.4.2 and not actual cascading |
|---|
| 338 |
deletes [ticket:895] |
|---|
| 339 |
|
|---|
| 340 |
- Delete cascade without delete-orphan cascade on a |
|---|
| 341 |
many-to-one will not delete orphans which were |
|---|
| 342 |
disconnected from the parent before session.delete() |
|---|
| 343 |
is called on the parent (one-to-many already had |
|---|
| 344 |
this). |
|---|
| 345 |
|
|---|
| 346 |
- Delete cascade with delete-orphan will delete orphans |
|---|
| 347 |
whether or not it remains attached to its also-deleted |
|---|
| 348 |
parent. |
|---|
| 349 |
|
|---|
| 350 |
- delete-orphan casacde is properly detected on relations |
|---|
| 351 |
that are present on superclasses when using inheritance. |
|---|
| 352 |
|
|---|
| 353 |
- Fixed order_by calculation in Query to properly alias |
|---|
| 354 |
mapper-config'ed order_by when using select_from() |
|---|
| 355 |
|
|---|
| 356 |
- Refactored the diffing logic that kicks in when replacing |
|---|
| 357 |
one collection with another into collections.bulk_replace, |
|---|
| 358 |
useful to anyone building multi-level collections. |
|---|
| 359 |
|
|---|
| 360 |
- Cascade traversal algorithm converted from recursive to |
|---|
| 361 |
iterative to support deep object graphs. |
|---|
| 362 |
|
|---|
| 363 |
- sql |
|---|
| 364 |
- schema-qualified tables now will place the schemaname |
|---|
| 365 |
ahead of the tablename in all column expressions as well |
|---|
| 366 |
as when generating column labels. This prevents cross- |
|---|
| 367 |
schema name collisions in all cases [ticket:999] |
|---|
| 368 |
|
|---|
| 369 |
- can now allow selects which correlate all FROM clauses |
|---|
| 370 |
and have no FROM themselves. These are typically |
|---|
| 371 |
used in a scalar context, i.e. SELECT x, (SELECT x WHERE y) |
|---|
| 372 |
FROM table. Requires explicit correlate() call. |
|---|
| 373 |
|
|---|
| 374 |
- 'name' is no longer a required constructor argument for |
|---|
| 375 |
Column(). It (and .key) may now be deferred until the |
|---|
| 376 |
column is added to a Table. |
|---|
| 377 |
|
|---|
| 378 |
- like(), ilike(), contains(), startswith(), endswith() take |
|---|
| 379 |
an optional keyword argument "escape=<somestring>", which |
|---|
| 380 |
is set as the escape character using the syntax "x LIKE y |
|---|
| 381 |
ESCAPE '<somestring>'" [ticket:993], [ticket:791] |
|---|
| 382 |
|
|---|
| 383 |
- random() is now a generic sql function and will compile to |
|---|
| 384 |
the database's random implementation, if any. |
|---|
| 385 |
|
|---|
| 386 |
- update().values() and insert().values() take keyword |
|---|
| 387 |
arguments. |
|---|
| 388 |
|
|---|
| 389 |
- Fixed an issue in select() regarding its generation of |
|---|
| 390 |
FROM clauses, in rare circumstances two clauses could be |
|---|
| 391 |
produced when one was intended to cancel out the other. |
|---|
| 392 |
Some ORM queries with lots of eager loads might have seen |
|---|
| 393 |
this symptom. |
|---|
| 394 |
|
|---|
| 395 |
- The case() function now also takes a dictionary as its |
|---|
| 396 |
whens parameter. It also interprets the "THEN" |
|---|
| 397 |
expressions as values by default, meaning case([(x==y, |
|---|
| 398 |
"foo")]) will interpret "foo" as a bound value, not a SQL |
|---|
| 399 |
expression. use text(expr) for literal SQL expressions in |
|---|
| 400 |
this case. For the criterion itself, these may be literal |
|---|
| 401 |
strings only if the "value" keyword is present, otherwise |
|---|
| 402 |
SA will force explicit usage of either text() or |
|---|
| 403 |
literal(). |
|---|
| 404 |
|
|---|
| 405 |
- oracle |
|---|
| 406 |
- The "owner" keyword on Table is now deprecated, and is |
|---|
| 407 |
exactly synonymous with the "schema" keyword. Tables can |
|---|
| 408 |
now be reflected with alternate "owner" attributes, |
|---|
| 409 |
explicitly stated on the Table object or not using |
|---|
| 410 |
"schema". |
|---|
| 411 |
|
|---|
| 412 |
- All of the "magic" searching for synonyms, DBLINKs etc. |
|---|
| 413 |
during table reflection are disabled by default unless you |
|---|
| 414 |
specify "oracle_resolve_synonyms=True" on the Table |
|---|
| 415 |
object. Resolving synonyms necessarily leads to some |
|---|
| 416 |
messy guessing which we'd rather leave off by default. |
|---|
| 417 |
When the flag is set, tables and related tables will be |
|---|
| 418 |
resolved against synonyms in all cases, meaning if a |
|---|
| 419 |
synonym exists for a particular table, reflection will use |
|---|
| 420 |
it when reflecting related tables. This is stickier |
|---|
| 421 |
behavior than before which is why it's off by default. |
|---|
| 422 |
|
|---|
| 423 |
- declarative extension |
|---|
| 424 |
- The "synonym" function is now directly usable with |
|---|
| 425 |
"declarative". Pass in the decorated property using the |
|---|
| 426 |
"descriptor" keyword argument, e.g.: somekey = |
|---|
| 427 |
synonym('_somekey', descriptor=property(g, s)) |
|---|
| 428 |
|
|---|
| 429 |
- The "deferred" function is usable with "declarative". |
|---|
| 430 |
Simplest usage is to declare deferred and Column together, |
|---|
| 431 |
e.g.: data = deferred(Column(Text)) |
|---|
| 432 |
|
|---|
| 433 |
- Declarative also gained @synonym_for(...) and |
|---|
| 434 |
@comparable_using(...), front-ends for synonym and |
|---|
| 435 |
comparable_property. |
|---|
| 436 |
|
|---|
| 437 |
- Improvements to mapper compilation when using declarative; |
|---|
| 438 |
already-compiled mappers will still trigger compiles of |
|---|
| 439 |
other uncompiled mappers when used [ticket:995] |
|---|
| 440 |
|
|---|
| 441 |
- Declarative will complete setup for Columns lacking names, |
|---|
| 442 |
allows a more DRY syntax. |
|---|
| 443 |
|
|---|
| 444 |
class Foo(Base): |
|---|
| 445 |
__tablename__ = 'foos' |
|---|
| 446 |
id = Column(Integer, primary_key=True) |
|---|
| 447 |
|
|---|
| 448 |
- inheritance in declarative can be disabled when sending |
|---|
| 449 |
"inherits=None" to __mapper_args__. |
|---|
| 450 |
|
|---|
| 451 |
- declarative_base() takes optional kwarg "mapper", which |
|---|
| 452 |
is any callable/class/method that produces a mapper, |
|---|
| 453 |
such as declarative_base(mapper=scopedsession.mapper). |
|---|
| 454 |
This property can also be set on individual declarative |
|---|
| 455 |
classes using the "__mapper_cls__" property. |
|---|
| 456 |
|
|---|
| 457 |
- postgres |
|---|
| 458 |
- Got PG server side cursors back into shape, added fixed |
|---|
| 459 |
unit tests as part of the default test suite. Added |
|---|
| 460 |
better uniqueness to the cursor ID [ticket:1001] |
|---|
| 461 |
|
|---|
| 462 |
- oracle |
|---|
| 463 |
- The "owner" keyword on Table is now deprecated, and is |
|---|
| 464 |
exactly synonymous with the "schema" keyword. Tables can |
|---|
| 465 |
now be reflected with alternate "owner" attributes, |
|---|
| 466 |
explicitly stated on the Table object or not using |
|---|
| 467 |
"schema". |
|---|
| 468 |
|
|---|
| 469 |
- All of the "magic" searching for synonyms, DBLINKs etc. |
|---|
| 470 |
during table reflection are disabled by default unless you |
|---|
| 471 |
specify "oracle_resolve_synonyms=True" on the Table |
|---|
| 472 |
object. Resolving synonyms necessarily leads to some |
|---|
| 473 |
messy guessing which we'd rather leave off by default. |
|---|
| 474 |
When the flag is set, tables and related tables will be |
|---|
| 475 |
resolved against synonyms in all cases, meaning if a |
|---|
| 476 |
synonym exists for a particular table, reflection will use |
|---|
| 477 |
it when reflecting related tables. This is stickier |
|---|
| 478 |
behavior than before which is why it's off by default. |
|---|
| 479 |
|
|---|
| 480 |
- mssql |
|---|
| 481 |
- Reflected tables will now automatically load other tables |
|---|
| 482 |
which are referenced by Foreign keys in the auto-loaded |
|---|
| 483 |
table, [ticket:979]. |
|---|
| 484 |
|
|---|
| 485 |
- Added executemany check to skip identity fetch, [ticket:916]. |
|---|
| 486 |
|
|---|
| 487 |
- Added stubs for small date type, [ticket:884] |
|---|
| 488 |
|
|---|
| 489 |
- Added a new 'driver' keyword parameter for the pyodbc dialect. |
|---|
| 490 |
Will substitute into the ODBC connection string if given, |
|---|
| 491 |
defaults to 'SQL Server'. |
|---|
| 492 |
|
|---|
| 493 |
- Added a new 'max_identifier_length' keyword parameter for |
|---|
| 494 |
the pyodbc dialect. |
|---|
| 495 |
|
|---|
| 496 |
- Improvements to pyodbc + Unix. If you couldn't get that |
|---|
| 497 |
combination to work before, please try again. |
|---|
| 498 |
|
|---|
| 499 |
- mysql |
|---|
| 500 |
- The connection.info keys the dialect uses to cache server |
|---|
| 501 |
settings have changed and are now namespaced. |
|---|
| 502 |
|
|---|
| 503 |
0.4.4 |
|---|
| 504 |
------ |
|---|
| 505 |
- sql |
|---|
| 506 |
- Can again create aliases of selects against textual FROM |
|---|
| 507 |
clauses, [ticket:975] |
|---|
| 508 |
|
|---|
| 509 |
- The value of a bindparam() can be a callable, in which |
|---|
| 510 |
case it's evaluated at statement execution time to get the |
|---|
| 511 |
value. |
|---|
| 512 |
|
|---|
| 513 |
- Added exception wrapping/reconnect support to result set |
|---|
| 514 |
fetching. Reconnect works for those databases that raise |
|---|
| 515 |
a catchable data error during results (i.e. doesn't work |
|---|
| 516 |
on MySQL) [ticket:978] |
|---|
| 517 |
|
|---|
| 518 |
- Implemented two-phase API for "threadlocal" engine, via |
|---|
| 519 |
engine.begin_twophase(), engine.prepare() [ticket:936] |
|---|
| 520 |
|
|---|
| 521 |
- Fixed bug which was preventing UNIONS from being |
|---|
| 522 |
cloneable, [ticket:986] |
|---|
| 523 |
|
|---|
| 524 |
- Added "bind" keyword argument to insert(), update(), |
|---|
| 525 |
delete() and DDL(). The .bind property is now assignable |
|---|
| 526 |
on those statements as well as on select(). |
|---|
| 527 |
|
|---|
| 528 |
- Insert statements can now be compiled with extra "prefix" |
|---|
| 529 |
words between INSERT and INTO, for vendor extensions like |
|---|
| 530 |
MySQL's INSERT IGNORE INTO table. |
|---|
| 531 |
|
|---|
| 532 |
- orm |
|---|
| 533 |
- any(), has(), contains(), ~contains(), attribute level == |
|---|
| 534 |
and != now work properly with self-referential relations - |
|---|
| 535 |
the clause inside the EXISTS is aliased on the "remote" |
|---|
| 536 |
side to distinguish it from the parent table. This |
|---|
| 537 |
applies to single table self-referential as well as |
|---|
| 538 |
inheritance-based self-referential. |
|---|
| 539 |
|
|---|
| 540 |
- Repaired behavior of == and != operators at the relation() |
|---|
| 541 |
level when compared against NULL for one-to-one relations |
|---|
| 542 |
[ticket:985] |
|---|
| 543 |
|
|---|
| 544 |
- Fixed bug whereby session.expire() attributes were not |
|---|
| 545 |
loading on an polymorphically-mapped instance mapped by a |
|---|
| 546 |
select_table mapper. |
|---|
| 547 |
|
|---|
| 548 |
- Added query.with_polymorphic() - specifies a list of |
|---|
| 549 |
classes which descend from the base class, which will be |
|---|
| 550 |
added to the FROM clause of the query. Allows subclasses |
|---|
| 551 |
to be used within filter() criterion as well as eagerly |
|---|
| 552 |
loads the attributes of those subclasses. |
|---|
| 553 |
|
|---|
| 554 |
- Your cries have been heard: removing a pending item from |
|---|
| 555 |
an attribute or collection with delete-orphan expunges the |
|---|
| 556 |
item from the session; no FlushError is raised. Note that |
|---|
| 557 |
if you session.save()'ed the pending item explicitly, the |
|---|
| 558 |
attribute/collection removal still knocks it out. |
|---|
| 559 |
|
|---|
| 560 |
- session.refresh() and session.expire() raise an error when |
|---|
| 561 |
called on instances which are not persistent within the |
|---|
| 562 |
session |
|---|
| 563 |
|
|---|
| 564 |
- Fixed potential generative bug when the same Query was |
|---|
| 565 |
used to generate multiple Query objects using join(). |
|---|
| 566 |
|
|---|
| 567 |
- Fixed bug which was introduced in 0.4.3, whereby loading |
|---|
| 568 |
an already-persistent instance mapped with joined table |
|---|
| 569 |
inheritance would trigger a useless "secondary" load from |
|---|
| 570 |
its joined table, when using the default "select" |
|---|
| 571 |
polymorphic_fetch. This was due to attributes being |
|---|
| 572 |
marked as expired during its first load and not getting |
|---|
| 573 |
unmarked from the previous "secondary" load. Attributes |
|---|
| 574 |
are now unexpired based on presence in __dict__ after any |
|---|
| 575 |
load or commit operation succeeds. |
|---|
| 576 |
|
|---|
| 577 |
- Deprecated Query methods apply_sum(), apply_max(), |
|---|
| 578 |
apply_min(), apply_avg(). Better methodologies are |
|---|
| 579 |
coming.... |
|---|
| 580 |
|
|---|
| 581 |
- relation() can accept a callable for its first argument, |
|---|
| 582 |
which returns the class to be related. This is in place |
|---|
| 583 |
to assist declarative packages to define relations without |
|---|
| 584 |
classes yet being in place. |
|---|
| 585 |
|
|---|
| 586 |
- Added a new "higher level" operator called "of_type()": |
|---|
| 587 |
used in join() as well as with any() and has(), qualifies |
|---|
| 588 |
the subclass which will be used in filter criterion, e.g.: |
|---|
| 589 |
|
|---|
| 590 |
query.filter(Company.employees.of_type(Engineer). |
|---|
| 591 |
any(Engineer.name=='foo')) |
|---|
| 592 |
|
|---|
| 593 |
or |
|---|
| 594 |
|
|---|
| 595 |
query.join(Company.employees.of_type(Engineer)). |
|---|
| 596 |
filter(Engineer.name=='foo') |
|---|
| 597 |
|
|---|
| 598 |
- Preventive code against a potential lost-reference bug in |
|---|
| 599 |
flush(). |
|---|
| 600 |
|
|---|
| 601 |
- Expressions used in filter(), filter_by() and others, when |
|---|
| 602 |
they make usage of a clause generated from a relation |
|---|
| 603 |
using the identity of a child object (e.g., |
|---|
| 604 |
filter(Parent.child==<somechild>)), evaluate the actual |
|---|
| 605 |
primary key value of <somechild> at execution time so that |
|---|
| 606 |
the autoflush step of the Query can complete, thereby |
|---|
| 607 |
populating the PK value of <somechild> in the case that |
|---|
| 608 |
<somechild> was pending. |
|---|
| 609 |
|
|---|
| 610 |
- setting the relation()-level order by to a column in the |
|---|
| 611 |
many-to-many "secondary" table will now work with eager |
|---|
| 612 |
loading, previously the "order by" wasn't aliased against |
|---|
| 613 |
the secondary table's alias. |
|---|
| 614 |
|
|---|
| 615 |
- Synonyms riding on top of existing descriptors are now |
|---|
| 616 |
full proxies to those descriptors. |
|---|
| 617 |
|
|---|
| 618 |
- dialects |
|---|
| 619 |
- Invalid SQLite connection URLs now raise an error. |
|---|
| 620 |
|
|---|
| 621 |
- postgres TIMESTAMP renders correctly [ticket:981] |
|---|
| 622 |
|
|---|
| 623 |
- postgres PGArray is a "mutable" type by default; when used |
|---|
| 624 |
with the ORM, mutable-style equality/ copy-on-write |
|---|
| 625 |
techniques are used to test for changes. |
|---|
| 626 |
|
|---|
| 627 |
- extensions |
|---|
| 628 |
- a new super-small "declarative" extension has been added, |
|---|
| 629 |
which allows Table and mapper() configuration to take |
|---|
| 630 |
place inline underneath a class declaration. This |
|---|
| 631 |
extension differs from ActiveMapper and Elixir in that it |
|---|
| 632 |
does not redefine any SQLAlchemy semantics at all; literal |
|---|
| 633 |
Column, Table and relation() constructs are used to define |
|---|
| 634 |
the class behavior and table definition. |
|---|
| 635 |
|
|---|
| 636 |
0.4.3 |
|---|
| 637 |
------ |
|---|
| 638 |
- sql |
|---|
| 639 |
- Added "schema.DDL", an executable free-form DDL statement. |
|---|
| 640 |
DDLs can be executed in isolation or attached to Table or |
|---|
| 641 |
MetaData instances and executed automatically when those |
|---|
| 642 |
objects are created and/or dropped. |
|---|
| 643 |
|
|---|
| 644 |
- Table columns and constraints can be overridden on a an |
|---|
| 645 |
existing table (such as a table that was already reflected) |
|---|
| 646 |
using the 'useexisting=True' flag, which now takes into |
|---|
| 647 |
account the arguments passed along with it. |
|---|
| 648 |
|
|---|
| 649 |
- Added a callable-based DDL events interface, adds hooks |
|---|
| 650 |
before and after Tables and MetaData create and drop. |
|---|
| 651 |
|
|---|
| 652 |
- Added generative where(<criterion>) method to delete() and |
|---|
| 653 |
update() constructs which return a new object with criterion |
|---|
| 654 |
joined to existing criterion via AND, just like |
|---|
| 655 |
select().where(). |
|---|
| 656 |
|
|---|
| 657 |
- Added "ilike()" operator to column operations. Compiles to |
|---|
| 658 |
ILIKE on postgres, lower(x) LIKE lower(y) on all |
|---|
| 659 |
others. [ticket:727] |
|---|
| 660 |
|
|---|
| 661 |
- Added "now()" as a generic function; on SQLite, Oracle |
|---|
| 662 |
and MSSQL compiles as "CURRENT_TIMESTAMP"; "now()" on |
|---|
| 663 |
all others. [ticket:943] |
|---|
| 664 |
|
|---|
| 665 |
- The startswith(), endswith(), and contains() operators now |
|---|
| 666 |
concatenate the wildcard operator with the given operand in |
|---|
| 667 |
SQL, i.e. "'%' || <bindparam>" in all cases, accept |
|---|
| 668 |
text('something') operands properly [ticket:962] |
|---|
| 669 |
|
|---|
| 670 |
- cast() accepts text('something') and other non-literal |
|---|
| 671 |
operands properly [ticket:962] |
|---|
| 672 |
|
|---|
| 673 |
- fixed bug in result proxy where anonymously generated |
|---|
| 674 |
column labels would not be accessible using their straight |
|---|
| 675 |
string name |
|---|
| 676 |
|
|---|
| 677 |
- Deferrable constraints can now be defined. |
|---|
| 678 |
|
|---|
| 679 |
- Added "autocommit=True" keyword argument to select() and |
|---|
| 680 |
text(), as well as generative autocommit() method on |
|---|
| 681 |
select(); for statements which modify the database through |
|---|
| 682 |
some user-defined means other than the usual INSERT/UPDATE/ |
|---|
| 683 |
DELETE etc. This flag will enable "autocommit" behavior |
|---|
| 684 |
during execution if no transaction is in progress. |
|---|
| 685 |
[ticket:915] |
|---|
| 686 |
|
|---|
| 687 |
- The '.c.' attribute on a selectable now gets an entry for |
|---|
| 688 |
every column expression in its columns clause. Previously, |
|---|
| 689 |
"unnamed" columns like functions and CASE statements weren't |
|---|
| 690 |
getting put there. Now they will, using their full string |
|---|
| 691 |
representation if no 'name' is available. |
|---|
| 692 |
|
|---|
| 693 |
- a CompositeSelect, i.e. any union(), union_all(), |
|---|
| 694 |
intersect(), etc. now asserts that each selectable contains |
|---|
| 695 |
the same number of columns. This conforms to the |
|---|
| 696 |
corresponding SQL requirement. |
|---|
| 697 |
|
|---|
| 698 |
- The anonymous 'label' generated for otherwise unlabeled |
|---|
| 699 |
functions and expressions now propagates outwards at compile |
|---|
| 700 |
time for expressions like select([select([func.foo()])]). |
|---|
| 701 |
|
|---|
| 702 |
- Building on the above ideas, CompositeSelects now build up |
|---|
| 703 |
their ".c." collection based on the names present in the |
|---|
| 704 |
first selectable only; corresponding_column() now works |
|---|
| 705 |
fully for all embedded selectables. |
|---|
| 706 |
|
|---|
| 707 |
- Oracle and others properly encode SQL used for defaults like |
|---|
| 708 |
sequences, etc., even if no unicode idents are used since |
|---|
| 709 |
identifier preparer may return a cached unicode identifier. |
|---|
| 710 |
|
|---|
| 711 |
- Column and clause comparisons to datetime objects on the |
|---|
| 712 |
left hand side of the expression now work (d < table.c.col). |
|---|
| 713 |
(datetimes on the RHS have always worked, the LHS exception |
|---|
| 714 |
is a quirk of the datetime implementation.) |
|---|
| 715 |
|
|---|
| 716 |
- orm |
|---|
| 717 |
- Every Session.begin() must now be accompanied by a |
|---|
| 718 |
corresponding commit() or rollback() unless the session is |
|---|
| 719 |
closed with Session.close(). This also includes the begin() |
|---|
| 720 |
which is implicit to a session created with |
|---|
| 721 |
transactional=True. The biggest change introduced here is |
|---|
| 722 |
that when a Session created with transactional=True raises |
|---|
| 723 |
an exception during flush(), you must call |
|---|
| 724 |
Session.rollback() or Session.close() in order for that |
|---|
| 725 |
Session to continue after an exception. |
|---|
| 726 |
|
|---|
| 727 |
- Fixed merge() collection-doubling bug when merging transient |
|---|
| 728 |
entities with backref'ed collections. [ticket:961] |
|---|
| 729 |
|
|---|
| 730 |
- merge(dont_load=True) does not accept transient entities, |
|---|
| 731 |
this is in continuation with the fact that |
|---|
| 732 |
merge(dont_load=True) does not accept any "dirty" objects |
|---|
| 733 |
either. |
|---|
| 734 |
|
|---|
| 735 |
- Added standalone "query" class attribute generated by a |
|---|
| 736 |
scoped_session. This provides MyClass.query without using |
|---|
| 737 |
Session.mapper. Use via: |
|---|
| 738 |
|
|---|
| 739 |
MyClass.query = Session.query_property() |
|---|
| 740 |
|
|---|
| 741 |
- The proper error message is raised when trying to access |
|---|
| 742 |
expired instance attributes with no session present |
|---|
| 743 |
|
|---|
| 744 |
- dynamic_loader() / lazy="dynamic" now accepts and uses |
|---|
| 745 |
the order_by parameter in the same way in which it works |
|---|
| 746 |
with relation(). |
|---|
| 747 |
|
|---|
| 748 |
- Added expire_all() method to Session. Calls expire() for |
|---|
| 749 |
all persistent instances. This is handy in conjunction |
|---|
| 750 |
with... |
|---|
| 751 |
|
|---|
| 752 |
- Instances which have been partially or fully expired will |
|---|
| 753 |
have their expired attributes populated during a regular |
|---|
| 754 |
Query operation which affects those objects, preventing a |
|---|
| 755 |
needless second SQL statement for each instance. |
|---|
| 756 |
|
|---|
| 757 |
- Dynamic relations, when referenced, create a strong |
|---|
| 758 |
reference to the parent object so that the query still has a |
|---|
| 759 |
parent to call against even if the parent is only created |
|---|
| 760 |
(and otherwise dereferenced) within the scope of a single |
|---|
| 761 |
expression. [ticket:938] |
|---|
| 762 |
|
|---|
| 763 |
- Added a mapper() flag "eager_defaults". When set to True, |
|---|
| 764 |
defaults that are generated during an INSERT or UPDATE |
|---|
| 765 |
operation are post-fetched immediately, instead of being |
|---|
| 766 |
deferred until later. This mimics the old 0.3 behavior. |
|---|
| 767 |
|
|---|
| 768 |
- query.join() can now accept class-mapped attributes as |
|---|
| 769 |
arguments. These can be used in place or in any combination |
|---|
| 770 |
with strings. In particular this allows construction of |
|---|
| 771 |
joins to subclasses on a polymorphic relation, i.e.: |
|---|
| 772 |
|
|---|
| 773 |
query(Company).join(['employees', Engineer.name]) |
|---|
| 774 |
|
|---|
| 775 |
- query.join() can also accept tuples of attribute name/some |
|---|
| 776 |
selectable as arguments. This allows construction of joins |
|---|
| 777 |
*from* subclasses of a polymorphic relation, i.e.: |
|---|
| 778 |
|
|---|
| 779 |
query(Company).\ |
|---|
| 780 |
join( |
|---|
| 781 |
[('employees', people.join(engineer)), Engineer.name] |
|---|
| 782 |
) |
|---|
| 783 |
|
|---|
| 784 |
- General improvements to the behavior of join() in |
|---|
| 785 |
conjunction with polymorphic mappers, i.e. joining from/to |
|---|
| 786 |
polymorphic mappers and properly applying aliases. |
|---|
| 787 |
|
|---|
| 788 |
- Fixed/improved behavior when a mapper determines the natural |
|---|
| 789 |
"primary key" of a mapped join, it will more effectively |
|---|
| 790 |
reduce columns which are equivalent via foreign key |
|---|
| 791 |
relation. This affects how many arguments need to be sent |
|---|
| 792 |
to query.get(), among other things. [ticket:933] |
|---|
| 793 |
|
|---|
| 794 |
- The lazy loader can now handle a join condition where the |
|---|
| 795 |
"bound" column (i.e. the one that gets the parent id sent as |
|---|
| 796 |
a bind parameter) appears more than once in the join |
|---|
| 797 |
condition. Specifically this allows the common task of a |
|---|
| 798 |
relation() which contains a parent-correlated subquery, such |
|---|
| 799 |
as "select only the most recent child item". [ticket:946] |
|---|
| 800 |
|
|---|
| 801 |
- Fixed bug in polymorphic inheritance where an incorrect |
|---|
| 802 |
exception is raised when base polymorphic_on column does not |
|---|
| 803 |
correspond to any columns within the local selectable of an |
|---|
| 804 |
inheriting mapper more than one level deep |
|---|
| 805 |
|
|---|
| 806 |
- Fixed bug in polymorphic inheritance which made it difficult |
|---|
| 807 |
to set a working "order_by" on a polymorphic mapper. |
|---|
| 808 |
|
|---|
| 809 |
- Fixed a rather expensive call in Query that was slowing down |
|---|
| 810 |
polymorphic queries. |
|---|
| 811 |
|
|---|
| 812 |
- "Passive defaults" and other "inline" defaults can now be |
|---|
| 813 |
loaded during a flush() call if needed; in particular, this |
|---|
| 814 |
allows constructing relations() where a foreign key column |
|---|
| 815 |
references a server-side-generated, non-primary-key |
|---|
| 816 |
column. [ticket:954] |
|---|
| 817 |
|
|---|
| 818 |
- Additional Session transaction fixes/changes: |
|---|
| 819 |
- Fixed bug with session transaction management: parent |
|---|
| 820 |
transactions weren't started on the connection when |
|---|
| 821 |
adding a connection to a nested transaction. |
|---|
| 822 |
|
|---|
| 823 |
- session.transaction now always refers to the innermost |
|---|
| 824 |
active transaction, even when commit/rollback are called |
|---|
| 825 |
directly on the session transaction object. |
|---|
| 826 |
|
|---|
| 827 |
- Two-phase transactions can now be prepared. |
|---|
| 828 |
|
|---|
| 829 |
- When preparing a two-phase transaction fails on one |
|---|
| 830 |
connection, all the connections are rolled back. |
|---|
| 831 |
|
|---|
| 832 |
- session.close() didn't close all transactions when |
|---|
| 833 |
nested transactions were used. |
|---|
| 834 |
|
|---|
| 835 |
- rollback() previously erroneously set the current |
|---|
| 836 |
transaction directly to the parent of the transaction |
|---|
| 837 |
that could be rolled back to. Now it rolls back the next |
|---|
| 838 |
transaction up that can handle it, but sets the current |
|---|
| 839 |
transaction to it's parent and inactivates the |
|---|
| 840 |
transactions in between. Inactive transactions can only |
|---|
| 841 |
be rolled back or closed, any other call results in an |
|---|
| 842 |
error. |
|---|
| 843 |
|
|---|
| 844 |
- autoflush for commit() wasn't flushing for simple |
|---|
| 845 |
subtransactions. |
|---|
| 846 |
|
|---|
| 847 |
- unitofwork flush didn't close the failed transaction |
|---|
| 848 |
when the session was not in a transaction and commiting |
|---|
| 849 |
the transaction failed. |
|---|
| 850 |
|
|---|
| 851 |
- Miscellaneous tickets: [ticket:940] [ticket:964] |
|---|
| 852 |
|
|---|
| 853 |
- general |
|---|
| 854 |
- Fixed a variety of hidden and some not-so-hidden |
|---|
| 855 |
compatibility issues for Python 2.3, thanks to new support |
|---|
| 856 |
for running the full test suite on 2.3. |
|---|
| 857 |
|
|---|
| 858 |
- Warnings are now issued as type exceptions.SAWarning. |
|---|
| 859 |
|
|---|
| 860 |
- dialects |
|---|
| 861 |
- Better support for schemas in SQLite (linked in by ATTACH |
|---|
| 862 |
DATABASE ... AS name). In some cases in the past, schema |
|---|
| 863 |
names were ommitted from generated SQL for SQLite. This is |
|---|
| 864 |
no longer the case. |
|---|
| 865 |
|
|---|
| 866 |
- table_names on SQLite now picks up temporary tables as well. |
|---|
| 867 |
|
|---|
| 868 |
- Auto-detect an unspecified MySQL ANSI_QUOTES mode during |
|---|
| 869 |
reflection operations, support for changing the mode |
|---|
| 870 |
midstream. Manual mode setting is still required if no |
|---|
| 871 |
reflection is used. |
|---|
| 872 |
|
|---|
| 873 |
- Fixed reflection of TIME columns on SQLite. |
|---|
| 874 |
|
|---|
| 875 |
- Finally added PGMacAddr type to postgres [ticket:580] |
|---|
| 876 |
|
|---|
| 877 |
- Reflect the sequence associated to a PK field (typically |
|---|
| 878 |
with a BEFORE INSERT trigger) under Firebird |
|---|
| 879 |
|
|---|
| 880 |
- Oracle assembles the correct columns in the result set |
|---|
| 881 |
column mapping when generating a LIMIT/OFFSET subquery, |
|---|
| 882 |
allows columns to map properly to result sets even if |
|---|
| 883 |
long-name truncation kicks in [ticket:941] |
|---|
| 884 |
|
|---|
| 885 |
- MSSQL now includes EXEC in the _is_select regexp, which |
|---|
| 886 |
should allow row-returning stored procedures to be used. |
|---|
| 887 |
|
|---|
| 888 |
- MSSQL now includes an experimental implementation of |
|---|
| 889 |
LIMIT/OFFSET using the ANSI SQL row_number() function, so it |
|---|
| 890 |
requires MSSQL-2005 or higher. To enable the feature, add |
|---|
| 891 |
"has_window_funcs" to the keyword arguments for connect, or |
|---|
| 892 |
add "?has_window_funcs=1" to your dburi query arguments. |
|---|
| 893 |
|
|---|
| 894 |
- ext |
|---|
| 895 |
- Changed ext.activemapper to use a non-transactional session |
|---|
| 896 |
for the objectstore. |
|---|
| 897 |
|
|---|
| 898 |
- Fixed output order of "['a'] + obj.proxied" binary operation |
|---|
| 899 |
on association-proxied lists. |
|---|
| 900 |
|
|---|
| 901 |
0.4.2p3 |
|---|
| 902 |
------ |
|---|
| 903 |
- general |
|---|
| 904 |
- sub version numbering scheme changed to suite |
|---|
| 905 |
setuptools version number rules; easy_install -u |
|---|
| 906 |
should now get this version over 0.4.2. |
|---|
| 907 |
|
|---|
| 908 |
- sql |
|---|
| 909 |
- Text type is properly exported now and does not |
|---|
| 910 |
raise a warning on DDL create; String types with no |
|---|
| 911 |
length only raise warnings during CREATE TABLE |
|---|
| 912 |
[ticket:912] |
|---|
| 913 |
|
|---|
| 914 |
- new UnicodeText type is added, to specify an |
|---|
| 915 |
encoded, unlengthed Text type |
|---|
| 916 |
|
|---|
| 917 |
- fixed bug in union() so that select() statements |
|---|
| 918 |
which don't derive from FromClause objects can be |
|---|
| 919 |
unioned |
|---|
| 920 |
|
|---|
| 921 |
- orm |
|---|
| 922 |
- fixed bug with session.dirty when using "mutable |
|---|
| 923 |
scalars" (such as PickleTypes) |
|---|
| 924 |
|
|---|
| 925 |
- added a more descriptive error message when flushing |
|---|
| 926 |
on a relation() that has non-locally-mapped columns |
|---|
| 927 |
in its primary or secondary join condition |
|---|
| 928 |
|
|---|
| 929 |
- dialects |
|---|
| 930 |
- Fixed reflection of mysql empty string column |
|---|
| 931 |
defaults. |
|---|
| 932 |
|
|---|
| 933 |
0.4.2b (0.4.2p2) |
|---|
| 934 |
------ |
|---|
| 935 |
- sql |
|---|
| 936 |
- changed name of TEXT to Text since its a "generic" |
|---|
| 937 |
type; TEXT name is deprecated until 0.5. The |
|---|
| 938 |
"upgrading" behavior of String to Text when no |
|---|
| 939 |
length is present is also deprecated until 0.5; will |
|---|
| 940 |
issue a warning when used for CREATE TABLE |
|---|
| 941 |
statements (String with no length for SQL expression |
|---|
| 942 |
purposes is still fine) [ticket:912] |
|---|
| 943 |
|
|---|
| 944 |
- generative select.order_by(None) / group_by(None) |
|---|
| 945 |
was not managing to reset order by/group by |
|---|
| 946 |
criterion, fixed [ticket:924] |
|---|
| 947 |
|
|---|
| 948 |
- orm |
|---|
| 949 |
- suppressing *all* errors in |
|---|
| 950 |
InstanceState.__cleanup() now. |
|---|
| 951 |
|
|---|
| 952 |
- fixed an attribute history bug whereby assigning a |
|---|
| 953 |
new collection to a collection-based attribute which |
|---|
| 954 |
already had pending changes would generate incorrect |
|---|
| 955 |
history [ticket:922] |
|---|
| 956 |
|
|---|
| 957 |
- fixed delete-orphan cascade bug whereby setting the |
|---|
| 958 |
same object twice to a scalar attribute could log it |
|---|
| 959 |
as an orphan [ticket:925] |
|---|
| 960 |
|
|---|
| 961 |
- Fixed cascades on a += assignment to a list-based |
|---|
| 962 |
relation. |
|---|
| 963 |
|
|---|
| 964 |
- synonyms can now be created against props that don't |
|---|
| 965 |
exist yet, which are later added via add_property(). |
|---|
| 966 |
This commonly includes backrefs. (i.e. you can make |
|---|
| 967 |
synonyms for backrefs without worrying about the |
|---|
| 968 |
order of operations) [ticket:919] |
|---|
| 969 |
|
|---|
| 970 |
- fixed bug which could occur with polymorphic "union" |
|---|
| 971 |
mapper which falls back to "deferred" loading of |
|---|
| 972 |
inheriting tables |
|---|
| 973 |
|
|---|
| 974 |
- the "columns" collection on a mapper/mapped class |
|---|
| 975 |
(i.e. 'c') is against the mapped table, not the |
|---|
| 976 |
select_table in the case of polymorphic "union" |
|---|
| 977 |
loading (this shouldn't be noticeable). |
|---|
| 978 |
|
|---|
| 979 |
- ext |
|---|
| 980 |
- '+', '*', '+=' and '*=' support for association |
|---|
| 981 |
proxied lists. |
|---|
| 982 |
|
|---|
| 983 |
- dialects |
|---|
| 984 |
- mssql - narrowed down the test for "date"/"datetime" |
|---|
| 985 |
in MSDate/ MSDateTime subclasses so that incoming |
|---|
| 986 |
"datetime" objects don't get mis-interpreted as |
|---|
| 987 |
"date" objects and vice versa, [ticket:923] |
|---|
| 988 |
|
|---|
| 989 |
0.4.2a (0.4.2p1) |
|---|
| 990 |
------ |
|---|
| 991 |
|
|---|
| 992 |
- orm |
|---|
| 993 |
- fixed fairly critical bug whereby the same instance could be listed |
|---|
| 994 |
more than once in the unitofwork.new collection; most typically |
|---|
| 995 |
reproduced when using a combination of inheriting mappers and |
|---|
| 996 |
ScopedSession.mapper, as the multiple __init__ calls per instance |
|---|
| 997 |
could save() the object with distinct _state objects |
|---|
| 998 |
|
|---|
| 999 |
- added very rudimentary yielding iterator behavior to Query. Call |
|---|
| 1000 |
query.yield_per(<number of rows>) and evaluate the Query in an |
|---|
| 1001 |
iterative context; every collection of N rows will be packaged up |
|---|
| 1002 |
and yielded. Use this method with extreme caution since it does |
|---|
| 1003 |
not attempt to reconcile eagerly loaded collections across |
|---|
| 1004 |
result batch boundaries, nor will it behave nicely if the same |
|---|
| 1005 |
instance occurs in more than one batch. This means that an eagerly |
|---|
| 1006 |
loaded collection will get cleared out if it's referenced in more than |
|---|
| 1007 |
one batch, and in all cases attributes will be overwritten on instances |
|---|
| 1008 |
that occur in more than one batch. |
|---|
| 1009 |
|
|---|
| 1010 |
- Fixed in-place set mutation operators for set collections and association |
|---|
| 1011 |
proxied sets. [ticket:920] |
|---|
| 1012 |
|
|---|
| 1013 |
- dialects |
|---|
| 1014 |
- Fixed the missing call to subtype result processor for the PGArray |
|---|
| 1015 |
type. [ticket:913] |
|---|
| 1016 |
|
|---|
| 1017 |
0.4.2 |
|---|
| 1018 |
----- |
|---|
| 1019 |
- sql |
|---|
| 1020 |
- generic functions ! we introduce a database of known SQL functions, such |
|---|
| 1021 |
as current_timestamp, coalesce, and create explicit function objects |
|---|
| 1022 |
representing them. These objects have constrained argument lists, are |
|---|
| 1023 |
type aware, and can compile in a dialect-specific fashion. So saying |
|---|
| 1024 |
func.char_length("foo", "bar") raises an error (too many args), |
|---|
| 1025 |
func.coalesce(datetime.date(2007, 10, 5), datetime.date(2005, 10, 15)) |
|---|
| 1026 |
knows that its return type is a Date. We only have a few functions |
|---|
| 1027 |
represented so far but will continue to add to the system [ticket:615] |
|---|
| 1028 |
|
|---|
| 1029 |
- auto-reconnect support improved; a Connection can now automatically |
|---|
| 1030 |
reconnect after its underlying connection is invalidated, without |
|---|
| 1031 |
needing to connect() again from the engine. This allows an ORM session |
|---|
| 1032 |
bound to a single Connection to not need a reconnect. |
|---|
| 1033 |
Open transactions on the Connection must be rolled back after an invalidation |
|---|
| 1034 |
of the underlying connection else an error is raised. Also fixed |
|---|
| 1035 |
bug where disconnect detect was not being called for cursor(), rollback(), |
|---|
| 1036 |
or commit(). |
|---|
| 1037 |
|
|---|
| 1038 |
- added new flag to String and create_engine(), |
|---|
| 1039 |
assert_unicode=(True|False|'warn'|None). Defaults to `False` or `None` on |
|---|
| 1040 |
create_engine() and String, `'warn'` on the Unicode type. When `True`, |
|---|
| 1041 |
results in all unicode conversion operations raising an exception when a |
|---|
| 1042 |
non-unicode bytestring is passed as a bind parameter. 'warn' results |
|---|
| 1043 |
in a warning. It is strongly advised that all unicode-aware applications |
|---|
| 1044 |
make proper use of Python unicode objects (i.e. u'hello' and not 'hello') |
|---|
| 1045 |
so that data round trips accurately. |
|---|
| 1046 |
|
|---|
| 1047 |
- generation of "unique" bind parameters has been simplified to use the same |
|---|
| 1048 |
"unique identifier" mechanisms as everything else. This doesn't affect |
|---|
| 1049 |
user code, except any code that might have been hardcoded against the generated |
|---|
| 1050 |
names. Generated bind params now have the form "<paramname>_<num>", |
|---|
| 1051 |
whereas before only the second bind of the same name would have this form. |
|---|
| 1052 |
|
|---|
| 1053 |
- select().as_scalar() will raise an exception if the select does not have |
|---|
| 1054 |
exactly one expression in its columns clause. |
|---|
| 1055 |
|
|---|
| 1056 |
- bindparam() objects themselves can be used as keys for execute(), i.e. |
|---|
| 1057 |
statement.execute({bind1:'foo', bind2:'bar'}) |
|---|
| 1058 |
|
|---|
| 1059 |
- added new methods to TypeDecorator, process_bind_param() and |
|---|
| 1060 |
process_result_value(), which automatically take advantage of the processing |
|---|
| 1061 |
of the underlying type. Ideal for using with Unicode or Pickletype. |
|---|
| 1062 |
TypeDecorator should now be the primary way to augment the behavior of any |
|---|
| 1063 |
existing type including other TypeDecorator subclasses such as PickleType. |
|---|
| 1064 |
|
|---|
| 1065 |
- selectables (and others) will issue a warning when two columns in |
|---|
| 1066 |
their exported columns collection conflict based on name. |
|---|
| 1067 |
|
|---|
| 1068 |
- tables with schemas can still be used in sqlite, firebird, |
|---|
| 1069 |
schema name just gets dropped [ticket:890] |
|---|
| 1070 |
|
|---|
| 1071 |
- changed the various "literal" generation functions to use an anonymous |
|---|
| 1072 |
bind parameter. not much changes here except their labels now look |
|---|
| 1073 |
like ":param_1", ":param_2" instead of ":literal" |
|---|
| 1074 |
|
|---|
| 1075 |
- column labels in the form "tablename.columname", i.e. with a dot, are now |
|---|
| 1076 |
supported. |
|---|
| 1077 |
|
|---|
| 1078 |
- from_obj keyword argument to select() can be a scalar or a list. |
|---|
| 1079 |
|
|---|
| 1080 |
- orm |
|---|
| 1081 |
- a major behavioral change to collection-based backrefs: they no |
|---|
| 1082 |
longer trigger lazy loads ! "reverse" adds and removes |
|---|
| 1083 |
are queued up and are merged with the collection when it is |
|---|
| 1084 |
actually read from and loaded; but do not trigger a load beforehand. |
|---|
| 1085 |
For users who have noticed this behavior, this should be much more |
|---|
| 1086 |
convenient than using dynamic relations in some cases; for those who |
|---|
| 1087 |
have not, you might notice your apps using a lot fewer queries than |
|---|
| 1088 |
before in some situations. [ticket:871] |
|---|
| 1089 |
|
|---|
| 1090 |
- mutable primary key support is added. primary key columns can be |
|---|
| 1091 |
changed freely, and the identity |
|---|