Commit Graph

10240 Commits

Author SHA1 Message Date
Sebastian Bank 84e813aee4 add ClauseElement.cast() shortcut-method 2015-06-19 17:37:21 +02:00
Mike Bayer 370b237ddb - automap is stable 2015-06-18 13:13:54 -04:00
Mike Bayer 4a25c10e27 - Repaired the :class:.ExcludeConstraint construct to support common
features that other objects like :class:`.Index` now do, that
the column expression may be specified as an arbitrary SQL
expression such as :obj:`.cast` or :obj:`.text`.
fixes #3454
2015-06-16 14:33:53 -04:00
Mike Bayer b861b7537c - add a subsection on how to use Sequence with server_default,
fixes #3453
2015-06-16 13:16:59 -04:00
Mike Bayer de906a2125 - remove the redundant non-max-row-buffer test from the max_row_buffer
test as we implemented that as a separate test.
2015-06-14 16:48:26 -04:00
Mike Bayer 7f7ae03b0d Merge branch 'pr182' 2015-06-14 16:45:01 -04:00
Mike Bayer 9ccdea3a0f - add test cases for pullreq github:182, where we add a new
"max_row_buffer" execution option for BufferedRowResultProxy
- also add documentation, changelog and version notes
- rework the max_row_buffer argument to be interpreted from
the execution options upfront when the BufferedRowResultProxy
is first initialized.
2015-06-14 16:43:16 -04:00
Mike Bayer e15d58695d - Add a new le_() assertion for less than or equals
- fix TablesTest to use the bind that we've returned from setup_bind()
to emit DELETE statements
2015-06-14 16:42:14 -04:00
Morgan McClure a8c6cce404 Added max_row_buffer attribute to the context execution options and use
it to prevent excess memory usage with yield_per
2015-06-13 19:27:55 -07:00
Mike Bayer 92ac4a9f88 - revert this change which was inadvertently included in the
fix for #3451
2015-06-13 20:47:18 -04:00
Mike Bayer bcbfcca236 - restore the approach we have for pk_params, but in order
to suit #3451 exclude these columns from the "params"
dictionary in the first place, revises pr github:181
2015-06-13 20:27:06 -04:00
Mike Bayer 2497d559dd - add changelog for #3451, with 09485d7331 fixes #3451
- also add a bulk_insert_mappings test
2015-06-13 20:15:17 -04:00
Morgan McClure 235165d546 BufferedRowResultProxy should stop growing at 100 2015-06-13 13:59:27 -07:00
Patrick Hayes 09485d7331 Fix primary key behaviour in bulk_update
Suppose you have a model class with a primary key.

Base = declarative_base()
class User(Base):
  id = Column(BigInteger, primary_key=True)
  name = Column(String)

Previously, running
`bulk_update_mappings(User, {'id': 1, 'name': 'hello'})`
would emit the following:

```UPDATE users SET id=1, name='hello' WHERE id=1```

This is contrary to the stated behaviour, where primary keys are omitted
from the SET clause. Furthermore, this behaviour is harmful, as it
can cause the db engine to lock over-aggresively (at least in Postgres).

With this change, the emitted SQL is:

```UPDATE users SET name='hello' WHERE id=1```
2015-06-13 14:11:16 -04:00
Mike Bayer e765c55e8c - Fixed an unexpected-use regression whereby custom :class:.Comparator
objects that made use of the ``__clause_element__()`` method and
returned an object that was an ORM-mapped
:class:`.InstrumentedAttribute` and not explicitly a
:class:`.ColumnElement` would fail to be correctly
handled when passed as an expression to :meth:`.Session.query`.
The logic in 0.9 happened to succeed on this, so this use case is now
supported. fixes #3448
2015-06-11 16:48:00 -04:00
Mike Bayer a463bb31ea - add an 0.9 migration note regarding TypeEngine's default
constructor removal; fixes #3446
2015-06-10 10:48:16 -04:00
Mike Bayer a9030d0241 - Fixed a bug where clause adaption as applied to a :class:.Label
object would fail to accommodate the labeled SQL expression
in all cases, such that any SQL operation that made use of
:meth:`.Label.self_group` would use the original unadapted
expression.  One effect of this would be that an ORM :func:`.aliased`
construct would not fully accommodate attributes mapped by
:obj:`.column_property`, such that the un-aliased table could
leak out when the property were used in some kinds of SQL
comparisons.
fixes #3445
2015-06-09 23:39:14 -04:00
Mike Bayer 1cc50c81b9 - add a migration note for the query.update()/query.delete() change
in #3349
2015-06-09 13:02:43 -04:00
Mike Bayer 8f1130672d - add a comment, also I think we want to expire before we do the
new begin, as begin_nested() does a flush
2015-06-09 12:20:07 -04:00
Mike Bayer c9712e4bd5 Merge remote-tracking branch 'origin/pr/180' into pr180 2015-06-09 12:18:35 -04:00
Mike Bayer 657be357de - Fixed an internal "memoization" routine for method types such
that a Python descriptor is no longer used; repairs inspectability
of these methods including support for Sphinx documentation.
2015-06-08 18:36:27 -04:00
Mike Bayer 0e1da32654 - start 1.0.6 2015-06-08 18:35:15 -04:00
Charles-Axel Dein d1dc39d55d Expire session in testing transaction handling 2015-06-08 10:01:59 -07:00
Mike Bayer 3873d7db34 - 1.0.5 rel_1_0_5 2015-06-07 17:53:38 -04:00
Mike Bayer 1ef1b8600f - include tox.ini in the dist... 2015-06-07 17:50:48 -04:00
Mike Bayer 343734b95f - repair these tests to use the global manager_of_class fn,
as test_customfinder_pass at least does not provide the
alternate ext manager and in all cases it's the global function
that counts
2015-06-07 17:44:58 -04:00
Mike Bayer 54b15aaf37 - Added new engine event :meth:.ConnectionEvents.engine_disposed.
Called after the :meth:`.Engine.dispose` method is called.
2015-06-06 17:50:32 -04:00
Mike Bayer 4e6ec9eef4 - Repaired some typing and test issues related to the pypy
psycopg2cffi dialect, in particular that the current 2.7.0 version
does not have native support for the JSONB type.  The version detection
for psycopg2 features has been tuned into a specific sub-version
for psycopg2cffi.  Additionally, test coverage has been enabled
for the full series of psycopg2 features under psycopg2cffi.
fixes #3439
2015-06-05 17:34:02 -04:00
Mike Bayer 4c90f355fd - document SQlite dotted name issue, fixes #3441 2015-06-05 16:11:13 -04:00
Pete Hollobon af19435b9c Add reflection of PostgreSQL index access methods (USING clause) 2015-06-04 16:45:41 +01:00
Pete Hollobon b03ee45f32 Add reflection of PostgreSQL index storage options 2015-06-04 15:12:09 +01:00
Pete Hollobon dff81500b1 Add support for PostgreSQL index storage parameters
Add support for specifying PostgreSQL index storage paramters (e.g.
fillfactor).
2015-06-03 17:32:12 +01:00
Mike Bayer 16a87fe6d9 - correctly categorize this changelog entry and rewrite it
to be understandable, now that there's some time past since
I first wrote it
2015-06-03 11:04:08 -04:00
Mike Bayer 5a17d73648 - fix this test to not require pyodbc installed 2015-06-03 10:45:45 -04:00
Mike Bayer 47d29eae8f - changelog for pr bitbucket:54
- alter the approach so that the initial callable is working just like add_criteria/with_criteria
2015-06-03 10:08:33 -04:00
INADA Naoki 36d2b40cf5 baked: Support initial args for cache key
When making baked query in classmethod of declarative base,
cls should be added in cache key.

    @as_declarative
    class Base(object):

        @classmethod
        def baked_query(cls):
            return bakery(lambda: session.query(cls), (cls,))
2015-06-02 22:05:18 +09:00
Mike Bayer 0766c80b9c Merge remote-tracking branch 'origin/pr/176' 2015-05-29 20:52:27 -04:00
Éric Araujo 6245d003f2 Fix typo in directive 2015-05-29 15:21:16 -04:00
Allen, Timothy 19571e2f8f Update to correct TDS version; FreeTDS only supports up to 7.3. 8.0 is not a valid version (Microsoft released the spec late). 2015-05-28 11:25:56 -07:00
Jochen Van de Velde 1bc7881171 Remove spaces around kwargs in metadata.rst 2015-05-26 23:27:05 +02:00
Mike Bayer a50dcb31b9 - Fixed bug where known boolean values used by
:func:`.engine_from_config` were not being parsed correctly;
these included ``pool_threadlocal`` and the psycopg2 argument
``use_native_unicode``. fixes #3435
- add legacy_schema_aliasing config parsing for mssql
- move use_native_unicode config arg to the psycopg2 dialect
2015-05-26 10:56:23 -04:00
Mike Bayer 88f5479002 - turn some dials to try to get more log output 2015-05-25 14:47:57 -04:00
Mike Bayer 0618357b84 - work around RTD issue #1293, take one 2015-05-25 14:34:26 -04:00
Mike Bayer 9157911013 - Added a new dialect flag to the MSSQL dialect
``legacy_schema_aliasing`` which when set to False will disable a
very old and obsolete behavior, that of the compiler's
attempt to turn all schema-qualified table names into alias names,
to work around old and no longer locatable issues where SQL
server could not parse a multi-part identifier name in all
circumstances.   The behavior prevented more
sophisticated statements from working correctly, including those which
use hints, as well as CRUD statements that embed correlated SELECT
statements.  Rather than continue to repair the feature to work
with more complex statements, it's better to just disable it
as it should no longer be needed for any modern SQL server
version.  The flag defaults to True for the 1.0.x series, leaving
current behavior unchanged for this version series.  In the 1.1
series, it will default to False.  For the 1.0 series,
when not set to either value explicitly, a warning is emitted
when a schema-qualified table is first used in a statement, which
suggests that the flag be set to False for all modern SQL Server
versions.
fixes #3424
fixes #3430
2015-05-24 21:02:29 -04:00
Mike Bayer 0198d9aa5f - break out binary insert against None, disable for freetds for now 2015-05-24 17:08:02 -04:00
Mike Bayer 96f49085b8 - autopep8 2015-05-24 17:07:54 -04:00
Mike Bayer 1bb9c99ea9 - liberalize list.remove() regexp as recent Pypy versions
format this message differently than cpython
2015-05-24 09:49:14 -04:00
Mike Bayer e9921ad356 - fix some tests related to the URL change and try to make
the URL design a little simpler
2015-05-23 09:07:36 -04:00
Mike Bayer 04c625467e - Adjustments to the engine plugin hook, such that the
:meth:`.URL.get_dialect` method will continue to return the
ultimate :class:`.Dialect` object when a dialect plugin is used,
without the need for the caller to be aware of the
:meth:`.Dialect.get_dialect_cls` method.
reference #3379
2015-05-22 13:51:00 -04:00
Mike Bayer c581b907b3 - document fully how to use autoincrement w/ SQLite including
non-Integer column types, fixes #2075
2015-05-22 13:27:09 -04:00