Commit Graph

9738 Commits

Author SHA1 Message Date
Mike Bayer d70cf329cf - do a full rewrite of callcounts 2015-03-07 18:04:49 -05:00
Mike Bayer b3d3795de0 - The SQL compiler now generates the mapping of expected columns
such that they are matched to the received result set positionally,
rather than by name.  Originally, this was seen as a way to handle
cases where we had columns returned with difficult-to-predict names,
though in modern use that issue has been overcome by anonymous
labeling.   In this version, the approach basically reduces function
call count per-result by a few dozen calls, or more for larger
sets of result columns.  The approach still degrades into a modern
version of the old approach if textual elements modify the result
map, or if any discrepancy in size exists between
the compiled set of columns versus what was received, so there's no
issue for partially or fully textual compilation scenarios where these
lists might not line up.  fixes #918
- callcounts still need to be adjusted down for this so zoomark
tests won't pass at the moment
2015-03-07 17:18:31 -05:00
Mike Bayer 0a1f720355 Merged in jocmeh/sqlalchemy (pull request #46)
minor docstring fix in MappedCollection class
2015-03-06 11:20:45 -05:00
Jochem Oosterveen 34cb52e8d9 minor docstring fix in MappedCollection class 2015-03-06 16:58:30 +01:00
Mike Bayer 05ac6bcc0e - changelog and migration notes for new pg8000 features from
pullreq github:132
2015-03-02 19:27:21 -05:00
Mike Bayer cfb2eee0f3 - add a skip for JSONB on pg8000 if we are on 1.10.1 or earlier 2015-03-02 19:16:37 -05:00
Mike Bayer d140983148 Merge remote-tracking branch 'origin/pr/132' into pr132 2015-03-02 19:00:19 -05:00
Mike Bayer 79cbd377a6 - squash-merge the final row_proc integration branch. this is
a much more modest outcome than what we started with.   The
work of create_row_processor() for ColumnProperty objects
is essentially done at query setup time combined with some
lookups in _instance_processor().
- to allow this change for deferred columns, deferred columns
no longer search for themselves in the result.   If they've been
set up as deferred without any explicit directive to undefer them,
then this is what was asked for.  if we don't do this,
then we're stuck with this performance penalty for all deferred
columns which in the vast majority of typical use cases (e.g. loading
large, legacy tables or tables with many/large very seldom
used values) won't be present in the result and won't be accessed at all.
2015-03-01 16:09:11 -05:00
Jason Held c5edbc6fdc Update migration_09.rst
typo fix: indivdual -> individual.
2015-02-25 12:49:20 -05:00
Mike Bayer 3a56c4f019 - repair issue in declared_attr.cascading such that within a
subclass, the value returned by the descriptor is not available
because the superclass is already mapped with the InstrumentedAttribute,
until the subclass is mapped.  We add a setattr() to set up that
attribute so that the __mapper_args__ hook and possibly others
have access to the "cascaded" version of the attribute within
the call.
2015-02-24 15:29:30 -05:00
Mike Bayer 305ea84004 - Fixed bugs in ORM object comparisons where comparison of
many-to-one ``!= None`` would fail if the source were an aliased
class, or if the query needed to apply special aliasing to the
expression due to aliased joins or polymorphic querying; also fixed
bug in the case where comparing a many-to-one to an object state
would fail if the query needed to apply special aliasing
due to aliased joins or polymorphic querying.
fixes #3310
2015-02-20 15:14:08 -05:00
Mike Bayer 4f63e24970 - remove the need for a recursive call here 2015-02-20 00:11:48 -05:00
Mike Bayer ad66266d3d - Fixed bug where internal assertion would fail in the case where
an ``after_rollback()`` handler for a :class:`.Session` incorrectly
adds state to that :class:`.Session` within the handler, and the task
to warn and remove this state (established by 🎫`2389`) attempts
to proceed.
fixes #3309
2015-02-20 00:01:19 -05:00
Mike Bayer 140e8254a2 - expect_warnings was not expecting and neither was assert_warnings
asserting.
2015-02-19 12:01:48 -05:00
Mike Bayer 145db3bed7 - repair merge failure 2015-02-19 12:01:22 -05:00
Mike Bayer b86b239c87 - autopep8 2015-02-19 11:37:44 -05:00
Mike Bayer 3209a73b92 - Mapped state internals have been reworked to allow for a 50% reduction
in callcounts specific to the "expiration" of objects, as in
the "auto expire" feature of :meth:`.Session.commit` and
for :meth:`.Session.expire_all`, as well as in the "cleanup" step
which occurs when object states are garbage collected.
fixes #3307
2015-02-18 16:08:19 -05:00
Mike Bayer 3eff76c4b0 - add the test_expire_lots test for comparison 2015-02-18 15:50:37 -05:00
Mike Bayer 94d57374c4 - add a new section regarding multiprocessing 2015-02-17 13:43:48 -05:00
Mike Bayer 3c46eb17ed - additional mysql cast-related test fixes 2015-02-09 20:49:19 -05:00
Mike Bayer af42398742 - The MySQL dialect now supports CAST on types that are constructed
as :class:`.TypeDecorator` objects.
2015-02-09 20:43:28 -05:00
Mike Bayer 0843bbcfbb - add a fix to MySQL re: #3074 tests, make sure we check table is present 2015-02-09 20:32:53 -05:00
Mike Bayer 8750596c11 - test skips for MySQL w new cast warning 2015-02-09 20:32:06 -05:00
Mike Bayer 1ad236127c - A warning is emitted when :func:.cast is used with the MySQL
dialect on a type where MySQL does not support CAST; MySQL only
supports CAST on a subset of datatypes.   SQLAlchemy has for a long
time just omitted the CAST for unsupported types in the case of
MySQL.  While we don't want to change this now, we emit a warning
to show that it's taken place.   A warning is also emitted when
a CAST is used with an older MySQL version (< 4) that doesn't support
CAST at all, it's skipped in this case as well.
fixes #3237
2015-02-09 15:29:14 -05:00
Mike Bayer 03038f7e75 - flake8 2015-02-09 15:08:52 -05:00
Mike Bayer 81aa5b376e - Literal values within a :class:.DefaultClause, which is invoked
when using the :paramref:`.Column.server_default` parameter, will
now be rendered using the "inline" compiler, so that they are rendered
as-is, rather than as bound parameters.
fixes #3087
2015-02-09 14:58:26 -05:00
Mike Bayer 53da71fcc2 - remove meaningless assignment 2015-02-08 20:14:37 -05:00
Mike Bayer 7b9134be71 - test + changelog 2015-02-08 19:58:34 -05:00
Mike Bayer a7c8cf0f2f Merge remote-tracking branch 'origin/pr/147' into pr147
Conflicts:
	lib/sqlalchemy/orm/query.py
2015-02-08 19:50:41 -05:00
Mike Bayer ab1f7d2058 - add versionadded for service_name 2015-02-08 19:13:21 -05:00
Tony Locke 17e03a0ea8 Changed pg8000 dialect to cope with native JSON
For versions > 1.10.1 pg8000 returns de-serialized JSON objects rather
than a string. SQL parameters are still strings though.
2015-01-03 16:59:17 +00:00
Tony Locke c93706fa33 Make pg8000 version detection more robust
pg8000 uses Versioneer, which means that development versions have
version strings that don't fit into the dotted triple number format.
Released versions will always fit the triple format though.
2014-12-16 21:03:04 +00:00
Tony Locke 8038cfa077 pg8000 client_encoding in create_engine()
The pg8000 dialect now supports the setting of the PostgreSQL parameter
client_encoding from create_engine().
2014-12-16 20:55:55 +00:00
Mike Bayer 7cd4362924 - automap isn't new anymore 2014-12-14 16:21:40 -05:00
Mike Bayer 468db416db - rework sqlite FK and unique constraint system to combine both PRAGMA
and regexp parsing of SQL in order to form a complete picture of
constraints + their names.  fixes #3244 fixes #3261
- factor various PRAGMA work to be centralized into one call
2014-12-13 19:24:56 -05:00
Jon Nelson 5b146e1bab - add tentative 'changelog' documentation on #3244 2014-12-13 18:34:51 -05:00
Jon Nelson 85c04dd0bb - add test_get_unnamed_unique_constraints to SQLite reflection tests 2014-12-13 18:34:50 -05:00
Jon Nelson 91af733787 - fix unique constraint parsing for sqlite -- may return '' for name, however 2014-12-13 18:34:50 -05:00
Mike Bayer cf7981f60d - Added new method :meth:.Session.invalidate, functions similarly
to :meth:`.Session.close`, except also calls
:meth:`.Connection.invalidate`
on all connections, guaranteeing that they will not be returned to
the connection pool.  This is useful in situations e.g. dealing
with gevent timeouts when it is not safe to use the connection further,
even for rollbacks.
references #3258
2014-12-12 19:59:11 -05:00
Mike Bayer 08e02579e0 - update zoomark 2014-12-12 15:55:34 -05:00
Mike Bayer 3c70f60950 - fix up query update /delete documentation, make warnings
a lot clearer, partial fixes for #3252
2014-12-10 13:08:53 -05:00
Mike Bayer 347db81aea - keep working on fixing #3266, more cases, more tests 2014-12-10 12:15:14 -05:00
Mike Bayer eee617e08e - rework the handle error on connect tests from test_parsconnect where
they don't really belong into a new suite in test_execute
2014-12-10 12:11:59 -05:00
Mike Bayer 295092db54 Merge remote-tracking branch 'origin/pr/153' 2014-12-08 22:59:54 -05:00
Yuval Langer c86c593ec3 Removing unneeded space. 2014-12-09 04:19:18 +02:00
Mike Bayer 06738f665e - identify another spot where _handle_dbapi_error() needs to do something
differently for the case where it is called in an already-invalidated state;
don't call upon self.connection
2014-12-08 15:15:02 -05:00
Mike Bayer b7cf11b163 - simplify the "noconnection" error handling, setting
_handle_dbapi_exception_noconnection() to only invoke in the case
of raw_connection() in the constructor of Connection.   in all other
cases the Connection proceeds with _handle_dbapi_exception() including
revalidate.
2014-12-08 14:05:20 -05:00
Mike Bayer 8553c195c2 - autoinc here for oracle 2014-12-08 12:34:40 -05:00
Mike Bayer 6b9f62df10 - force the _has_events flag to True on engines, so that
profiling is more predictable
- restore the profiling from before this change
2014-12-08 11:18:38 -05:00
Mike Bayer 902c8d480b - some profile changes likely due to the change in event listening
on engines
2014-12-08 01:22:37 -05:00