Commit Graph

2307 Commits

Author SHA1 Message Date
Mike Bayer 545df6b39e - Fixed bug in Firebird index reflection where the columns within the
index were not sorted correctly; they are now sorted
in order of RDB$FIELD_POSITION.
2013-12-27 13:20:58 -05:00
Mike Bayer 4798fd947f - The "asdecimal" flag used with the :class:.Float type will now
work with Firebird dialects; previously the decimal conversion was
not occurring.
- scale back some firebird FP numeric tests
2013-12-27 13:16:48 -05:00
Mike Bayer c837dc485e changelog, will merge to 0.8 2013-12-27 11:13:41 -05:00
Mike Bayer 65bd6ec966 - Fixed issue where a primary key column that has a Sequence on it,
yet the column is not the "auto increment" column, either because
it has a foreign key constraint or ``autoincrement=False`` set,
would attempt to fire the Sequence on INSERT for backends that don't
support sequences, when presented with an INSERT missing the primary
key value.  This would take place on non-sequence backends like
SQLite, MySQL. [ticket:2896]
2013-12-20 10:26:09 -05:00
Mike Bayer 5f76f29c15 - Fixed bug with :meth:.Insert.from_select method where the order
of the given names would not be taken into account when generating
the INSERT statement, thus producing a mismatch versus the column
names in the given SELECT statement.  Also noted that
:meth:`.Insert.from_select` implies that Python-side insert defaults
cannot be used, since the statement has no VALUES clause. [ticket:2895]
2013-12-19 16:02:14 -05:00
Mike Bayer 2692238f45 - Improvements to the system by which SQL types generate within
``__repr__()``, particularly with regards to the MySQL integer/numeric/
character types which feature a wide variety of keyword arguments.
The ``__repr__()`` is important for use with Alembic autogenerate
for when Python code is rendered in a migration script.
[ticket:2893]
2013-12-18 18:26:15 -05:00
Mike Bayer 653fcb892b this is a github PR 2013-12-17 17:16:43 -05:00
Mike Bayer c95e3c6512 add JSON 2013-12-17 16:30:22 -05:00
Mike Bayer ed174b71bf - changelog 2013-12-17 15:40:19 -05:00
Mike Bayer 80b6591dbe - The :func:.cast function, when given a plain literal value,
will now apply the given type to the given literal value on the
bind parameter side according
to the type given to the cast.   This essentially replaces what would
normally be the detected type of the literal value.   This only
takes effect if the auto-detected type of the literal value is either
"nulltype" (e.g. couldn't detect)
or a type that is of the same "affinity" as the cast type.
The net change here is that the :func:`.cast` function includes more
of the functionality already present in the :func:`.type_coerce` function.
2013-12-17 15:38:35 -05:00
Mike Bayer 207aaf2f41 - for [ticket:2651], leaving CheckConstraint alone, preferring to keep
backwards compatibility.  A note about backslashing escapes is added.
Because the Text() construct now supports bind params better, the example
given in the code raises an exception now, so that should cover us.
The exception itself has been enhanced to include the key name of the
bound param.  We're backporting this to 0.8 but 0.8 doesn't have the
text->bind behavior that raises.
2013-12-16 19:32:10 -05:00
Mike Bayer 84f1d34179 - An adjustment to the :func:.subqueryload strategy which ensures that
the query runs after the loading process has begun; this is so that
the subqueryload takes precedence over other loaders that may be
hitting the same attribute due to other eager/noload situations
at the wrong time. [ticket:2887]
2013-12-16 19:17:41 -05:00
Mike Bayer 98c23acee6 - fix up the FAQ regarding the "foo_id" issue
- add session object states to the glossary
2013-12-16 18:52:52 -05:00
Mike Bayer 1d9eb41013 - Fixed bug when using joined table inheritance from a table to a
select/alias on the base, where the PK columns were also not same
named; the persistence system would fail to copy primary key values
from the base table to the inherited table upon INSERT.
[ticket:2885]
2013-12-16 15:25:48 -05:00
Mike Bayer b2223ab149 - add "force_nocheck" as a way to turn on unicode=force without even
doing the isinstance() check - currently used only by psycopg2 + native enum + py2k.
- didn't realize psycopg2 had UNICODEARRAY extension all this time; replace _PGArray
with just using UNICODEARRAY instead.
- replace unnecessary/inconsistent __import__ in _isolation_lookup.
2013-12-15 21:23:01 -05:00
Mike Bayer f244287f46 - :func:.composite will raise an informative error message when the
columns/attribute (names) passed don't resolve to a Column or mapped
attribute (such as an erroneous tuple); previously raised an unbound
local. [ticket:2889]
2013-12-12 13:30:16 -05:00
Mike Bayer ace7bdbc78 - Error message when a string arg sent to :func:.relationship which
doesn't resolve to a class or mapper has been corrected to work
the same way as when a non-string arg is received, which indicates
the name of the relationship which had the configurational error.
[ticket:2888]
2013-12-12 12:49:57 -05:00
Mike Bayer 9bef2001a6 move things that are 90% behavioral improvements to that section. the list of things
that can definitely people should be more focused.
2013-12-11 20:19:56 -05:00
Mike Bayer d5384d6011 - implement "literal binds" for the text() clause, [ticket:2882] 2013-12-11 20:00:39 -05:00
Mike Bayer 84af7e6c22 - The :class:.ForeignKey class more aggressively checks the given
column argument.   If not a string, it checks that the object is
at least a :class:`.ColumnClause`, or an object that resolves to one,
and that the ``.table`` attribute, if present, refers to a
:class:`.TableClause` or subclass, and not something like an
:class:`.Alias`.  Otherwise, a :class:`.ArgumentError` is raised.
[ticket:2883]
2013-12-11 19:48:27 -05:00
Mike Bayer 9087157749 - The :class:.exc.StatementError or DBAPI-related subclass
now can accomodate additional information about the "reason" for
the exception; the :class:`.Session` now adds some detail to it
when the exception occurs within an autoflush.  This approach
is taken as opposed to combining :class:`.FlushError` with
a Python 3 style "chained exception" approach so as to maintain
compatibility both with Py2K code as well as code that already
catches ``IntegrityError`` or similar.
2013-12-11 14:30:18 -05:00
Mike Bayer 164bff0749 - round trip test
- changelog
- some doc rearrangement
2013-12-09 21:27:14 -05:00
Mike Bayer d5a86d8f86 Merge branch 'tsvector' of https://bitbucket.org/nibrahim/sqlalchemy/branch/tsvector into tsvector 2013-12-09 21:01:26 -05:00
Mike Bayer 111c61546c sqlany dialect moves to github 2013-12-09 20:56:10 -05:00
Noufal Ibrahim 4eb8437f61 Updates documentation for tsvector type.
Signed-off-by: Noufal Ibrahim <noufal@nibrahim.net.in>
2013-12-10 01:07:36 +05:30
Mike Bayer 49d8026987 - The :func:.engine_from_config function has been improved so that
we will be able to parse dialect-specific arguments from string
configuration dictionaries.  Dialect classes can now provide their
own list of parameter types and string-conversion routines.
The feature is not yet used by the built-in dialects, however.
[ticket:2875]
2013-12-07 18:38:15 -05:00
Mike Bayer 6d5eae78a7 - A DBAPI that raises an error on `connect()` which is not a subclass
of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.)
will propagate the exception unchanged.  Previously,
the error handling specific to the ``connect()`` routine would both
inappropriately run the exception through the dialect's
:meth:`.Dialect.is_disconnect` routine as well as wrap it in
a :class:`sqlalchemy.exc.DBAPIError`.  It is now propagated unchanged
in the same way as occurs within the execute process. [ticket:2881]
- add tests for this in test_parseconnect, but also add tests in test_execute
to ensure the execute() behavior as well
2013-12-07 17:20:05 -05:00
Mike Bayer d1cc78479d - The :class:.QueuePool has been enhanced to not block new connection
attempts when an existing connection attempt is blocking.  Previously,
the production of new connections was serialized within the block
that monitored overflow; the overflow counter is now altered within
it's own critical section outside of the connection process itself.
[ticket:2880]
2013-12-06 19:57:19 -05:00
Mike Bayer 003b288b76 - Made a slight adjustment to the logic which waits for a pooled
connection to be available, such that for a connection pool
with no timeout specified, it will every half a second break out of
the wait to check for the so-called "abort" flag, which allows the
waiter to break out in case the whole connection pool was dumped;
normally the waiter should break out due to a notify_all() but it's
possible this notify_all() is missed in very slim cases.
This is an extension of logic first introduced in 0.8.0, and the
issue has only been observed occasionally in stress tests.
2013-12-06 16:33:42 -05:00
Mike Bayer b653fb3a23 - The precedence rules for the :meth:.ColumnOperators.collate operator
have been modified, such that the COLLATE operator is now of lower
precedence than the comparison operators.  This has the effect that
a COLLATE applied to a comparison will not render parenthesis
around the comparison, which is not parsed by backends such as
MSSQL.  The change is backwards incompatible for those setups that
were working around the issue by applying :meth:`.Operators.collate`
to an individual element of the comparison expression,
rather than the comparison expression as a whole. [ticket:2879]
2013-12-05 19:03:31 -05:00
Mike Bayer 3621e4b8de - changelog + test for pullreq #7, MSSQL dialect for DROP INDEX 2013-12-05 18:36:59 -05:00
Mike Bayer 3a03c2e715 - add a new example section for "join conditions", start putting
the primaryjoin examples there
2013-12-05 12:17:16 -05:00
Mike Bayer 7c1bb76904 fix underline 2013-12-05 12:13:37 -05:00
Mike Bayer bddf55fef6 - reflection of unique constraints backported to 0.8.4 [ticket:1443] 2013-12-03 15:01:34 -05:00
Mike Bayer 36e1aa0afd - The :class:.DeferredReflection class has been enhanced to provide
automatic reflection support for the "secondary" table referred
to by a :func:`.relationship`.   "secondary", when specified
either as a string table name, or as a :class:`.Table` object with
only a name and :class:`.MetaData` object will also be included
in the reflection process when :meth:`.DeferredReflection.prepare`
is called. [ticket:2865]
- clsregistry._resolver() now uses a stateful _class_resolver()
class in order to handle the work of mapping strings to
objects.   This is to provide for simpler extensibility, namely
a ._resolvers collection of ad-hoc name resolution functions;
the DeferredReflection class adds its own resolver here in order
to handle relationship(secondary) names which generate new
Table objects.
2013-12-03 13:46:41 -05:00
Mike Bayer 21feea9c1d - Added ORA-02396 "maximum idle time" error code to list of
"is disconnect" codes with cx_oracle. [ticket:2864]
2013-12-03 13:18:40 -05:00
Mike Bayer 50e3847f09 - Added new argument `include_backrefs=True` to the
:func:`.validates` function; when set to False, a validation event
will not be triggered if the event was initated as a backref to
an attribute operation from the other side. [ticket:1535]
- break out validation tests into an updated module test_validators
2013-12-02 12:40:50 -05:00
Mike Bayer d80ee72aaa - the pronoun removal commit. there was only one instance of a
standalone gendered pronoun with a gender-neutral subject, but also
have replaced all occurences of "his/her", "his or her", etc.  The docs have always
strived to account for both genders in any non-specific singular pronoun,
however recent controversy in the community suggests
that a zero-gendered-pronoun policy is probably best going forward.
2013-11-30 17:31:00 -05:00
Mike Bayer 31886aff29 remove whitespace 2013-11-30 17:26:28 -05:00
Mike Bayer 404b47a50c - changelog
- put list.clear() instrumentation under "if not py2k"
2013-11-30 16:26:55 -05:00
Mike Bayer 92d8baeb95 not new anymore... 2013-11-30 16:15:58 -05:00
Mike Bayer ea1095d1da - selected documentation issues
- add glossary terms
2013-11-30 16:07:14 -05:00
Mike Bayer 2688fce67f - re-document synonyms and remove warnings about "superseded"; synonyms
are still useful, just include notes that for more complex descriptor operations,
hybrids are probably preferable
2013-11-30 15:30:24 -05:00
Mike Bayer 66773a8801 - Fixed bug where values within an ENUM weren't escaped for single
quote signs.   Note that this is backwards-incompatible for existing
workarounds that manually escape the single quotes. [ticket:2878]
2013-11-30 13:53:26 -05:00
Mike Bayer 58fab1be98 - start reworking examples to include more code from the wiki.
- add the other versioning examples from the wiki
- modernize the dictlike examples
2013-11-29 18:53:53 -05:00
Mike Bayer c368034ca0 remove this 2013-11-29 18:53:37 -05:00
Mike Bayer e6f67f4805 Fixed bug where in Py2K a unicode literal would not be accepted
as the string name of a class or other argument within
declarative using :func:`.relationship`.
2013-11-29 18:15:52 -05:00
Mike Bayer 1e7bb35fd2 - reduce verbiage in mutation.py regarding legacy style, place under versionadded 2013-11-29 16:32:24 -05:00
mike bayer c6ba175d20 Merge pull request #46 from vrajmohan/master
More fixes for cross references and reducing warnings (3rd wave)
2013-11-29 13:11:27 -08:00
Mike Bayer 6c83ef761b - New improvements to the :func:.text construct, including
more flexible ways to set up bound parameters and return types;
in particular, a :func:`.text` can now be turned into a full
FROM-object, embeddable in other statements as an alias or CTE
using the new method :meth:`.TextClause.columns`.
[ticket:2877]
2013-11-29 15:05:19 -05:00