Commit Graph

10240 Commits

Author SHA1 Message Date
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
Iuri de Silvio 955576fcf6 Dialect option postgresql_concurrently to Index construct. 2015-02-25 21:05:31 -03: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
David Marin 00f37f3984 fix Python 2-specific byte conversion 2015-02-05 16:52:53 -08:00
Mike Bayer 503a40ad70 - The MySQL dialect now renders TIMESTAMP with NULL / NOT NULL in
all cases, so that MySQL 5.6.6 with the
``explicit_defaults_for_timestamp`` flag enabled will
will allow TIMESTAMP to continue to work as expected when
``nullable=False``.  Existing applications are unaffected as
SQLAlchemy has always emitted NULL for a TIMESTAMP column that
is ``nullable=True``.  fixes #3155
2015-02-05 16:24:45 -05:00
Mike Bayer 068f9a1531 - Fixed bug in :class:.Connection and pool where the
:meth:`.Connection.invalidate` method, or an invalidation due
to a database disconnect, would fail if the
``isolation_level`` parameter had been used with
:meth:`.Connection.execution_options`; the "finalizer" that resets
the isolation level would be called on the no longer opened connection.
fixes #3302
2015-02-04 18:51:24 -05:00
Mike Bayer 9cbe235810 - A warning is emitted if the `isolation_level` parameter is used
with :meth:`.Connection.execution_options` when a :class:`.Transaction`
is in play; DBAPIs and/or SQLAlchemy dialects such as psycopg2,
MySQLdb may implicitly rollback or commit the transaction, or
not change the setting til next transaction, so this is never safe.
- Added new parameter :paramref:`.Session.connection.execution_options`
which may be used to set up execution options on a :class:`.Connection`
when it is first checked out, before the transaction has begun.
This is used to set up options such as isolation level on the
connection before the transaction starts.
- added new documentation section
detailing best practices for setting transaction isolation with
sessions.
fixes #3296
2015-02-04 18:35:01 -05:00
Mike Bayer 9ea19b3746 - Fixed bug in lazy loading SQL construction whereby a complex
primaryjoin that referred to the same "local" column multiple
times in the "column that points to itself" style of self-referential
join would not be substituted in all cases.   The logic to determine
substitutions here has been reworked to be more open-ended.
fixes #3300
2015-02-02 19:46:13 -05:00
Mike Bayer 54088c9b33 - don't overwrite an existing _strategy_keys collection;
this would cause LazyLoader to be initialized twice per property.
2015-02-02 12:58:24 -05:00
Mike Bayer b2189da650 - Repaired support for Postgresql UUID types in conjunction with
the ARRAY type when using psycopg2.  The psycopg2 dialect now
employs use of the psycopg2.extras.register_uuid() hook
so that UUID values are always passed to/from the DBAPI as
UUID() objects.   The :paramref:`.UUID.as_uuid` flag is still
honored, except with psycopg2 we need to convert returned
UUID objects back into strings when this is disabled.
fixes #2940
2015-02-01 19:03:08 -05:00
Mike Bayer 02dbcfa88a Merge remote-tracking branch 'origin/pr/68' into pr68 2015-02-01 18:43:34 -05:00
Mike Bayer bf70f556b3 - Added support for the :class:postgresql.JSONB datatype when
using psycopg2 2.5.4 or greater, which features native conversion
of JSONB data so that SQLAlchemy's converters must be disabled;
additionally, the newly added psycopg2 extension
``extras.register_default_jsonb`` is used to establish a JSON
deserializer passed to the dialect via the ``json_deserializer``
argument.  Also repaired the Postgresql integration tests which
weren't actually round-tripping the JSONB type as opposed to the
JSON type.  Pull request courtesy Mateusz Susik.

- Repaired the use of the "array_oid" flag when registering the
HSTORE type with older psycopg2 versions < 2.4.3, which does not
support this flag, as well as use of the native json serializer
hook "register_default_json" with user-defined ``json_deserializer``
on psycopg2 versions < 2.5, which does not include native json.
2015-01-31 19:04:54 -05:00
Mike Bayer a523163c41 Merge remote-tracking branch 'origin/pr/145' into pr145 2015-01-31 17:53:02 -05:00
Mike Bayer 383bb3f708 - The :class:.CheckConstraint construct now supports naming
conventions that include the token ``%(column_0_name)s``; the
constraint expression is scanned for columns.  Additionally,
naming conventions for check constraints that don't include the
``%(constraint_name)s`` token will now work for :class:`.SchemaType`-
generated constraints, such as those of :class:`.Boolean` and
:class:`.Enum`; this stopped working in 0.9.7 due to 🎫`3067`.
fixes #3299
2015-01-30 13:38:51 -05:00
Mike Bayer 3712e35c32 - Fixed bug in 0.9's foreign key setup system, such that
the logic used to link a :class:`.ForeignKey` to its parent could fail
when the foreign key used "link_to_name=True" in conjunction with
a target :class:`.Table` that would not receive its parent column until
later, such as within a reflection + "useexisting" scenario,
if the target column in fact had a key value different from its name,
as would occur in reflection if column reflect events were used to
alter the .key of reflected :class:`.Column` objects so that the
link_to_name becomes significant.  Also repaired support for column
type via FK transmission in a similar way when target columns had a
different key and were referenced using link_to_name.
fixes #3298
2015-01-28 11:55:26 -05:00
Mike Bayer 8aaa8dd6bd - fix link to non_primary flag
- rewrite the multiple mappers section
2015-01-27 00:34:10 -05:00
Mike Bayer 62f8774906 - fix this test for py3k 2015-01-26 22:45:12 -05:00
Mike Bayer a826ff366b - additional test adjustments for pypy / psycopg2cffi. This
consists mainly of adjusting fixtures to ensure connections are closed
explicitly.  psycopg2cffi also handles unicode bind parameter
names differently than psycopg2, and seems to possibly have a little less
control over floating point values at least in one test which is
marked as a "fail", though will see if it runs differently on linux
than osx..
- changelog for psycopg2cffi, fixes #3052
2015-01-26 18:43:19 -05:00
Shaun Stanworth 226bd8d707 Include psycopg2cffi in dialect docs 2015-01-26 18:43:19 -05:00
Shaun Stanworth 0953f26250 78-char width 2015-01-26 18:43:19 -05:00
Shaun Stanworth f94d75ede5 Added psycopg2cffi dialect 2015-01-26 18:43:19 -05:00
Mike Bayer 987f40b5aa - changelog for #3262, fixes #3262 2015-01-26 17:04:40 -05:00
Mike Bayer 54e68dc8bd Merge branch 'bb_issue_3262' of https://bitbucket.org/xflr6/sqlalchemy 2015-01-26 16:58:11 -05:00
Mike Bayer 20cdf0e855 - changelog for pullreq github:150 2015-01-26 16:53:59 -05:00