Commit Graph

2307 Commits

Author SHA1 Message Date
Mike Bayer 58ce4d53bf - add a test for #2771, fixes #2771
- changelog for #2771
2015-03-20 15:08:23 -04:00
Mike Bayer 2feb40d0a4 - changelog for #3333, fixes #3333 2015-03-20 11:28:47 -04:00
Mike Bayer cd076470ba - Loosened some restrictions that were added to `@declared_attr`
objects, such that they were prevented from being called outside
of the declarative process; this is related to the enhancements
of #3150 which allow ``@declared_attr`` to return a value that is
cached based on the current class as it's being configured.
The exception raise has been removed, and the behavior changed
so that outside of the declarative process, the function decorated by
``@declared_attr`` is called every time just like a regular
``@property``, without using any caching, as none is available
at this stage.
fixes #3331
2015-03-18 18:57:13 -04:00
Mike Bayer 138293c246 - fix typo, fixes #3325 2015-03-17 17:32:16 -04:00
Mike Bayer 811c8204ca - fix incorrect example 2015-03-17 12:34:10 -04:00
Mike Bayer b7e151ac5c - The "auto close" for :class:.ResultProxy is now a "soft" close.
That is, after exhausing all rows using the fetch methods, the
DBAPI cursor is released as before and the object may be safely
discarded, but the fetch methods may continue to be called for which
they will return an end-of-result object (None for fetchone, empty list
for fetchmany and fetchall).   Only if :meth:`.ResultProxy.close`
is called explicitly will these methods raise the "result is closed"
error.
fixes #3330 fixes #3329
2015-03-17 12:32:33 -04:00
Mike Bayer 2cadd768aa - merge 0.9 changelog 2015-03-16 14:11:49 -04:00
Mike Bayer 74641efb78 - changelog for #3327 fixes #3327 2015-03-16 12:18:58 -04:00
Mike Bayer 175e5c97a7 1.0.0b1 2015-03-13 16:40:39 -04:00
Mike Bayer f1e777b2ab - add notes for prerelease install 2015-03-13 16:36:43 -04:00
Mike Bayer 64b7a50cbd - call this 1.0.0b1 2015-03-13 16:23:12 -04:00
Mike Bayer 4077e99f3f - tweaks regarding the use_alter update 2015-03-13 16:22:01 -04:00
Mike Bayer 75b4c67a56 - repair forwards-port directives 2015-03-12 16:23:24 -04:00
Mike Bayer 941fe5e060 - add the fact that we can cache the sql naively as well 2015-03-12 12:19:35 -04:00
Mike Bayer e42d8184ac - fix quantize recipe, fixes #3322 2015-03-12 11:50:00 -04:00
Mike Bayer 6b76352f46 - add a rationale section 2015-03-12 11:23:44 -04:00
Mike Bayer f211ad254d - try to document how to get columns from constraints.
unfortunately Sphinx refuses to work correctly for the columns
attribute so we just add a lame message to contains_column().
2015-03-12 10:14:52 -04:00
Mike Bayer e3b46bd624 - Added a new extension suite :mod:sqlalchemy.ext.baked. This
simple but unusual system allows for a dramatic savings in Python
overhead for the construction and processing of orm :class:`.Query`
objects, from query construction up through rendering of a string
SQL statement.
fixes #3054
2015-03-11 20:31:11 -04:00
Mike Bayer b815e94833 - Added a new entry `"entity"` to the dictionaries returned by
:attr:`.Query.column_descriptions`.  This refers to the primary ORM
mapped class or aliased class that is referred to by the expression.
Compared to the existing entry for ``"type"``, it will always be
a mapped entity, even if extracted from a column expression, or
None if the given expression is a pure core expression.
references #3320
2015-03-11 14:46:52 -04:00
Mike Bayer 71b8df2e53 - The Postgresql :class:.postgresql.ENUM type will emit a
DROP TYPE instruction when a plain ``table.drop()`` is called,
assuming the object is not associated directly with a
:class:`.MetaData` object.   In order to accomodate the use case of
an enumerated type shared between multiple tables, the type should
be associated directly with the :class:`.MetaData` object; in this
case the type will only be created at the metadata level, or if
created directly.  The rules for create/drop of
Postgresql enumerated types have been highly reworked in general.
fixes #3319
2015-03-11 11:41:52 -04:00
Mike Bayer 710021d22e - Added a new event suite :class:.QueryEvents. The
:meth:`.QueryEvents.before_compile` event allows the creation
of functions which may place additional modifications to
:class:`.Query` objects before the construction of the SELECT
statement.   It is hoped that this event be made much more
useful via the advent of a new inspection system that will
allow for detailed modifications to be made against
:class:`.Query` objects in an automated fashion.
fixes #3317
2015-03-10 19:56:59 -04:00
Mike Bayer 201ba16fc8 - The subquery wrapping which occurs when joined eager loading
is used with a one-to-many query that also features LIMIT,
OFFSET, or DISTINCT has been disabled in the case of a one-to-one
relationship, that is a one-to-many with
:paramref:`.relationship.uselist` set to False.  This will produce
more efficient queries in these cases.
fixes #3249
2015-03-10 18:23:23 -04:00
Mike Bayer 66fa5b50a5 - Fixed bug where the session attachment error "object is already
attached to session X" would fail to prevent the object from
also being attached to the new session, in the case that execution
continued after the error raise occurred.
fixes #3301
2015-03-10 17:51:35 -04:00
Mike Bayer 95e53d0b60 - Fixed bug where using an `__abstract__` mixin in the middle
of a declarative inheritance hierarchy would prevent attributes
and configuration being correctly propagated from the base class
to the inheriting class.
fixes #3219 fixes #3240
2015-03-10 17:21:46 -04:00
Mike Bayer 39f2df3eba - feature, not enhancement 2015-03-10 16:16:49 -04:00
Mike Bayer ebee0c9df3 - 0.9.9 changelog update 2015-03-10 15:59:34 -04:00
Mike Bayer 50866d2f85 - copyright 2015 2015-03-10 15:24:28 -04:00
Mike Bayer 5d1206c10a - changelog and docs for pullreq bitbucket:45 2015-03-10 15:05:27 -04:00
Mike Bayer 78874d3679 - changelog for pr github:154 2015-03-10 14:54:20 -04:00
Mike Bayer 6ac0555eaa - changelog / doc for sqlite partial indexes 2015-03-10 14:18:35 -04: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 05ac6bcc0e - changelog and migration notes for new pg8000 features from
pullreq github:132
2015-03-02 19:27:21 -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 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 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 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 94d57374c4 - add a new section regarding multiprocessing 2015-02-17 13:43:48 -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 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 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 7b9134be71 - test + changelog 2015-02-08 19:58:34 -05:00
Sławek Ehlert 3db84b174a - cx_Oracle.makedsn can now be passed service_name; squash
commit of pr152
2014-04-02 13:45:53 -04: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 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 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 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