Mike Bayer [Tue, 19 Jan 2010 00:53:12 +0000 (00:53 +0000)]
- mega example cleanup
- added READMEs to all examples in each __init__.py and added to sphinx documentation
- added versioning example
- removed vertical/vertical.py, the dictlikes are more straightforward
Mike Bayer [Mon, 18 Jan 2010 03:00:05 +0000 (03:00 +0000)]
- added native INTERVAL type to the dialect. This supports
only the DAY TO SECOND interval type so far due to lack
of support in cx_oracle for YEAR TO MONTH. [ticket:1467]
- The Interval type includes a "native" flag which controls
if native INTERVAL types (postgresql + oracle) are selected
if available, or not. "day_precision" and "second_precision"
arguments are also added which propagate as appropriately
to these native types. Related to [ticket:1467].
- DefaultDialect.type_descriptor moves back to being per-dialect.
TypeEngine/TypeDecorator key type impls to the dialect class
+ server_version_info so that the colspecs dict can be modified
per-dialect based on server version.
- Fixed TypeDecorator's incorrect usage of _impl_dict
Mike Bayer [Sun, 17 Jan 2010 21:12:47 +0000 (21:12 +0000)]
- remove the exclusion of cx_oracle.STRING from setinputsizes by
configuring cx_oracle.UNICODE on OracleNVarChar. Attempts
were made to pass unicode data to/from a plain VARCHAR2 with
cx_oracle, both with and without setinputsizes in use, but
it doesn't appear to be possible - therefore users will need to use
Unicode/UnicodeText with oracle if data contains non-ASCII info.
[ticket:1517]
- updated the Unicode/UnicodeText docs to reflect this, that
convert_unicode might not be enough.
- allowed convert_unicode='force' to be significant for bind parameters
as well.
Mike Bayer [Sun, 17 Jan 2010 20:32:45 +0000 (20:32 +0000)]
- reorganized and re-documented Oracle schema tests to assume
test user has DBA privs, and all objects can be created /dropped.
- added ORDER BY to oracle column listing
- Oracle all_tables always limits to current user if schema not given.
- views reflect - added documentation + a unit test for this.
- Table(autoload) with no bind produces an error message specific to
the fact that autoload_with should be the first option to try.
Mike Bayer [Sat, 16 Jan 2010 22:44:04 +0000 (22:44 +0000)]
- added "statement_options()" to Query, to so options can be
passed to the resulting statement. Currently only
Select-statements have these options, and the only option
used is "stream_results", and the only dialect which knows
"stream_results" is psycopg2.
- Query.yield_per() will set the "stream_results" statement
option automatically.
- Added "statement_options()" to Selects, which set statement
specific options. These enable e.g. dialect specific options
such as whether to enable using server side cursors, etc.
- The psycopg2 now respects the statement option
"stream_results". This option overrides the connection setting
"server_side_cursors". If true, server side cursors will be
used for the statement. If false, they will not be used, even
if "server_side_cursors" is true on the
connection. [ticket:1619]
- added a "frozendict" from http://code.activestate.com/recipes/414283/,
adding more default collections as immutable class vars on
Query, Insert, Select
Mike Bayer [Sat, 16 Jan 2010 19:04:39 +0000 (19:04 +0000)]
- ConnectionProxy now has wrapper methods for all transaction
lifecycle events, including begin(), rollback(), commit()
begin_nested(), begin_prepared(), prepare(), release_savepoint(),
etc.
Mike Bayer [Sat, 16 Jan 2010 18:04:11 +0000 (18:04 +0000)]
- sqlsoup objects no longer have the 'query' attribute - it's
not needed for sqlsoup's usage paradigm and it gets in the
way of a column that is actually named 'query'.
Mike Bayer [Wed, 13 Jan 2010 18:31:19 +0000 (18:31 +0000)]
- replace the tip of the path info with the subclass mapper being used.
that way accurate "load_path" info is available for options
invoked during deferred loads.
we lose AliasedClass path elements this way, but currently,
those are not needed at this stage.
Mike Bayer [Mon, 11 Jan 2010 20:26:34 +0000 (20:26 +0000)]
have paths represented as their actual mapper, not the base mapper, allowing
more information for custom mapper opts to see what's going on. add a new _reduce_path()
function to apply to the path as stored in dictionaries, adds a slight cost overhead.
Mike Bayer [Sun, 10 Jan 2010 21:21:45 +0000 (21:21 +0000)]
- merge() will not issue a needless merge of attributes if the
given instance is the same instance which is already present.
- merge() now also merges the "options" associated with a given
state, i.e. those passed through query.options() which follow
along with an instance, such as options to eagerly- or
lazyily- load various attributes. This is essential for
the construction of highly integrated caching schemes. This
is a subtle behavioral change vs. 0.5.
- A bug was fixed regarding the serialization of the "loader
path" present on an instance's state, which is also necessary
when combining the usage of merge() with serialized state
and associated options that should be preserved.
- The "query_cache" examples have been removed, and are replaced
with a fully comprehensive approach that combines the usage of
Beaker with SQLAlchemy. New query options are used to indicate
the caching characteristics of a particular Query, which
can also be invoked deep within an object graph when lazily
loading related objects. See /examples/beaker_caching/README.
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]