summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
Commit message (Collapse)AuthorAgeFilesLines
* Psycopg2 JSONB support.pr/145Mateusz Susik2014-10-241-2/+14
|
* - Fixed bug in single table inheritance where a chain of joinsMike Bayer2014-10-231-4/+2
| | | | | | | | | | | | that included the same single inh entity more than once (normally this should raise an error) could, in some cases depending on what was being joined "from", implicitly alias the second case of the single inh entity, producing a query that "worked". But as this implicit aliasing is not intended in the case of single table inheritance, it didn't really "work" fully and was very misleading, since it wouldn't always appear. fixes #3233
* - Fixed bug where the ON clause for :meth:`.Query.join`,Mike Bayer2014-10-231-2/+5
| | | | | | | and :meth:`.Query.outerjoin` to a single-inheritance subclass using ``of_type()`` would not render the "single table criteria" in the ON clause if the ``from_joinpoint=True`` flag were set. fixes #3232
* - changelog for pullreq github:139Mike Bayer2014-10-211-4/+22
| | | | | - add support for self-referential foreign keys to move over as well when the table name is changed.
* Merge remote-tracking branch 'origin/pr/139' into pr139Mike Bayer2014-10-211-4/+7
|\
| * allow Table.tometadata changing the table namendparker2014-09-231-4/+7
| |
* | Merge remote-tracking branch 'origin/pr/137' into pr137Mike Bayer2014-10-211-7/+12
|\ \
| * | change functionspr/137jona2014-09-161-7/+12
| | |
* | | - Reversing a change that was made in 0.9, the "singleton" natureMike Bayer2014-10-192-17/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | of the "constants" :func:`.null`, :func:`.true`, and :func:`.false` has been reverted. These functions returning a "singleton" object had the effect that different instances would be treated as the same regardless of lexical use, which in particular would impact the rendering of the columns clause of a SELECT statement. fixes #3170
* | | - Fixed bug where :meth:`.Session.expunge` would not fully detachMike Bayer2014-10-192-5/+18
| | | | | | | | | | | | | | | | | | | | | the given object if the object had been subject to a delete operation that was flushed, but not committed. This would also affect related operations like :func:`.make_transient`. fixes #3139
* | | - for #3230, scale back the check to only look at columns thatMike Bayer2014-10-191-15/+20
| | | | | | | | | | | | | | | | | | | | | already have more than one ForeignKeyConstraint referring to them. This limits the check to what we hope is the most common case, but we benefit that the memory and config-time impact is scaled back dramatically.
* | | - A warning is emitted in the case of multiple relationships thatticket_3230Mike Bayer2014-10-191-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ultimately will populate a foreign key column in conflict with another, where the relationships are attempting to copy values from different source columns. This occurs in the case where composite foreign keys with overlapping columns are mapped to relationships that each refer to a different referenced column. A new documentation section illustrates the example as well as how to overcome the issue by specifying "foreign" columns specifically on a per-relationship basis. fixes #3230
* | | - Exception messages have been spiffed up a bit. The SQL statementMike Bayer2014-10-171-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and parameters are not displayed if None, reducing confusion for error messages that weren't related to a statement. The full module and classname for the DBAPI-level exception is displayed, making it clear that this is a wrapped DBAPI exception. The statement and parameters themselves are bounded within a bracketed sections to better isolate them from the error message and from each other. fixes #3172
* | | - The :meth:`.Query.update` method will now convert string keyMike Bayer2014-10-162-13/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | names in the given dictionary of values into mapped attribute names against the mapped class being updated. Previously, string names were taken in directly and passed to the core update statement without any means to resolve against the mapped entity. Support for synonyms and hybrid attributes as the subject attributes of :meth:`.Query.update` are also supported. fixes #3228
* | | Fixed typopr/142mozillazg2014-10-151-2/+2
| | |
* | | - Improvements to the mechanism used by :class:`.Session` to locateMike Bayer2014-10-141-43/+53
| | | | | | | | | | | | | | | | | | | | | "binds" (e.g. engines to use), such engines can be associated with mixin classes, concrete subclasses, as well as a wider variety of table metadata such as joined inheritance tables. fixes #3035
* | | - The ``__module__`` attribute is now set for all those SQL andMike Bayer2014-10-141-1/+3
| | | | | | | | | | | | | | | | | | | | | ORM functions that are derived as "public factory" symbols, which should assist with documentation tools being able to report on the target module. fixes #3218
* | | - Mysqlconnector as of version 2.0, probably as a side effect ofMike Bayer2014-10-121-6/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the python 3 merge, now does not expect percent signs (e.g. as used as the modulus operator and others) to be doubled, even when using the "pyformat" bound parameter format (this change is not documented by Mysqlconnector). The dialect now checks for py2k and for mysqlconnector less than version 2.0 when detecting if the modulus operator should be rendered as ``%%`` or ``%``. - Unicode SQL is now passed for MySQLconnector version 2.0 and above; for Py2k and MySQL < 2.0, strings are encoded. Note that mysqlconnector as of 2.0.1 appears to have a bug with unicode DDL on py2k, so the tests here are skipping until we observe it's fixed. - take out profiling on mysqlconnector, callcounts vary too much with its current development speed
* | | - the test_except test was doing an unnecessary workaround of some kind,Mike Bayer2014-10-121-7/+3
| | | | | | | | | | | | take that out, restore the better exception logic in exc
* | | - roll back part of pr 140 to get exception wrapping working againMike Bayer2014-10-121-3/+7
| | |
* | | Merge remote-tracking branch 'origin/pr/140' into pr140Mike Bayer2014-10-1113-39/+29
|\ \ \
| * | | cleanup exception handling - use new exception hierarchy (since python 2.5)pr/140ndparker2014-10-0211-61/+21
| | | |
| * | | improve exception vs. exit handlingndparker2014-09-2311-8/+38
| | |/ | |/|
* | | add more order by hereMike Bayer2014-10-111-1/+1
| | |
* | | - embedding an existing predicate into a new one onlyMike Bayer2014-10-111-2/+1
| | | | | | | | | | | | | | | | | | seems to be used by test_oracle->test_coerce_to_unicode(). The predicate here should treat as a lambda based on enabled_for_config. not sure why this test is not failing on jenkins
* | | - Fixed long-standing bug in Oracle dialect where bound parameterMike Bayer2014-10-111-1/+2
| | | | | | | | | | | | | | | | | | names that started with numbers would not be quoted, as Oracle doesn't like numerics in bound parameter names. fixes #2138
* | | - change this literal so that the bound name doesn't have a numericMike Bayer2014-10-111-2/+2
| | | | | | | | | | | | name, this is sort of a bug for oracle
* | | - :meth:`.Insert.from_select` now includes Python and SQL-expressionMike Bayer2014-10-104-30/+132
| | | | | | | | | | | | | | | | | | | | | defaults if otherwise unspecified; the limitation where non- server column defaults aren't included in an INSERT FROM SELECT is now lifted and these expressions are rendered as constants into the SELECT statement.
* | | - apply patches to correct for + sign in with_hint() docs,Mike Bayer2014-10-101-3/+2
| | | | | | | | | | | | fixes #3036
* | | - The ON clause rendered when using :meth:`.Query.join`,Mike Bayer2014-10-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :meth:`.Query.outerjoin`, or the standalone :func:`.orm.join` / :func:`.orm.outerjoin` functions to a single-inheritance subclass will now include the "single table criteria" in the ON clause even if the ON clause is otherwise hand-rolled; it is now added to the criteria using AND, the same way as if joining to a single-table target using relationship or similar. fixes #3222
* | | - Fixed bug where a fair number of SQL elements withinMike Bayer2014-10-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | the sql package would fail to ``__repr__()`` successfully, due to a missing ``description`` attribute that would then invoke a recursion overflow when an internal AttributeError would then re-invoke ``__repr__()``. fixes #3195
* | | - clean up unicode docs and clarify that client_encodingMike Bayer2014-10-071-13/+53
| | | | | | | | | | | | | | | at the engine level is not the same thing as at the connect args level.
* | | - adjustment for ref #3200 as we need an immutabledict() here soMike Bayer2014-10-071-1/+1
| | | | | | | | | | | | | | | that union() can be called, in the case of a dialect that uses execution options inside of initialize() (e.g. oursql)
* | | - Fixed "'NoneType' object has no attribute 'concrete'" errorMike Bayer2014-10-061-1/+1
| | | | | | | | | | | | | | | | | | when using :class:`.AbstractConcreteBase` in conjunction with a subclass that declares ``__abstract__``. fixes #3185
* | | - The execution options passed to an :class:`.Engine` either viaMike Bayer2014-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :paramref:`.create_engine.execution_options` or :meth:`.Engine.update_execution_options` are not passed to the special :class:`.Connection` used to initialize the dialect within the "first connect" event; dialects will usually perform their own queries in this phase, and none of the current available options should be applied here. In particular, the "autocommit" option was causing an attempt to autocommit within this initial connect which would fail with an AttributeError due to the non-standard state of the :class:`.Connection`. fixes #3200
* | | - use provide_metadata for new unique constraint / index testsMike Bayer2014-10-043-13/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add a test for PG reflection of unique index without any unique constraint - for PG, don't include 'duplicates_constraint' in the entry if the index does not actually mirror a constraint - use a distinct method for unique constraint reflection within table - catch unique constraint not implemented condition; this may be within some dialects and also is expected to be supported by Alembic tests - migration + changelogs for #3184 - add individual doc notes as well to MySQL, Postgreql fixes #3184
* | | Merge branch 'reflect-unique-constraints' of ↵Mike Bayer2014-10-044-10/+58
|\ \ \ | | | | | | | | | | | | https://bitbucket.org/jerdfelt/sqlalchemy into pr30
| * | | Reflect unique constraints when reflecting a Table objectJohannes Erdfelt2014-09-174-10/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to reflect a table did not create any UniqueConstraint objects. The reflection core made no calls to get_unique_constraints and as a result, the sqlite dialect would never reflect any unique constraints. MySQL transparently converts unique constraints into unique indexes, but SQLAlchemy would reflect those as an Index object and as a UniqueConstraint. The reflection core will now deduplicate the unique constraints. PostgreSQL would reflect unique constraints as an Index object and as a UniqueConstraint object. The reflection core will now deduplicate the unique indexes.
* | | | - changelog, migration for pr github:134Mike Bayer2014-10-042-1/+37
| | | |
* | | | Merge remote-tracking branch 'origin/pr/134' into pr134Mike Bayer2014-10-046-2/+119
|\ \ \ \
| * | | | method documentation typo fixpr/134Ilja Everilä2014-09-111-1/+1
| | | | |
| * | | | documentation indentation fixIlja Everilä2014-09-111-2/+2
| | | | |
| * | | | allow windowing filtered functionsIlja Everilä2014-09-111-0/+20
| | | | |
| * | | | renamed aggregatefilter to funcfilter, since it is thatIlja Everilä2014-09-116-24/+24
| | | | |
| * | | | implementation for <aggregate_fun> FILTER (WHERE ...)Ilja Everilä2014-09-106-2/+99
| | | | |
* | | | | - rework tests for attached databases into individual tests,Mike Bayer2014-09-291-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test both memory and file-based - When selecting from a UNION using an attached database file, the pysqlite driver reports column names in cursor.description as 'dbname.tablename.colname', instead of 'tablename.colname' as it normally does for a UNION (note that it's supposed to just be 'colname' for both, but we work around it). The column translation logic here has been adjusted to retrieve the rightmost token, rather than the second token, so it works in both cases. Workaround courtesy Tony Roberts. fixes #3211
* | | | | - A revisit to this issue first patched in 0.9.5, apparentlyMike Bayer2014-09-291-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | psycopg2's ``.closed`` accessor is not as reliable as we assumed, so we have added an explicit check for the exception messages "SSL SYSCALL error: Bad file descriptor" and "SSL SYSCALL error: EOF detected" when detecting an is-disconnect scenario. We will continue to consult psycopg2's connection.closed as a first check. fixes #3021
* | | | | - cyclomatic complexity; break up visit_select, goes from F to DMike Bayer2014-09-271-52/+69
| | | | |
* | | | | - cyclomatic complexity: _get_colparams() becomes sql.crud._get_crud_params,Mike Bayer2014-09-272-421/+511
| | | | | | | | | | | | | | | | | | | | CC goes from F to D
* | | | | - cyclomatic complexity: _join_condition goes from E to a BMike Bayer2014-09-271-43/+54
| | | | |