Commit Graph

4608 Commits

Author SHA1 Message Date
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
Michael Trier 9ae821ee66 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.
2009-10-22 03:29:52 +00:00
Mike Bayer e552ce339e - RETURNING is supported by 8.2+
- add docs for PG delete..returning
2009-10-21 16:33:04 +00:00
Mike Bayer 5a140299b3 - Corrected the "has_sequence" query to take current schema,
or explicit sequence-stated schema, into account.
[ticket:1576]
2009-10-21 04:47:02 +00:00
Mike Bayer 7dddcd1403 some cleanup 2009-10-21 04:45:29 +00:00
Mike Bayer aceb90525a merged scopefunc patch from r6420 of 0.5 branch 2009-10-20 17:33:33 +00:00
Mike Bayer 404f43894a merge r6418 from 0.5, dedupe expressions on clause ident, not string value
[ticket:1574]
2009-10-20 17:12:58 +00:00
Mike Bayer 7b457b9731 merged r6416 of 0.5 branch, fix the "numeric" paramstyle and add tests 2009-10-20 16:19:54 +00:00
Lele Gaifax f44f59e05e Fix reST markup 2009-10-19 08:39:36 +00:00
Lele Gaifax 75a3baf94d Modernise doc about returning() support 2009-10-19 08:00:55 +00:00
Mike Bayer b252fc249d attempt to fix some jython ordering annoyingness 2009-10-18 22:50:14 +00:00
Mike Bayer 4bd8451046 - 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.
2009-10-18 21:59:54 +00:00
Mike Bayer cad7e3ceca - 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]
2009-10-18 20:28:19 +00:00
Mike Bayer facb6516e9 - initial MySQL Connector/Python driver
- support exceptions raised in dialect initialize phase
- provide default dialect create_connect_args() method
2009-10-18 16:48:46 +00:00
Mike Bayer 1f9ee311cd gratuitous try/except/else usage 2009-10-18 04:05:47 +00:00
Mike Bayer e1d304ce6f fix MySQL tests 2009-10-18 02:52:56 +00:00
Mike Bayer eb6f1f87f6 deprecations per [ticket:1498]:
- deprecated PassiveDefault - use DefaultClause.
- the BINARY and MSBinary types now generate "BINARY" in all
cases.  Omitting the "length" parameter will generate
"BINARY" with no length.  Use BLOB to generate an unlengthed
binary column.
- the "quoting='quoted'" argument to MSEnum/ENUM is deprecated.
It's best to rely upon the automatic quoting.
- "shortname" attribute on bindparam() is removed.
- fold_equivalents flag on join is deprecated (will remain
until [ticket:1131] is implemented)
- "scalar" flag on select() is removed, use
select.as_scalar().
- 'transactional' flag on sessionmaker() and others is
removed. Use 'autocommit=True' to indicate 'transactional=False'.
- 'polymorphic_fetch' argument on mapper() is removed.
Loading can be controlled using the 'with_polymorphic'
option.
- 'select_table' argument on mapper() is removed.  Use
'with_polymorphic=("*", <some selectable>)' for this
functionality.
- 'proxy' argument on synonym() is removed.  This flag
did nothing throughout 0.5, as the "proxy generation"
behavior is now automatic.
- Passing a single list of elements to eagerload(),
eagerload_all(), contains_eager(), lazyload(),
defer(), and undefer() instead of multiple positional
-args is deprecated.
- Passing a single list of elements to query.order_by(),
query.group_by(), query.join(), or query.outerjoin()
instead of multiple positional *args is deprecated.
- query.iterate_instances() is removed.  Use query.instances().
- Query.query_from_parent() is removed.  Use the
sqlalchemy.orm.with_parent() function to produce a
"parent" clause, or alternatively query.with_parent().
- query._from_self() is removed, use query.from_self()
instead.
- the "comparator" argument to composite() is removed.
Use "comparator_factory".
- RelationProperty._get_join() is removed.
- the 'echo_uow' flag on Session is removed.  Use
logging on the "sqlalchemy.orm.unitofwork" name.
- session.clear() is removed.  use session.expunge_all().
- session.save(), session.update(), session.save_or_update()
are removed.  Use session.add() and session.add_all().
- the "objects" flag on session.flush() remains deprecated.
- the "dont_load=True" flag on session.merge() is deprecated
in favor of "load=False".
- passing an InstanceState (internal SQLAlchemy state object) to
attributes.init_collection() or attributes.get_history() is
deprecated.  These functions are public API and normally
expect a regular mapped object instance.
- the 'engine' parameter to declarative_base() is removed.
Use the 'bind' keyword argument.
2009-10-15 23:00:06 +00:00