Commit Graph

2307 Commits

Author SHA1 Message Date
Mike Bayer 29a07fc09a - Fixed bug which prevented history_meta recipe from working with
joined inheritance schemes more than one level deep.
- don't need to use _lib.py here anymore now that these features are in
sqlalchemy.testing
2013-11-07 20:35:24 -05:00
Mike Bayer 5d0e84434f - Fixed a regression introduced by the join rewriting feature of
🎫`2369` and 🎫`2587` where a nested join with one side
already an aliased select would fail to translate the ON clause on the
outside correctly; in the ORM this could be seen when using a
SELECT statement as a "secondary" table. [ticket:2858]
2013-11-01 15:24:43 -04:00
Mike Bayer 931be61267 - add a section re: using column_reflect for mapping, link to it from the "naming columns distinctly" and "column_prefix" sections since this is often what ppl are looking for. [ticket:2856] is related. 2013-10-31 15:29:45 -04:00
Mike Bayer eee219bc7e - Fixed a regression introduced by 🎫2818 where the EXISTS
query being generated would produce a "columns being replaced"
warning for a statement with two same-named columns,
as the internal SELECT wouldn't have use_labels set.
2013-10-30 10:34:31 -04:00
Mike Bayer 0b88d01127 no such thing as default_strategy()... 2013-10-28 13:54:08 -04:00
Mike Bayer 8ab39fb652 - whitespace below ..version, sigh 2013-10-28 13:48:44 -04:00
Mike Bayer 5da1c96c82 fix to the changelog system for when there's no change recs in the body 2013-10-27 18:25:47 -04:00
Mike Bayer 1e2945d26c - Fixed bug where index reflection would mis-interpret indkey values
when using the pypostgresql adapter, which returns these values
as lists vs. psycopg2's return type of string.
[ticket:2855]
2013-10-27 18:14:44 -04:00
Mike Bayer fe7322a055 - farm out everthing to do with rtd out to the sqlalchemy.org site 2013-10-27 14:43:35 -04:00
Mike Bayer 70e24eecee - more updates to compatability, C extensions, building, etc. 2013-10-26 16:57:49 -04:00
Mike Bayer 2cf9fc8fd7 - ensure 0.9 in various documentation spaces
- supporting py 2.6, update pypy version, jython not working these days
2013-10-26 16:47:42 -04:00
Mike Bayer 4ea5d303a1 - release 0.9.0b1 2013-10-26 16:35:23 -04:00
Mike Bayer aa3d591693 will call this 0.9.0b1 2013-10-26 16:15:09 -04:00
Mike Bayer 5070c81ab9 - Fixed bug where Oracle table reflection using synonyms would fail
if the synonym and the table were in different remote schemas.
Patch to fix courtesy Kyle Derr. [ticket:2853]
2013-10-25 19:11:53 -04:00
Mike Bayer 91ae63569d - catch the metadata on ScalarTest.test_scalar_proxy, this has been leaving itself
around for a long time
- association proxy now returns None for proxied scalar that is also None, rather
than raising AttributeError. [ticket:2810]
2013-10-25 17:56:53 -04:00
Mike Bayer b0cd41dd50 - changelog for [ticket:2183] 2013-10-25 17:22:40 -04:00
Mike Bayer 51e8e5df46 - Fix and test parsing of MySQL foreign key options within reflection;
this complements the work in 🎫`2183` where we begin to support
reflection of foreign key options such as ON UPDATE/ON DELETE
cascade. [ticket:2839]
2013-10-25 17:18:40 -04:00
Mike Bayer 2b1c8eabb1 - :func:.attributes.get_history() when used with a scalar column-mapped
attribute will now honor the "passive" flag
passed to it; as this defaults to ``PASSIVE_OFF``, the function will
by default query the database if the value is not present.
This is a behavioral change vs. 0.8.  [ticket:2787]
- Added new method :meth:`.AttributeState.load_history`, works like
:attr:`.AttributeState.history` but also fires loader callables.
2013-10-25 13:13:24 -04:00
Mike Bayer 3a4567a718 - add migration notes for [ticket:2838]
- have TypeDecorator use process_bind_param for literal values if no
process_literal_param is set
2013-10-24 16:13:32 -04:00
Mike Bayer f0678a6e54 clarifications 2013-10-23 20:07:48 -04:00
Mike Bayer 618f90df8e updated 2013-10-23 19:51:43 -04:00
Mike Bayer f035b6e0a4 An overhaul of expression handling for special symbols particularly
with conjunctions, e.g.
``None`` :func:`.expression.null` :func:`.expression.true`
:func:`.expression.false`, including consistency in rendering NULL
in conjunctions, "short-circuiting" of :func:`.and_` and :func:`.or_`
expressions which contain boolean constants, and rendering of
boolean constants and expressions as compared to "1" or "0" for backends
that don't feature ``true``/``false`` constants. [ticket:2804]
2013-10-23 17:44:52 -04:00
Mike Bayer 382cd56772 - The regexp used by the :func:.url.make_url function now parses
ipv6 addresses, e.g. surrounded by brackets. [ticket:2851]
2013-10-23 15:02:36 -04:00
Mike Bayer 988f79eb38 typos 2013-10-21 18:33:59 -04:00
Mike Bayer 9caa92b96f - A :func:.bindparam construct with a "null" type (e.g. no type
specified) is now copied when used in a typed expression, and the
new copy is assigned the actual type of the compared column.  Previously,
this logic would occur on the given :func:`.bindparam` in place.
Additionally, a similar process now occurs for :func:`.bindparam` constructs
passed to :meth:`.ValuesBase.values` for a :class:`.Insert` or
:class:`.Update` construct. [ticket:2850]
2013-10-21 16:49:46 -04:00
Mike Bayer 5697662416 - Fixed bug where :func:.type_coerce would not interpret ORM
elements with a ``__clause_element__()`` method properly.
[ticket:2849]
2013-10-21 15:06:41 -04:00
Mike Bayer 4663ec98b2 - The typing system now handles the task of rendering "literal bind" values,
e.g. values that are normally bound parameters but due to context must
be rendered as strings, typically within DDL constructs such as
CHECK constraints and indexes (note that "literal bind" values
become used by DDL as of 🎫`2742`).  A new method
:meth:`.TypeEngine.literal_processor` serves as the base, and
:meth:`.TypeDecorator.process_literal_param` is added to allow wrapping
of a native literal rendering method. [ticket:2838]
- enhance _get_colparams so that we can send flags like literal_binds into
INSERT statements
- add support in PG for inspecting standard_conforming_strings
- add a new series of roundtrip tests based on INSERT of literal plus SELECT
for basic literal rendering in dialect suite
2013-10-20 16:59:56 -04:00
Mike Bayer 0b0764b62b - add a type_coerce() step within Enum, Boolean to the CHECK constraint,
so that the custom type isn't exposed to an operation that is against the
"impl" type's constraint, [ticket:2842]
- this change showed up as some recursion overflow in pickling with labels,
add a __reduce__() there....pickling of expressions is less and less something
that's very viable...
2013-10-20 16:25:46 -04:00
Mike Bayer 73669c7284 - The :meth:.Table.tometadata method now produces copies of
all :attr:`.SchemaItem.info` dictionaries from all :class:`.SchemaItem`
objects within the structure including columns, constraints,
foreign keys, etc.   As these dictionaries
are copies, they are independent of the original dictionary.
Previously, only the ``.info`` dictionary of :class:`.Column` was transferred
within this operation, and it was only linked in place, not copied.
[ticket:2716]
2013-10-18 20:01:45 -04:00
Mike Bayer 7108605f69 - add a "limitations of reflection" section, [ticket:2233] 2013-10-18 19:23:40 -04:00
Mike Bayer fff9079909 - Removed a 128-character truncation from the reflection of the
server default for a column; this code was original from
PG system views which truncated the string for readability.
[ticket:2844]
2013-10-18 19:00:05 -04:00
Mike Bayer ca02882c6a - The change in 🎫2721, which is that the `deferrable` keyword
of :class:`.ForeignKeyConstraint` is silently ignored on the MySQL
backend, will be reverted as of 0.9; this keyword will now render again, raising
errors on MySQL as it is not understood - the same behavior will also
apply to the ``initially`` keyword.  In 0.8, the keywords will remain
ignored but a warning is emitted.   Additionally, the ``match`` keyword
now raises a :class:`.CompileError` on 0.9 and emits a warning on 0.8;
this keyword is not only silently ignored by MySQL but also breaks
the ON UPDATE/ON DELETE options.

To use a :class:`.ForeignKeyConstraint`
that does not render or renders differently on MySQL, use a custom
compilation option.  An example of this usage has been added to the
documentation, see :ref:`mysql_foreign_keys`.
[ticket:2721] [ticket:2839]
2013-10-18 14:44:01 -04:00
Mike Bayer a5dc173ea6 - Added support for rendering `SMALLSERIAL when a :class:.SmallInteger`
type is used on a primary key autoincrement column, based on server
version detection of Postgresql version 9.2 or greater.
[ticket:2840]
2013-10-15 19:06:21 -04:00
Mike Bayer 92534dc8f3 The MySQL :class:.mysql.SET type now features the same auto-quoting
behavior as that of :class:`.mysql.ENUM`.  Quotes are not required when
setting up the value, but quotes that are present will be auto-detected
along with a warning.  This also helps with Alembic where
the SET type doesn't render with quotes. [ticket:2817]
2013-10-14 16:12:54 -04:00
Mike Bayer 78a38967c4 The `.unique flag on :class:.Index could be produced as None`
if it was generated from a :class:`.Column` that didn't specify ``unique``
(where it defaults to ``None``).  The flag will now always be ``True`` or
``False``. [ticket:2825]
2013-10-14 14:53:28 -04:00
Mike Bayer 5e894798b6 migration guide 2013-10-13 17:16:36 -04:00
Mike Bayer ee0302161a name 2013-10-13 16:43:57 -04:00
Mike Bayer f00544a589 - Added new option to :func:.relationship `distinct_target_key`.
This enables the subquery eager loader strategy to apply a DISTINCT
to the innermost SELECT subquery, to assist in the case where
duplicate rows are generated by the innermost query which corresponds
to this relationship (there's not yet a general solution to the issue
of dupe rows within subquery eager loading, however, when joins outside
of the innermost subquery produce dupes).  When the flag
is set to ``True``, the DISTINCT is rendered unconditionally, and when
it is set to ``None``, DISTINCT is rendered if the innermost relationship
targets columns that do not comprise a full primary key.
The option defaults to False in 0.8 (e.g. off by default in all cases),
None in 0.9 (e.g. automatic by default).   Thanks to Alexander Koval
for help with this. [ticket:2836]
2013-10-13 16:42:32 -04:00
Mike Bayer 366e74b1be MySQL-connector dialect now allows options in the create_engine
query string to override those defaults set up in the connect,
including "buffered" and "raise_on_warnings".
[ticket:2515]
2013-10-13 14:09:35 -04:00
Mike Bayer a2cce1bf43 Parenthesis will be applied to a compound SQL expression as
rendered in the column list of a CREATE INDEX statement.
[ticket:2742]
2013-10-12 20:21:18 -04:00
Mike Bayer 9bc9d5c106 - Fixed bug in default compiler plus those of postgresql, mysql, and
mssql to ensure that any literal SQL expression values are
rendered directly as literals, instead of as bound parameters,
within a CREATE INDEX statement. [ticket:2742]
- don't need expression_as_ddl(); literal_binds and include_table
take care of this functionality.
2013-10-12 20:04:55 -04:00
Mike Bayer 1f1ad557af The `default argument of :class:.Column` now accepts a class
or object method as an argument, in addition to a standalone function;
will properly detect if the "context" argument is accepted or not.
2013-10-11 16:16:08 -04:00
Mike Bayer 9d38ed3340 The "name" attribute is set on :class:.Index before the "attach"
events are called, so that attachment events can be used to dynamically
generate a name for the index based on the parent table and/or
columns. [ticket:2835]
2013-10-11 15:55:57 -04:00
Mike Bayer 5f0b864ad0 - The method signature of :meth:.Dialect.reflecttable, which in
all known cases is provided by :class:`.DefaultDialect`, has been
tightened to expect ``include_columns`` and ``exclude_columns``
arguments without any kw option, reducing ambiguity - previously
``exclude_columns`` was missing. [ticket:2748]
2013-10-11 12:48:46 -04:00
Mike Bayer e74627f827 A :func:.select that is made to refer to itself in its FROM clause,
typically via in-place mutation, will raise an informative error
message rather than causing a recursion overflow.
[ticket:2815]
2013-10-08 20:06:58 -04:00
Mike Bayer 9df4651fba Fixed bug where using an annotation such as :func:.remote or
:func:`.foreign` on a :class:`.Column` before association with a parent
:class:`.Table` could produce issues related to the parent table not
rendering within joins, due to the inherent copy operation performed
by an annotation. [ticket:2813]
2013-10-08 19:47:13 -04:00
Mike Bayer 5f07d4b7ac 0.8 changelog 2013-10-08 19:25:55 -04:00
Mike Bayer f27b755129 The erroneous kw arg "schema" has been removed from the :class:.ForeignKey
object. this was an accidental commit that did nothing; a warning is raised
in 0.8.3 when this kw arg is used. [ticket:2831]
2013-10-08 19:20:09 -04:00
Mike Bayer 22d5a1e415 11th hour realization that Load() needs to do the _chop_path() thing as
well.  this probably has some bugs
2013-10-06 20:50:51 -04:00
Mike Bayer 1b25ed907f - merge ticket_1418 branch, [ticket:1418]
- The system of loader options has been entirely rearchitected to build
upon a much more comprehensive base, the :class:`.Load` object.  This
base allows any common loader option like :func:`.joinedload`,
:func:`.defer`, etc. to be used in a "chained" style for the purpose
of specifying options down a path, such as ``joinedload("foo").subqueryload("bar")``.
The new system supersedes the usage of dot-separated path names,
multiple attributes within options, and the usage of ``_all()`` options.
-  Added a new load option :func:`.orm.load_only`.  This allows a series
of column names to be specified as loading "only" those attributes,
deferring the rest.
2013-10-06 20:29:08 -04:00