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.
Mike Bayer [Wed, 4 Nov 2009 13:27:59 +0000 (13:27 +0000)]
- Fixed bug where Query would crash if a join() with no clear
"left" side were called when a non-mapped column entity
appeared in the columns list. [ticket:1602]
Using generators for small lists is highly inefficient. This change shoves
6% of total time for large ORM queries. Not bad for a 2 characters change :)
Mike Bayer [Tue, 3 Nov 2009 18:33:57 +0000 (18:33 +0000)]
- The "start" and "increment" attributes on Sequence now
generate "START WITH" and "INCREMENT BY" by default,
on Oracle and Postgresql. Firebird doesn't support
these keywords right now. [ticket:1545]
Mike Bayer [Tue, 3 Nov 2009 17:52:02 +0000 (17:52 +0000)]
- Connection pool logging now uses both INFO and DEBUG
log levels for logging. INFO is for major events such
as invalidated connections, DEBUG for all the acquire/return
logging. `echo_pool` can be False, None, True or "debug"
the same way as `echo` works.
* tweaked PickleType result_processor and bind_processor so that they are more
correct and more easily maintainable.
* implemented specific result_processor and bind_processor for Interval type
to avoid TypeDecorator call overhead (closes #1598)
rewrote PickleType bind_processor and result_processors to bypass TypeDecorator
call overhead and avoid pickler function lookup for each row (see #1598).
Provides a speedup of ~7 % on total query time for a 1000 record query on a
table with 1 PickeType field and 25% None values.
Mike Bayer [Sun, 1 Nov 2009 22:47:14 +0000 (22:47 +0000)]
- INTERVAL supports an optional "precision" argument
corresponding to the argument that PG accepts.
- Added support for reflecting the INTERVAL YEAR TO MONTH
and INTERVAL DAY TO SECOND syntaxes of the INTERVAL
type. [ticket:460]
Mike Bayer [Sun, 1 Nov 2009 20:39:43 +0000 (20:39 +0000)]
- the `__contains__()` method of `MetaData` now accepts
strings or `Table` objects as arguments. If given
a `Table`, the argument is converted to `table.key` first,
i.e. "[schemaname.]<tablename>" [ticket:1541]
Mike Bayer [Mon, 26 Oct 2009 00:32:39 +0000 (00:32 +0000)]
- The psycopg2 dialect now uses psycopg2's "unicode extension"
on all new connections, which allows all String/Text/etc.
types to skip the need to post-process bytestrings into
unicode (an expensive step due to its volume). Other
dialects which return unicode natively (pg8000, zxjdbc)
also skip unicode post-processing.
- String/Text/Unicode types now skip the unicode() check
on each result column value if the dialect has
detected the DBAPI as returning Python unicode objects
natively. This check is issued on first connect
using "SELECT CAST 'some text' AS VARCHAR(10)" or
equivalent, then checking if the returned object
is a Python unicode. This allows vast performance
increases for native-unicode DBAPIs, including
pysqlite/sqlite3, psycopg2, and pg8000.
Mike Bayer [Sun, 25 Oct 2009 16:31:54 +0000 (16:31 +0000)]
- Using a "dynamic" loader with a "secondary" table now produces
a query where the "secondary" table is *not* aliased. This
allows the secondary Table object to be used in the "order_by"
attribute of the relation(), and also allows it to be used
in filter criterion against the dynamic relation.
[ticket:1531]
- a "dynamic" loader sets up its query criterion at construction
time so that the actual query is returned from non-cloning
accessors like "statement".
Mike Bayer [Sun, 25 Oct 2009 01:40:23 +0000 (01:40 +0000)]
- Fixed a slight inaccuracy in the sharding example.
Comparing equivalence of columns in the ORM is best
accomplished using col1.shares_lineage(col2).
[ticket:1491]
Mike Bayer [Sun, 25 Oct 2009 00:40:34 +0000 (00:40 +0000)]
- Added new ENUM type to the Postgresql dialect, which exists as a schema-level
construct and extends the generic Enum type. Automatically
associates itself with tables and their parent metadata
to issue the appropriate CREATE TYPE/DROP TYPE
commands as needed, supports unicode labels, supports
reflection. [ticket:1511]
- MySQL ENUM now subclasses the new generic Enum type, and also handles
unicode values implicitly, if the given labelnames are unicode
objects.
- Added a new Enum generic type, currently supported on
Postgresql and MySQL. Enum is a schema-aware object
to support databases which require specific DDL in
order to use enum or equivalent; in the case of PG
it handles the details of `CREATE TYPE`, and on
other databases without native enum support can
support generation of CHECK constraints.
[ticket:1109] [ticket:1511]
Mike Bayer [Sat, 24 Oct 2009 16:38:07 +0000 (16:38 +0000)]
- ResultProxy internals have been overhauled to greatly reduce
method call counts when fetching columns that have no
type-level processing applied. Provides a 100% speed
improvement when fetching large result sets with no unicode
conversion. Many thanks to Elixir's Gaëtan de Menten
for this dramatic improvement ! [ticket:1586]
Mike Bayer [Fri, 23 Oct 2009 19:46:58 +0000 (19:46 +0000)]
- Mutable collection passed to the "extension" attribute
of relation(), column_property() etc. will not be mutated
or shared among multiple instrumentation calls, preventing
duplicate extensions, such as backref populators,
from being inserted into the list.
[ticket:1585]
Mike Bayer [Fri, 23 Oct 2009 01:08:02 +0000 (01:08 +0000)]
- insert() and update() constructs can now embed bindparam()
objects using names that match the keys of columns. These
bind parameters will circumvent the usual route to those
keys showing up in the VALUES or SET clause of the generated
SQL. [ticket:1579]
Michael Trier [Thu, 22 Oct 2009 03:29:52 +0000 (03:29 +0000)]
Removed references to sequence in MSSQL
Implicit identities in mssql work the same as implicit sequences on any
other dialects. Explicit sequences are enabled through the use of
"default=Sequence()". See the MSSQL dialect documentation for more
information.
Mike Bayer [Sun, 18 Oct 2009 21:59:54 +0000 (21:59 +0000)]
- the behavior of eagerloading such that the main query is
wrapped in a subquery when LIMIT/OFFSET are present now
makes an exception for the case when all eager loads are
many-to-one joins. In those cases, the eager joins are
against the parent table directly along with the
limit/offset without the extra overhead of a subquery,
since a many-to-one join does not add rows to the result.
Mike Bayer [Sun, 18 Oct 2009 20:28:19 +0000 (20:28 +0000)]
- added a flag to relation(), eagerload(), and eagerload_all()
called 'innerjoin'. Specify `True` or `False` to control
whether an eager join is constructed as an INNER or OUTER
join. Default is `False` as always. The mapper options
will override whichever setting is specified on relation().
Should generally be set for many-to-one, not nullable
foreign key relations to allow improved join performance.
[ticket:1544]