Mike Bayer [Thu, 7 Jan 2010 22:09:17 +0000 (22:09 +0000)]
- Session.merge() is performance optimized, using half the
call counts for "load=False" mode compared to 0.5 and
significantly fewer SQL queries in the case of collections
for "load=True" mode.
Mike Bayer [Mon, 4 Jan 2010 16:26:01 +0000 (16:26 +0000)]
- rename "myconnpy" to "mysqlconnector"
- remove all bug workarounds in mysqlconnector dialect
- add mysqlconnector as one of two "official" DBAPIs for MySQL
Mike Bayer [Sun, 3 Jan 2010 20:57:37 +0000 (20:57 +0000)]
- Fixed a column arithmetic bug that affected column
correspondence for cloned selectables which contain
free-standing column expressions. This bug is
generally only noticeable when exercising newer
ORM behavior only availble in 0.6 via [ticket:1568],
but is more correct at the SQL expression level
as well. [ticket:1617]
Mike Bayer [Sat, 2 Jan 2010 03:50:50 +0000 (03:50 +0000)]
- The copy() method on Column now supports uninitialized,
unnamed Column objects. This allows easy creation of
declarative helpers which place common columns on multiple
subclasses (merged from 0.5 with changes).
Mike Bayer [Tue, 29 Dec 2009 23:20:48 +0000 (23:20 +0000)]
- calling expr.in_([]), i.e. with an empty list, emits a warning
before issuing the usual "expr != expr" clause. The
"expr != expr" can be very expensive, and it's preferred
that the user not issue in_() if the list is empty,
instead simply not querying, or modifying the criterion
as appropriate for more complex situations.
[ticket:1628]
Mike Bayer [Fri, 18 Dec 2009 21:08:35 +0000 (21:08 +0000)]
- Column() supports a keyword argument "sqlite_autoincrement", which
applies the SQLite keyword "AUTOINCREMENT" to columns within DDL -
will prevent generation of a separate PRIMARY KEY constraint.
[ticket:1016]
- added docs
- fixed underlines in mysql.rst
Mike Bayer [Fri, 18 Dec 2009 20:41:34 +0000 (20:41 +0000)]
- added _with_options() to Connection. not publicizing this yet.
- updated oursql driver with latest fixes using options. [ticket:1613]
- all the MySQL drivers get a shoutout in the docs
- marked tests that OurSQL has problems with (only three), passes 100% now
Mike Bayer [Fri, 18 Dec 2009 20:09:14 +0000 (20:09 +0000)]
- mysql: a column of type TIMESTAMP now defaults to NULL if
"nullable=False" is not passed to Column(), and no default
is present. This is now consistent with all other types,
and in the case of TIMESTAMP explictly renders "NULL"
due to MySQL's "switching" of default nullability
for TIMESTAMP columns. [ticket:1539]
Mike Bayer [Fri, 18 Dec 2009 17:24:20 +0000 (17:24 +0000)]
- relation() with uselist=False will emit a warning when
an eager load locates more than one valid value for the row,
typically due to primaryjoin/secondaryjoin conditions which
aren't appropriate for LEFT OUTER JOIN. [ticket:1643]
Mike Bayer [Mon, 14 Dec 2009 01:29:51 +0000 (01:29 +0000)]
- Session.merge() now properly overwrites a many-to-one or
uselist=False attribute to None if the attribute
is also None in the given object to be merged.
Mike Bayer [Tue, 8 Dec 2009 23:47:09 +0000 (23:47 +0000)]
- merge r6549 of 0.5 branch
- Fixed bug in query.update() when passing Cls.attribute
as keys in the value dict and using synchronize_session='expire'
('fetch' in 0.6). [ticket:1436]
Mike Bayer [Tue, 8 Dec 2009 23:09:48 +0000 (23:09 +0000)]
- The signature of the proxy_factory callable passed to
association_proxy is now (lazy_collection, creator,
value_attr, association_proxy), adding a fourth argument
that is the parent AssociationProxy argument. Allows
serializability and subclassing of the built in collections.
[ticket:1259]
Mike Bayer [Tue, 8 Dec 2009 03:09:18 +0000 (03:09 +0000)]
- Session.execute() now locates table- and
mapper-specific binds based on a passed
in expression which is an insert()/update()/delete()
construct. [ticket:1054]
Mike Bayer [Tue, 8 Dec 2009 02:31:59 +0000 (02:31 +0000)]
- removed needless "counter" behavior with select()
labelnames that match a column name in the table,
i.e. generates "tablename_id" for "id", instead of
"tablename_id_1" in an attempt to avoid naming
conflicts, when the table has a column actually
named "tablename_id" - this is because
the labeling logic is always applied to all columns
so a naming conflict will never occur.
Mike Bayer [Tue, 8 Dec 2009 02:27:35 +0000 (02:27 +0000)]
- multi-part schema names, i.e. with dots such as
"dbo.master", are now rendered in select() labels
with underscores for dots, i.e. "dbo_master_table_column".
This is a "friendly" label that behaves better
in result sets. [ticket:1428]
Mike Bayer [Tue, 8 Dec 2009 01:53:21 +0000 (01:53 +0000)]
- The "use get" behavior of many-to-one relations, i.e. that a
lazy load will fallback to the possibly cached query.get()
value, now works across join conditions where the two compared
types are not exactly the same class, but share the same
"affinity" - i.e. Integer and SmallInteger. Also allows
combinations of reflected and non-reflected types to work
with 0.5 style type reflection, such as PGText/Text (note 0.6
reflects types as their generic versions). [ticket:1556]
- types now support an "affinity comparison" operation, i.e.
that an Integer/SmallInteger are "compatible", or
a Text/String, PickleType/Binary, etc. Part of
[ticket:1556].
Mike Bayer [Sun, 6 Dec 2009 22:58:05 +0000 (22:58 +0000)]
- The Boolean type, when used on a backend that doesn't
have native boolean support, will generate a CHECK
constraint "col IN (0, 1)" along with the int/smallint-
based column type. This can be switched off if
desired with create_constraint=False.
Note that MySQL has no native boolean *or* CHECK constraint
support so this feature isn't available on that platform.
[ticket:1589]
Mike Bayer [Sun, 6 Dec 2009 19:51:10 +0000 (19:51 +0000)]
- reworked the DDL generation of ENUM and similar to be more platform agnostic.
Uses a straight CheckConstraint with a generic expression. Preparing for boolean
constraint in [ticket:1589]
- CheckConstraint now accepts SQL expressions, though support for quoting of values
will be very limited. we don't want to get into formatting dates and such.
Mike Bayer [Fri, 4 Dec 2009 01:51:23 +0000 (01:51 +0000)]
- an explicit check occurs when a synonym() is used with
map_column=True, when a ColumnProperty (deferred or otherwise)
exists separately in the properties dictionary sent to mapper
with the same keyname. Instead of silently replacing
the existing property (and possible options on that property),
an error is raised. [ticket:1633]
Mike Bayer [Thu, 3 Dec 2009 02:34:47 +0000 (02:34 +0000)]
- The cursor associated with connection pool connections
(i.e. _CursorFairy) now proxies `__iter__()` to the
underlying cursor correctly. [ticket:1632]
Mike Bayer [Wed, 25 Nov 2009 17:34:25 +0000 (17:34 +0000)]
- relation primaryjoin and secondaryjoin now check that they
are column-expressions, not just clause elements. this prohibits
things like FROM expressions being placed there directly.
[ticket:1622]
Gaëtan de Menten [Mon, 23 Nov 2009 08:35:34 +0000 (08:35 +0000)]
Prelookup codec in the String result processor for dialects which do not
return Unicode natively, as suggested in #1323. Provides a nice speed boost
(~21% total query time).
Mike Bayer [Sun, 22 Nov 2009 22:11:41 +0000 (22:11 +0000)]
- VARCHAR/NVARCHAR will not render without a length, raises
an error before passing to MySQL. Doesn't impact
CAST since VARCHAR is not allowed in MySQL CAST anyway,
the dialect renders CHAR/NCHAR in those cases.
[ticket:1252]
Gaëtan de Menten [Tue, 17 Nov 2009 18:35:06 +0000 (18:35 +0000)]
- sqlite
- DATE, TIME and DATETIME types can now take optional storage_format and
regexp argument. storage_format can be used to store those types using
a custom string format. regexp allows to use a custom regular expression
to match string values from the database.
- Time and DateTime types now use by a default a stricter regular
expression to match strings from the database. Use the regexp argument
if you are using data stored in a legacy format.
- __legacy_microseconds__ on SQLite Time and DateTime types is not
supported anymore. You should use the storage_format argument instead.
- Date, Time and DateTime types are now stricter in what they accept as
bind parameters: Date type only accepts date objects (and datetime ones,
because they inherit from date), Time only accepts time objects, and
DateTime only accepts date and datetime objects.
Mike Bayer [Sun, 15 Nov 2009 20:39:39 +0000 (20:39 +0000)]
- Fixed bug whereby composite columns wouldn't load properly
when configured on a joined-table subclass, introduced in
version 0.5.6 as a result of the fix for [ticket:1480].
[ticket:1616] thx to Scott Torborg.
Mike Bayer [Sun, 15 Nov 2009 19:20:22 +0000 (19:20 +0000)]
- pg8000 + postgresql dialects now check for float/numeric return
types to more intelligently determine float() vs. Decimal(),
[ticket:1567]
- since result processing is a hot issue of late, the DBAPI type
returned from cursor.description is certainly useful in cases like
these to determine an efficient result processor. There's likely
other result processors that can make use of it. But, backwards
incompat change to result_processor(). Happy major version number..
Mike Bayer [Tue, 10 Nov 2009 00:43:53 +0000 (00:43 +0000)]
- subclassed Function off of new FunctionElement generic base
- removed "key" accessor of Function, Grouping - this doesn't seem to be used for anything
- various formatting
- documented the four "Element" classes in the compiler extension as per [ticket:1590]
Mike Bayer [Mon, 9 Nov 2009 23:40:57 +0000 (23:40 +0000)]
- ForeignKey(constraint=some_parent) is now private _constraint
- ForeignKey and ForeignKeyConstraint objects now correctly
copy() all their public keyword arguments. [ticket:1605]
Mike Bayer [Mon, 9 Nov 2009 19:41:45 +0000 (19:41 +0000)]
- added a real unit test for sqlsoup
- removed doctest stuff
- redid session docs for sqlsoup
- sqlsoup stays within the transaction of a Session now, is explcitly autocommit=False by default and includes commit()/rollback() methods
- sqlsoup db.<sometable>.update() and delete() now call
query(cls).update() and delete(), respectively.
- sqlsoup now has execute() and connection(), which call upon
the Session methods of those names, ensuring that the bind is
in terms of the SqlSoup object's bind.
Mike Bayer [Sun, 8 Nov 2009 21:54:56 +0000 (21:54 +0000)]
moved modified_event() calls below the attribute extension fires. this basically has no difference in any case except that where an extension is calling commit() on the attribute - in that case it usually, but not always, maintains the same history. [ticket:1601]
Mike Bayer [Fri, 6 Nov 2009 15:51:06 +0000 (15:51 +0000)]
allow setattr() access to _CursorFairy directly, thereby removing the need for dialects to guess whether they have a wrapped cursor or not, fixes #1609, regression from r6471
use list comprehension instead of generator as it is much faster for small
lists, as will usually be the case here. provides a ~11% speedup for large
column-only queries.