Commit Graph

4624 Commits

Author SHA1 Message Date
Mike Bayer 8f4373104f supports unicode binds in PG too. even without the UNICODE extension it seems to work now... 2009-11-06 02:39:16 +00:00
Gaëtan de Menten e4571c59a6 Within NamedTuple, izip is faster on most cases, and equally fast on others 2009-11-05 14:30:33 +00:00
Gaëtan de Menten d00ee6bf56 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.
2009-11-04 20:22:00 +00:00
Mike Bayer a69a094db5 - Fixed bug in two-phase transaction whereby commit() method
didn't set the full state which allows subsequent close()
call to succeed. [ticket:1603]
2009-11-04 17:15:36 +00:00
Mike Bayer 43348d6163 - 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]
2009-11-04 13:27:59 +00:00
Gaëtan de Menten d79d48ca55 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 :)
2009-11-04 13:19:47 +00:00
Mike Bayer 6acbb4fb93 - simplify default schema name test
- MySQL + zxjdbc *is* unicode by default.  it was the broken initialize()
2009-11-03 19:48:07 +00:00
Mike Bayer cac9f6b3bb fix MySQL initialize to use defaultdialect first 2009-11-03 19:05:58 +00:00
Mike Bayer e35dcee6ca - 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]
2009-11-03 18:33:57 +00:00
Mike Bayer 56f64add81 - 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.
2009-11-03 17:52:02 +00:00
Mike Bayer 4b532e2084 - dialect.get_default_schema_name(connection) is now
public via dialect.default_schema_name.
[ticket:1571]
2009-11-03 17:35:13 +00:00
Gaëtan de Menten b5af1759df * 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)
2009-11-03 16:30:07 +00:00
Gaëtan de Menten adaecccda1 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.
2009-11-03 15:52:57 +00:00
Mike Bayer db3521823d - Fixed the call to get_committed_value() on CompositeProperty.
[ticket:1504]
2009-11-03 04:58:18 +00:00
Mike Bayer db2ff89644 revert r6466 2009-11-03 04:57:09 +00:00
Mike Bayer cc9c615c5a - Fixed the call to get_committed_value() on CompositeProperty.
[ticket:1504]
2009-11-03 04:54:56 +00:00
Mike Bayer 659ca0c508 added a test for #1349 2009-11-03 04:30:18 +00:00
Mike Bayer e2ca4ebe58 omit this test for non-oracle 2009-11-02 03:07:13 +00:00
Mike Bayer 9b8292ec6a fix adapt() so that DB-specified typedecorator replacements work 2009-11-01 23:28:44 +00:00
Mike Bayer e8854fe945 - 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]
2009-11-01 22:47:14 +00:00
Mike Bayer fb6be4d359 - filter out SYS_NC\d+$ columns [ticket:1513]
- remove explicit INNER JOIN from index query to support oracle 8
2009-11-01 21:53:00 +00:00
Mike Bayer 7115454c70 added test for [ticket:1450] 2009-11-01 21:08:12 +00:00
Mike Bayer 2cefbf11c3 add "dialect" to the __all__ of each root dialect package 2009-11-01 20:59:40 +00:00
Mike Bayer 98f80d6ce9 - added py3k and "OS Independent" classifiers 2009-11-01 20:48:03 +00:00
Mike Bayer 0d2ae16aee - 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]
2009-11-01 20:39:43 +00:00
Gaëtan de Menten 68451b990a get more speed out of the Time type on Mysql 2009-10-30 11:37:26 +00:00
Gaëtan de Menten 1adf8e7fcd get a bit more speed out of datetime and LOB-based types on cx_oracle 2009-10-30 11:09:45 +00:00
Gaëtan de Menten 876b3fdd3f added comment so that other people don't spend their time trying to optimize
optimal code
2009-10-30 10:28:43 +00:00
Gaëtan de Menten b1a7258750 minor speed improvement on date, datetime and time types on SQLite 2009-10-30 10:20:19 +00:00
Gaëtan de Menten 8195ec35ad large speed improvement of the Interval type on non-native dialects 2009-10-29 21:24:33 +00:00
Gaëtan de Menten 7c6e5dfffd slightly sped-up Binary type, PickleType and all TypeDecorators 2009-10-29 20:41:16 +00:00
Mike Bayer b01d634161 added docs to case() illusrtating usage of literal_column(), can't implement #809 directly 2009-10-28 15:46:51 +00:00
Gaëtan de Menten 953a653179 partially PEP8-ified informix dialect 2009-10-27 09:25:13 +00:00
Mike Bayer 5e0a1d1ea1 no native unicode for mysql + zxjdbc 2009-10-26 18:52:12 +00:00
Mike Bayer 62d2069210 whats up with the native_unicode test on jython 2009-10-26 18:23:20 +00:00
Mike Bayer bc714d614d test fixes 2009-10-26 01:29:56 +00:00
Mike Bayer 4a7f889d8a oracle test fixes 2009-10-26 01:20:38 +00:00
Mike Bayer 5119ce78b5 - 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.
2009-10-26 00:32:39 +00:00
Mike Bayer eb9763febe - generalized Enum to issue a CHECK constraint + VARCHAR on default platform
- added native_enum=False flag to do the same on MySQL, PG, if desired
2009-10-25 21:27:08 +00:00
Mike Bayer a5f827b12d well great nobody even supports PG enum. 2009-10-25 16:50:09 +00:00
Mike Bayer 85d49bde73 - 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".
2009-10-25 16:31:54 +00:00
Mike Bayer a77a0fd3eb fix errant 2.6ism 2009-10-25 14:58:21 +00:00
Mike Bayer ed83a844bb - 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]
2009-10-25 01:40:23 +00:00
Mike Bayer aa557982fa - 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]

- types documentation updates

- some cleanup on schema/expression docs
2009-10-25 00:40:34 +00:00
Mike Bayer 82ea898ab0 - apply ged's suggested optimization of not needlessly wrapping mapper._instance_processor
- start playing with semi-automated 78-col wrapping
2009-10-24 20:58:21 +00:00
Mike Bayer fafbe57b30 fix some 2.4 callcounts 2009-10-24 20:36:44 +00:00
Mike Bayer 52b1ace676 - 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]
2009-10-24 16:38:07 +00:00
Mike Bayer 2e8b1639f8 update counts for 2.4 2009-10-23 21:30:02 +00:00
Mike Bayer 52fab3ed34 - 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]
2009-10-23 19:46:58 +00:00
Mike Bayer a43a0e8b68 - 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]
2009-10-23 01:08:02 +00:00