Commit Graph

4388 Commits

Author SHA1 Message Date
Mike Bayer d6b9757778 - added unit test for exception formatting
- Deprecated the hardcoded TIMESTAMP function, which when
used as func.TIMESTAMP(value) would render "TIMESTAMP value".
This breaks on some platforms as Postgres doesn't allow
bind parameters to be used in this context.  The hard-coded
uppercase is also inappropriate and there's lots of other
PG casts that we'd need to support.  So instead, use
text constructs i.e. select(["timestamp '12/05/09'"]).
2009-05-26 01:00:46 +00:00
Mike Bayer 3837a29bfc - Repaired the printing of SQL exceptions which are not
based on parameters.
2009-05-25 15:26:16 +00:00
Mike Bayer 7ff23a5218 - Fixed an attribute error introduced in 0.5.4 which would
occur when merge() was used with an incomplete object.
rel_0_5_4p1
2009-05-18 16:21:42 +00:00
Mike Bayer d7e531ce9f - Back-ported the "compiler" extension from SQLA 0.6. This
is a standardized interface which allows the creation of custom
ClauseElement subclasses and compilers.  In particular it's
handy as an alternative to text() when you'd like to
build a construct that has database-specific compilations.
See the extension docs for details.
rel_0_5_4
2009-05-17 22:58:21 +00:00
Mike Bayer d1d3c1ad93 unusual ... 2009-05-17 22:44:35 +00:00
Mike Bayer eb30cb1feb - The "polymorphic discriminator" column may be part of a
primary key, and it will be populated with the correct
discriminator value.  [ticket:1300]
2009-05-17 22:20:28 +00:00
Mike Bayer ab0434d648 - Reflecting a FOREIGN KEY construct will take into account
a dotted schema.tablename combination, if the foreign key
references a table in a remote schema. [ticket:1405]
2009-05-17 22:00:33 +00:00
Mike Bayer 9cafc85479 - Exception messages are truncated when the list of bound
parameters is larger than 10, preventing enormous
multi-page exceptions from filling up screens and logfiles
for large executemany() statements. [ticket:1413]
2009-05-17 21:54:17 +00:00
Mike Bayer 155466aad1 - Removed all* O(N) scanning behavior from the flush() process,
i.e. operations that were scanning the full session,
including an extremely expensive one that was erroneously
assuming primary key values were changing when this
was not the case.

* one edge case remains which may invoke a full scan,
  if an existing primary key attribute is modified
  to a new value.
2009-05-17 21:51:40 +00:00
Mike Bayer 2be867ffac - Significant performance enhancements regarding Sessions/flush()
in conjunction with large mapper graphs, large numbers of
      objects:

      - The Session's "weak referencing" behavior is now *full* -
        no strong references whatsoever are made to a mapped object
        or related items/collections in its __dict__.  Backrefs and
        other cycles in objects no longer affect the Session's ability
        to lose all references to unmodified objects.  Objects with
        pending changes still are maintained strongly until flush.
        [ticket:1398]

        The implementation also improves performance by moving
        the "resurrection" process of garbage collected items
        to only be relevant for mappings that map "mutable"
        attributes (i.e. PickleType, composite attrs).  This removes
        overhead from the gc process and simplifies internal
        behavior.

        If a "mutable" attribute change is the sole change on an object
        which is then dereferenced, the mapper will not have access to
        other attribute state when the UPDATE is issued.  This may present
        itself differently to some MapperExtensions.

        The change also affects the internal attribute API, but not
        the AttributeExtension interface nor any of the publically
        documented attribute functions.

      - The unit of work no longer genererates a graph of "dependency"
        processors for the full graph of mappers during flush(), instead
        creating such processors only for those mappers which represent
        objects with pending changes.  This saves a tremendous number
        of method calls in the context of a large interconnected
        graph of mappers.

      - Cached a wasteful "table sort" operation that previously
        occured multiple times per flush, also removing significant
        method call count from flush().

      - Other redundant behaviors have been simplified in
        mapper._save_obj().
2009-05-17 18:17:46 +00:00
Mike Bayer 6515e84d4c fix mysql tests 2009-05-14 01:16:18 +00:00
Mike Bayer 7af9d1c04b - Fixed obscure mapper compilation issue when inheriting
mappers are used which would result in un-initialized
attributes.
2009-05-13 19:34:21 +00:00
Mike Bayer f19d4dc815 - It is now an error to specify both columns of a binary primaryjoin
condition in the foreign_keys or remote_side collection.  Whereas
previously it was just nonsensical, but would succeed in a
non-deterministic way.
2009-05-08 01:41:51 +00:00
Mike Bayer d8c9dcc0ad - Fixed bug which prevented "mutable primary key" dependency
logic from functioning properly on a one-to-one
relation().  [ticket:1406]
- moved MySQL to use innodb for naturalpks tests
2009-05-08 01:07:36 +00:00
Michael Trier 01cdbd0734 Corrected the SQLite SLBoolean type so that it properly treats 1 only as True. Fixes #1402 2009-05-05 00:36:37 +00:00
Mike Bayer f8daff6da1 - MapperOptions and other state associated with query.options()
is no longer bundled within callables associated with each
lazy/deferred-loading attribute during a load.
The options are now associated with the instance's
state object just once when it's populated.  This removes
the need in most cases for per-instance/attribute loader
objects, improving load speed and memory overhead for
individual instances. [ticket:1391]
2009-05-02 17:41:04 +00:00
Mike Bayer f554d0f02b this falls back to "expire" in any case since concat_op is not supported by the evaluator 2009-05-02 15:35:37 +00:00
Michael Trier 78da9e361b Corrected missing stop in the ORM Tutorial. Fixes #1395. 2009-04-29 00:14:09 +00:00
Michael Trier 541a0c8491 Modified savepoint logic in mssql to ensure that it does not step on non-savepoint oriented routines. Savepoint support is still very experimental. 2009-04-28 03:35:35 +00:00
Mike Bayer 85f7547514 - Allowed pickling of PropertyOption objects constructed with
instrumented descriptors; previously, pickle errors would occur
when pickling an object which was loaded with a descriptor-based
option, such as query.options(eagerload(MyClass.foo)).
2009-04-26 21:57:18 +00:00
Michael Trier 1ec5704d14 Modified query_cls on DynamicAttribteImpl to accept a full mixin version of the AppenderQuery. 2009-04-25 15:35:52 +00:00
Mike Bayer 3eeb240fd1 we work with sphinx 0.6.1 now 2009-04-25 15:13:30 +00:00
Ants Aasma 7d0c5f72f9 Query.update() and Query.delete() should turn off eagerloads. Fixes #1378. 2009-04-20 15:00:41 +00:00
Michael Trier 7bb91d034f Fixed adding of deferred or othe column properties to a declarative class. 2009-04-18 15:35:07 +00:00
Michael Trier 33b3360e68 Removed allow_column_override documentation. Fixes #1381. 2009-04-18 01:21:38 +00:00
Michael Trier a7e0fdd5fc Added copy and __copy__ methods to the OrderedDict. Fixes #1377. 2009-04-13 04:25:41 +00:00
Michael Trier b5ad47271e Cleaned up the deprecation problems with the examples. 2009-04-13 03:23:19 +00:00
Michael Trier eba7328c46 Corrected the sqlite float type so that it properly gets reflected as a SLFloat type. Fixes #1273. 2009-04-13 03:05:03 +00:00
Michael Trier e14734c8dd Added in MSSQL reserved words list. Fixes #1310 2009-04-12 02:12:41 +00:00
Michael Trier 2a962802de Added multi part schema name support. Closes #594 and #1341. 2009-04-11 21:36:45 +00:00
Mike Bayer 99d3e251cf - Fixed a unit of work issue whereby the foreign
key attribute on an item contained within a collection
owned by an object being deleted would not be set to
None if the relation() was self-referential. [ticket:1376]
2009-04-11 20:20:38 +00:00
Michael Trier 0143770384 Corrected duplication of serializer docs. Fixes #1375. 2009-04-09 22:57:16 +00:00
Mike Bayer 0790f9c6ac - Fixed documentation for session weak_identity_map -
the default value is True, indicating a weak
referencing map in use.
2009-04-09 21:47:49 +00:00
Mike Bayer 3d9389fcaf test multi-level eager load without the limiting subquery 2009-04-08 04:14:16 +00:00
Ants Aasma 9ffd3ddb00 - Fixed the evaluator not being able to evaluate IS NULL clauses.
- Added evaluator tests to orm/alltests.py
2009-04-06 07:03:13 +00:00
Mike Bayer f77c9f950f disabling triggers for Mysql since it requires SUPER privs 2009-04-05 02:29:45 +00:00
Michael Trier d8a04804f9 Added indexed to the list of reserved keywords (added in 3.6.4). Fixes #1358. 2009-04-04 02:54:09 +00:00
Michael Trier a7574d3a26 Added Oracle examples showing how to use named parameters with a TNS. Fixes #1361. 2009-04-04 02:42:42 +00:00
Michael Trier 7f1e6621f8 Corrected examples in ORM tutorial to specify actual exception being thrown. Fixes 1365. 2009-04-04 02:39:23 +00:00
Michael Trier 1954b87039 Corrected doc notations that suppressed some non-SQL output. Fixes #1366. 2009-04-04 00:48:26 +00:00
Jason Kirtland 6890495d23 Explicit String length 2009-04-03 19:43:10 +00:00
Mike Bayer 4e2ac31712 add defaults to alltests 2009-04-03 19:37:56 +00:00
Mike Bayer 13cc1279f8 - Fixed bug in relation(), introduced in 0.5.3,
whereby a self referential relation
from a base class to a joined-table subclass would
not configure correctly.
2009-04-02 14:53:28 +00:00
Michael Trier 6010afb28f Lots of fixes to the code examples to specify imports explicitly.
Explicit imports make it easier for users to understand the examples.
Additionally a lot of the examples were fixed to work with the changes in the
0.5.x code base. One small correction to the Case expression.  Thanks a bunch
to Adam Lowry! Fixes #717.
2009-03-31 22:31:08 +00:00
Mike Bayer 832ea82fef - Fixed another location where autoflush was interfering
with session.merge().  autoflush is disabled completely
for the duration of merge() now. [ticket:1360]
2009-03-31 14:57:19 +00:00
Jason Kirtland aca84bebb0 extract() is now dialect-sensitive and supports SQLite and others. 2009-03-30 20:41:48 +00:00
Mike Bayer 1ad157a0a1 remove needless print stuff 2009-03-30 15:38:00 +00:00
Mike Bayer d0f67e2c4d - Lazy loader will not use get() if the "lazy load"
SQL clause matches the clause used by get(), but
contains some parameters hardcoded.  Previously
the lazy strategy would fail with the get().  Ideally
get() would be used with the hardcoded parameters
but this would require further development.
[ticket:1357]
2009-03-29 21:21:10 +00:00
Mike Bayer 290ff9930a - coverage dumps out separate reports for individual packages
- other coverage tips
2009-03-29 20:23:05 +00:00
Mike Bayer 12b5ab7e4f - added a section on using aliased() with a subquery
- doctests needed huge number of +NORMALIZE_WHITESPACE not needed before for some reason
2009-03-29 18:39:54 +00:00