summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* - Fixed bug in single table inheritance where a chain of joinsMike Bayer2014-10-231-0/+59
| | | | | | | | | | | | 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-0/+25
| | | | | | | 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-0/+36
| | | | | - 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-0/+44
|\
| * add simple tests for new name argument for Table.tometadata()pr/139ndparker2014-10-041-0/+44
| |
* | Merge remote-tracking branch 'origin/pr/137' into pr137Mike Bayer2014-10-211-0/+8
|\ \
| * | add failing testjona2014-09-121-0/+8
| | |
* | | - Reversing a change that was made in 0.9, the "singleton" natureMike Bayer2014-10-191-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-191-1/+49
| | | | | | | | | | | | | | | | | | | | | 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
* | | - control the module name of the exception here for py3k compatMike Bayer2014-10-191-7/+14
| | |
* | | - A warning is emitted in the case of multiple relationships thatticket_3230Mike Bayer2014-10-193-21/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | - flake8Mike Bayer2014-10-181-919/+1097
| | |
* | | - Exception messages have been spiffed up a bit. The SQL statementMike Bayer2014-10-174-23/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | pep8Mike Bayer2014-10-171-38/+54
| | |
* | | - The :meth:`.Query.update` method will now convert string keyMike Bayer2014-10-161-11/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | - fix importsMike Bayer2014-10-161-21/+24
| | | | | | | | | | | | - pep8
* | | - Improvements to the mechanism used by :class:`.Session` to locateMike Bayer2014-10-142-7/+228
| | | | | | | | | | | | | | | | | | | | | "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
* | | - move BindTest into orm/test_bindsMike Bayer2014-10-142-193/+194
| | |
* | | - The ``__module__`` attribute is now set for all those SQL andMike Bayer2014-10-141-1/+38
| | | | | | | | | | | | | | | | | | | | | 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
* | | - additional issues fixed in mysqlconnector 2.0.1Mike Bayer2014-10-131-15/+0
| | |
* | | - this test passes now in more recent mysqlconnectorMike Bayer2014-10-131-4/+2
| | |
* | | - Mysqlconnector as of version 2.0, probably as a side effect ofMike Bayer2014-10-123-96/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+1
| | | | | | | | | | | | take that out, restore the better exception logic in exc
* | | - Fixed long-standing bug in Oracle dialect where bound parameterMike Bayer2014-10-111-0/+22
| | | | | | | | | | | | | | | | | | names that started with numbers would not be quoted, as Oracle doesn't like numerics in bound parameter names. fixes #2138
* | | - :meth:`.Insert.from_select` now includes Python and SQL-expressionMike Bayer2014-10-102-2/+145
| | | | | | | | | | | | | | | | | | | | | 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.
* | | - The ON clause rendered when using :meth:`.Query.join`,Mike Bayer2014-10-091-2/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :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-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | - adjustment for ref #3200 as we need an immutabledict() here soMike Bayer2014-10-071-0/+12
| | | | | | | | | | | | | | | 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-0/+29
| | | | | | | | | | | | | | | | | | 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/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :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-042-42/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-042-2/+66
|\ \ \ | | | | | | | | | | | | https://bitbucket.org/jerdfelt/sqlalchemy into pr30
| * | | Reflect unique constraints when reflecting a Table objectJohannes Erdfelt2014-09-172-2/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-92/+111
| | | |
* | | | Merge remote-tracking branch 'origin/pr/134' into pr134Mike Bayer2014-10-042-0/+96
|\ \ \ \
| * | | | allow windowing filtered functionsIlja Everilä2014-09-111-0/+27
| | | | |
| * | | | renamed aggregatefilter to funcfilter, since it is thatIlja Everilä2014-09-112-2/+2
| | | | |
| * | | | add ClauseTest for aggregatefilterIlja Everilä2014-09-101-0/+5
| | | | |
| * | | | tests for <aggregate_fun> FILTER (WHERE ...)Ilja Everilä2014-09-101-0/+64
| | | | |
* | | | | - rework tests for attached databases into individual tests,Mike Bayer2014-09-291-36/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | - repair autorollback for branchesMike Bayer2014-09-261-0/+12
| | | | |
* | | | | - Fixed bug where a "branched" connection, that is the kind you getMike Bayer2014-09-263-10/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when you call :meth:`.Connection.connect`, would not share transaction status with the parent. The architecture of branching has been tweaked a bit so that the branched connection defers to the parent for all transactional status and operations. fixes #3190
* | | | | - Fixed bug where a "branched" connection, that is the kind you getMike Bayer2014-09-261-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when you call :meth:`.Connection.connect`, would not share invalidation status with the parent. The architecture of branching has been tweaked a bit so that the branched connection defers to the parent for all invalidation status and operations. fixes #3215
* | | | | - "column already assigned" message has been updated in 7f82c55fMike Bayer2014-09-251-1/+1
| | | | |
* | | | | - refactor of declarative, break up into indiviudal methodsMike Bayer2014-09-252-5/+281
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that are now affixed to _MapperConfig - declarative now creates column copies ahead of time so that they are ready to go for a declared_attr - overhaul of declared_attr; memoization, cascading modifier - A relationship set up with :class:`.declared_attr` on a :class:`.AbstractConcreteBase` base class will now be configured on the abstract base mapping automatically, in addition to being set up on descendant concrete classes as usual. fixes #2670 - The :class:`.declared_attr` construct has newly improved behaviors and features in conjunction with declarative. The decorated function will now have access to the final column copies present on the local mixin when invoked, and will also be invoked exactly once for each mapped class, the returned result being memoized. A new modifier :attr:`.declared_attr.cascading` is added as well. fixes #3150 - the original plan for #3150 has been scaled back; by copying mixin columns up front and memoizing, we don't actually need the "map properties later" thing. - full docs + migration notes
* | | | - flake8 all of test/ext/declarativeMike Bayer2014-09-235-427/+543
| | | |
* | | | - The :mod:`sqlalchemy.ext.automap` extension will now setMike Bayer2014-09-221-1/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``cascade="all, delete-orphan"`` automatically on a one-to-many relationship/backref where the foreign key is detected as containing one or more non-nullable columns. This argument is present in the keywords passed to :func:`.automap.generate_relationship` in this case and can still be overridden. Additionally, if the :class:`.ForeignKeyConstraint` specifies ``ondelete="CASCADE"`` for a non-nullable or ``ondelete="SET NULL"`` for a nullable set of columns, the argument ``passive_deletes=True`` is also added to the relationship. Note that not all backends support reflection of ondelete, but backends that do include Postgresql and MySQL. fixes #3210
* | | | pep8/flake8Mike Bayer2014-09-221-42/+59
| | | |
* | | | - these tests don't test anything in SQLAlchemy - from our perpsective,Mike Bayer2014-09-191-133/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | we need to be in transactions (tested elsewhere) and we need to emit the correct FOR UPDATE strings (tested elsewhere). There's nothing in SQLA to be tested as far as validating that for update causes exceptions or not, and these tests frequently fail as they are timing sensitive.
* | | | - Fixed bug that affected generally the same classes of eventMike Bayer2014-09-184-23/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as that of :ticket:`3199`, when the ``named=True`` parameter would be used. Some events would fail to register, and others would not invoke the event arguments correctly, generally in the case of when an event was "wrapped" for adaption in some other way. The "named" mechanics have been rearranged to not interfere with the argument signature expected by internal wrapper functions. fixes #3197