1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
0.16 (2009-XX-XX)
=================
Improvements
------------
Bug fixes
---------
0.15 (2009-08-07)
=================
Improvements
------------
- Add support for latest version on Django by not checking arguments
passed to _cursor.
- Added support for using Expressions with ResultSet.set().
- The default cache size was changed from 100 to 1000 objects.
- Added the new GenerationalCache with a faster implementation of
the caching API (by Jeroen Vermeulen). This will likely become
the default implementation in the future, so please test it if
possible.
- A new UUID property type has been added. It depends on the uuid
module introduced in Python 2.5 to represent values.
- The StoreDataManager now gets passed a transaction manager from the
ZStorm utility. This will make it easier to support non-default
transaction managers in the future.
- An adapter is now available for converting ISQLObjectResultSet
objects to IResultSet. This is intended to help in gradual porting
SQLObject applications to Storm's native API (bug #338184, by Gavin
Panella).
- If a disconnection occurs outside of Storm's control, a
DisconnectionError will still be raised next time the connection is
used through Storm. This is useful if the connection is being
shared with another framework like Django (bug #374909).
- The PostgreSQL backend now requires psycopg2 >= 2.0.7. The work
around for broken quoting behaviour in older psycopg2 versions has
been removed. (bug #322206).
- A new Neg expression is available. It provides unary minus by
prepending a minus sign to whatever expression is passed to it
(bug #397654 by Michael Hudson).
- A new Coalese expressions is available.
- ResultSets now have a find(). It acts similar to Store.find(), but
without the first argument (it uses the same classes as the original
result), and only returns results found in the original result set.
(bug #338255).
- Result.rowcount exposes the number of rows affected by the
query, when known.
- ResultSet.remove returns the number of rows deleted from the database.
(bug #180122).
Bug fixes
---------
- The fix for ResultSet.count() on distinct results from last release
has been improved, and the fix has been extended to the other
aggregates. This may change the result of some count(), min(),
max(), sum() and avg() calls for results using distinct, limit or
offset.
- The test suite now passes when run with Python 2.6.
- ListVariable now converts its elements to database representation
correctly (bug #136806 reported by Marc Tardif).
- compile_python now works for values that don't produce valid Python
expressions with repr().
- The C extension should now build under Windows.
0.14 (2009-01-09)
=================
Improvements
------------
- A new doctest describing the 'Infoheritance' pattern is integrated into
the test suite.
- A new storm.django package has been added to allow use of Storm
within Django applications.
- The way Storm interacts with the Zope transaction manager has
changed. Rather than using a synchronizer to join each new
transaction, it now delays joining the transaction until the store
is actually used.
- The Store constructor takes an optional cache keyword argument.
- ResultSets now offer an is_empty() method.
Bug fixes
---------
- Manage better row full of NULL in case of LEFT JOIN, without validating
against object constraints.
- The Reference class now has an __ne__() method, so inequality
checks against a reference now work in find expressions (bug
#244768 reported by Stuart Bishop).
- Make ResultSet.count() handles the distinct, limit and offset flags, to
really reflect the length of the current ResultSet.
- The store doesn't iterate on all the alive objects anymore, using instead
events that objects can subscribe to. This improves performance drastically
when lots of objects are in the cache.
0.13 (2008-08-28)
=================
Improvements
------------
- Add group_by/having methods on ResultSet objects, to allow access to
the "GROUP BY" and "HAVING" statements.
- Change tests/store to keep the connection during the tests to make it
faster.
- Implemented support for plugging generic "tracers". Statement
debugging is now implemented using a tracer, and easily enabled
with storm.tracer.debug(True) (storm.database.DEBUG = True is gone).
- All properties now accept a "validator" parameter. When used, a
function like validate(object, attribute_name, value) should be
given, and it may validate or modify the value before it's set in
the property. The value assigned to the property is the result
of the validator, so the original value should be returned if
changing it isn't intended.
- Expressions can be passed to Store.find() as well as classes. This
makes it possible to request individual columns from a table,
computed expressions or aggregates.
- Objects will be flushed in the order they become dirty by default.
This means that generally the order in which Python operations are
performed will be used to define the order in which flushes are done,
which is generally the most expected.
- The cextensions module was fixed, optimized, and improved. It's now
built by default, but to actually enable it the environment variable
STORM_CEXTENSIONS=1 must be defined at runtime. The module will
likely be enabled by default on a future release.
- ClassAlias will now cache all explicitly named aliases, to prevent
the cost of rebuilding it.
- Result sets and reference sets now have a __contains__() method.
While code like "item in set" was previously possible, it involved
iterating over the result set, which is expensive for large
databases.
- The storm.zope.zstorm code can now be used with only the
zope.interface and transaction packages installed. This makes it
easier to reuse the per-thread store management and global
transaction handling from other web frameworks.
Bug fixes
---------
- Make is_in returns False instead of NULL on an empty result set.
- ZStorm now keeps strong references to named stores. Previously it only kept
weak ones, so stores were recreated more often than necessary.
- References now won't flush the store or query the database when
the foreign key is None.
- When a reference is set to an object that wasn't yet inserted in
the database, the foreign key is immediately unset instead of
keeping the old value up to the flushing.
- Setting a reference to None works even if the previously referenced
object isn't in memory.
- When setting a reference, flush ordering is only enforced if the
key is dirty. This allows a number of changes that would
previously raise OrderLoopError.
- If the remote object in a back reference is removed, the reference
will now be broken.
- Fixed a race condition when two threads try to initialize the
ClassInfo for a given class at the same time.
- Improve handling of AUTO INCREMENT columns in the MySQL backend to
remove an unnecessary query when adding objects to a store.
0.12 (2008-01-28)
=================
Improvements
------------
- The Connection will reconnect automatically when connection
drops are detected and a rollback is performed. As a result,
the Store should handle reconnections in a seamless way in
most circumstances (#94986, by James Henstridge). This is
supported in the MySQL and PostgreSQL backends.
- Store.flush() will not load values inserted in the database.
Instead, undefined variables are set to AutoReload, and resolved
once first accessed. This won't be noticeable in normal usage,
but will boost the performance of inserts.
- Support in the postgres backend to use the RETURNING extension of
the INSERT statement to retrieve the primary key on inserts for
object identity mapping (PostgreSQL >= 8.2 only)
- Introduced a cache mechanism that keeps the N last retrieved objects
in memory to optimize cases where the same object is retrieved
often while no strong references are kept elsewhere. Implemented by
Bernd Dorn, from Lovely Systems.
- Improved support for TimeDelta properties on all backends. Many
more formats are accepted now, and some issues were fixed.
Bug fixes
---------
- TimeDelta was added to storm.locals.
- Fixed TimeDelta support in SQLite, MySQL, and PostgreSQL,
and enabled base test for all backends to ensure that it
continues to work.
- Schema names are accepted in __storm_table__ when using
PostgreSQL as the database (e.g. "schema.table"). (#146580,
reported by James Mayfield)
- Test runner handles path correctly on Windows, and SQLite
tests won't break (patch by Ali Afshar).
- In the SQLite backend, ensure that we're able to recommit a
transaction after "database is locked" errors. Also make sure
that when this happens the timeout is actually the expected
one (patch by Richard Boulton)
- TransactionFailedError is now imported from the public
place: ZODB.POSException (#129715, by James Henstridge).
- TimeDelta was added to storm.locals.
- Tables named with reserved keywords are properly escaped.
- Reserved keywords on column names are properly escaped when
part of an insert or update statement (#184849, by Thomas Herve).
- Prevent cached objects from issuing selects to retrieve their
data when find()s were previously made and already brough
their data (#174388, reported and fixed by Bernd Dorn).
- Fixed bug which caused an object to be readded to the store
when a reference of an object that had already been removed
was looked up.
- Prevent pathological case which happens when a statement like
"SELECT ... WHERE table.id = currval(...)" is executed in
PostgreSQL. The change is only meaningful on PostgreSQL < 8.2,
as newer versions will use the RETURNING extension instead.
- Specify both of the joining tables explicitly when compiling Proxy,
so that it doesn't break due to incorrect references in the ON clause
when multiple tables are used (reported in #162528 by S3ym0ur and
Hamilton Tran)
- MySQL client charset now defaults to UTF-8 (reported
by Brad Crittenden).
0.11 (2007-10-08)
=================
Improvements
------------
- Added case-insensitive support to the Like expression and
Class.attr.like() constructions.
- ZStorm.get_name() for obtaining the the name of the given store.
Bug fixes
---------
- storm.zope wasn't included on the tarball due to an error in setup.py.
- Binary strings are now properly quoted with the E'' formatting if
needed, in the postgres backend.
0.10 (2007-08-08)
=================
Improvements
------------
- Improvements were made to the tutorial.
- There is now a setup.py script for installing Storm.
- Count and ClassAlias is now available through the storm.locals
module.
- A new hook, __storm_pre_flush__, can be implemented on objects in a
Store. It is called before an object is flushed to the
database.
- Storm can now use the built-in sqlite support in Python 2.5 and
above.
- There is now a storm.properties.Decimal, which allows you to store
Decimal (as opposed to binary) floating point values.
- storm.zope was added, which offers a simple integration mechanism
with the Zope transaction machinery.
- Complex expressions other than simple Columns can now be passed to
the aggregation methods of ResultSet (avg,max,min,sum).
- Backend implementors can now override preset_primary_key on their
Database object to come up with primary key values before an
Insert.
- A large amount of API documentation was added.
Bug fixes
---------
- SQL reserved words are now properly escaped in SQL
statements.
- GROUP BY and ORDER BY statements are now ordered correctly.
- Running the tests with trial now works.
- All backends are now initialized such that their transactions are
truly SERIALIZABLE. Psycopg2 and Pysqlite2 both did not previously
have serializable transactions by default, but this has been fixed.
- A bug in ResultSet.cached which could occasionally cause
inconsistencies in ResultSet.set was fixed.
API Changes
-----------
Most changes are backwards compatible. There were some incompatible
changes which may affect alternative database backends.
- Chars was renamed to RawStr. Chars still exists, but is
deprecated. All raw 8-bit data in your database should be
represented with RawStr.
- compiler handlers have had their arguments reordered.
- The Compile.__call__ method now returns only the Statement.
- Compile.fork was renamed to Compile.create_child.
- Many methods which previously had underscores were renamed to get
rid of the underscores to reflect their status as things which can
be safely touched in subclasses. Documentation was added clarifying
their intended use.
|