summaryrefslogtreecommitdiff
path: root/test/sql/test_generative.py
Commit message (Collapse)AuthorAgeFilesLines
* Repair WithinGroup.get_children()Mike Bayer2017-06-161-0/+10
| | | | | | | | Fixed AttributeError which would occur in :class:`.WithinGroup` construct during an iteration of the structure. Change-Id: I563882d93c8c32292463a605b636aa60c77e9406 Fixes: #4012
* Make all tests to be PEP8 compliantKhairi Hafsham2017-02-071-27/+35
| | | | | | | | tested using pycodestyle version 2.2.0 Fixes: #3885 Change-Id: I5df43adc3aefe318f9eeab72a078247a548ec566 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/343
* Spelling fixesVille Skyttä2016-10-081-2/+2
|
* Ensure CTE internals are handled during cloneMike Bayer2016-06-101-0/+17
| | | | | | | | | The CTE construct was missing a _copy_internals() method which would handle CTE-specific structures including _cte_alias, _restates during a clone operation. Change-Id: I9aeac9cd24d8f7ae6b70e52650d61f7c96cb6d7e Fixes: #3722
* - Fixed a bug where clause adaption as applied to a :class:`.Label`Mike Bayer2015-06-091-0/+21
| | | | | | | | | | | | object would fail to accommodate the labeled SQL expression in all cases, such that any SQL operation that made use of :meth:`.Label.self_group` would use the original unadapted expression. One effect of this would be that an ORM :func:`.aliased` construct would not fully accommodate attributes mapped by :obj:`.column_property`, such that the un-aliased table could leak out when the property were used in some kinds of SQL comparisons. fixes #3445
* PEP8 cleanup in /test/sqlEric Streeper2015-03-181-2/+0
|
* - Fixed bug regarding expression mutations which could expressMike Bayer2014-11-051-0/+13
| | | | | | | | itself as a "Could not locate column" error when using :class:`.Query` to select from multiple, anonymous column entities when querying against SQLite, as a side effect of the "join rewriting" feature used by the SQLite dialect. fixes #3241
* renamed aggregatefilter to funcfilter, since it is thatIlja Everilä2014-09-111-1/+1
|
* add ClauseTest for aggregatefilterIlja Everilä2014-09-101-0/+5
|
* - rework ColumnAdapter and ORMAdapter to only provide the featuresticket_3148Mike Bayer2014-09-071-2/+262
| | | | | | | | | | | we're now using; rework them fully so that their behavioral contract is consistent regarding adapter.traverse() vs. adapter.columns[], add a full suite of tests including advanced wrapping scenarios previously only covered by test/orm/test_froms.py and test/orm/inheritance/test_relationships.py - identify several cases where label._order_by_label_clause would be corrupted, e.g. due to adaption or annotation separately - add full tests for #3148
* - enhance ClauseAdapter / ColumnAdapter to have new behaviors with labels.Mike Bayer2014-09-071-0/+46
| | | | | | | | | | | | | | | | | | | | | The "anonymize label" logic is now generalized to ClauseAdapter, and takes place when the anonymize_labels flag is sent, taking effect for all .columns lookups as well as within traverse() calls against the label directly. - traverse() will also memoize what it gets in columns, so that calling upon traverse() / .columns against the same Label will produce the same anonymized label. This is so that AliasedClass produces the same anonymized label when it is accessed per-column (e.g. SomeAlias.some_column) as well as when it is applied to a Query, and within column loader strategies (e.g. query(SomeAlias)); the former uses traverse() while the latter uses .columns - AliasedClass now calls onto ColumnAdapter - Query also makes sure to use that same ColumnAdapter from the AliasedClass in all cases - update the logic from 0.9 in #1068 to make use of the same _label_resolve_dict we use for #2992, simplifying how that works and adding support for new scenarios that were pretty broken (see #3148, #3188)
* - The :func:`~.expression.column` and :func:`~.expression.table`Mike Bayer2014-09-011-22/+22
| | | | | | | | | | | | | | | | | | | | | constructs are now importable from the "from sqlalchemy" namespace, just like every other Core construct. - The implicit conversion of strings to :func:`.text` constructs when passed to most builder methods of :func:`.select` as well as :class:`.Query` now emits a warning with just the plain string sent. The textual conversion still proceeds normally, however. The only method that accepts a string without a warning are the "label reference" methods like order_by(), group_by(); these functions will now at compile time attempt to resolve a single string argument to a column or label expression present in the selectable; if none is located, the expression still renders, but you get the warning again. The rationale here is that the implicit conversion from string to text is more unexpected than not these days, and it is better that the user send more direction to the Core / ORM when passing a raw string as to what direction should be taken. Core/ORM tutorials have been updated to go more in depth as to how text is handled. fixes #2992
* - update the flake8 rules againMike Bayer2014-07-181-226/+294
| | | | - apply autopep8 + manual fixes to most of test/sql/
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-1/+1
| | | | Found using: https://github.com/intgr/topy
* - New improvements to the :func:`.text` construct, includingMike Bayer2013-11-291-3/+3
| | | | | | | | 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]
* - the raw 2to3 runMike Bayer2013-04-271-8/+8
| | | | - went through examples/ and cleaned out excess list() calls
* - the base correlate tests in test_compiler cover the ones that were hereMike Bayer2013-03-091-127/+79
| | | | | for now - fix up adaptation tests to still try to exercise the correlation argument
* go back to the original form, then break out this test into individualsMike Bayer2013-03-081-53/+115
| | | | so it can be managed more easily
* Changed behavior of Select.correlate() to ignore correlations to froms that ↵Luke Cyca2013-03-071-40/+47
| | | | don't exist in the superquery.
* - multivalued inserts, [ticket:2623]Mike Bayer2012-12-081-4/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - update "not supported" messages for empty inserts, mutlivalue inserts - rework the ValuesBase approach for multiple value sets so that stmt.parameters does store a list for multiple values; the _has_multiple_parameters flag now indicates which of the two modes the statement is within. it now raises exceptions if a subsequent call to values() attempts to call a ValuesBase with one mode in the style of the other mode; that is, you can't switch a single- or multi- valued ValuesBase to the other mode, and also if a multiple value is passed simultaneously with a kwargs set. Added tests for these error conditions - Calling values() multiple times in multivalue mode now extends the parameter list to include the new parameter sets. - add error/test if multiple *args were passed to ValuesBase.values() - rework the compiler approach for multivalue inserts, back to where _get_colparams() returns the same list of (column, value) as before, thereby maintaining the identical number of append() and other calls when multivalue is not enabled. In the case of multivalue, it makes a last-minute switch to return a list of lists instead of the single list. As it constructs the additional lists, the inline defaults and other calculated default parameters of the first parameter set are copied into the newly generated lists so that these features continue to function for a multivalue insert. Multivalue inserts now add no additional function calls to the compilation for regular insert constructs. - parameter lists for multivalue inserts now includes an integer index for all parameter sets. - add detailed documentation for ValuesBase.values(), including careful wording to describe the difference between multiple values and an executemany() call. - add a test for multivalue insert + returning - it works ! - remove the very old/never used "postgresql_returning"/"firebird_returning" flags.
* - get 100% lint/pep8 happening for test_compiler; next we will beginMike Bayer2012-10-241-31/+28
| | | | | | cutting up tests and removing old ones - move test_in() to test_operators - slice up migrated operator tests into TOT
* The auto-correlation feature of :func:`.select`, andMike Bayer2012-10-221-26/+45
| | | | | | | | | by proxy that of :class:`.orm.Query`, will not take effect for a SELECT statement that is being rendered directly in the FROM list of the enclosing SELECT. Correlation in SQL only applies to column expressions such as those in the WHERE, ORDER BY, columns clause. [ticket:2595]
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-271-3/+6
| | | | | | | become an externally usable package but still remains within the main sqlalchemy parent package. in this system, we use kind of an ugly hack to get the noseplugin imported outside of the "sqlalchemy" package, while still making it available within sqlalchemy for usage by third party libraries.
* -whitespace bonanza, contdMike Bayer2012-07-281-32/+32
|
* - merged #1401 branch from bitbucketMike Bayer2012-04-221-1/+97
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - resolved some serious speed hits I missed, we need to ensure only deannotated columns are used in the local/remote collections and soforth so that hash lookups against mapped columns don't dig into __eq__() - fix some other parity mismatches regarding stuff from [ticket:2453], including finding another case where _deep_annotate() was doing the wrong thing, new tests. - [feature] Major rewrite of relationship() internals now allow join conditions which include columns pointing to themselves within composite foreign keys. A new API for very specialized primaryjoin conditions is added, allowing conditions based on SQL functions, CAST, etc. to be handled by placing the annotation functions remote() and foreign() inline within the expression when necessary. Previous recipes using the semi-private _local_remote_pairs approach can be upgraded to this new approach. [ticket:1401]
| * tweak for correlated subqueries here, seems to work for ↵Mike Bayer2012-02-101-0/+12
| | | | | | | | test_eager_relations:CorrelatedSubqueryTest but need some more testing here
| * - got m2m, local_remote_pairs, etc. workingMike Bayer2012-02-091-1/+85
| | | | | | | | | | | | | | | | - using new traversal that returns the product of both sides of a binary, starting to work with (a+b) == (c+d) types of joins. primaryjoins on functions working - annotations working, including reversing local/remote when doing backref
* | - expand the check to determine if a selectable column is embeddedMike Bayer2012-02-291-2/+80
|/ | | | | | | | | | in the corresponding selectable to take into account clones of the target column. fixes [ticket:2419] - have _make_proxy() copy out the _is_clone_of attribute on the new column so that even more corresponding_column() checks work as expected for cloned elements. - add a new test fixture so that mapped tests can be specified using declarative.
* - rewrite cloned_traverse() and replacement_traverse() to use a straightMike Bayer2011-07-241-1/+12
| | | | | | | | | | | | | | | | recursive descent with clone() + _copy_internals(). This is essentially what it was doing anyway with lots of unnecessary steps. Fix Alias() to honor the given clone() function which may have been the reason the traversal hadn't been fixed sooner. Alias._copy_internals() will specifically skip an alias of a Table as a more specific form of what it was doing before. This may need to be further improved such that ClauseAdapter or replacement_traverse() send it some specific hints what not to dig into; **kw has been added to all _copy_internals() to support this. replacement/clone traversal is at least clear now. - apply new no_replacement_traverse annotation to join created by _create_joins(), fixes [ticket:2195] - can replace orm.query "_halt_adapt" with "no_replacement_traverse"
* - move documentation of available execution options to Connection - this is ↵Mike Bayer2011-04-171-2/+14
| | | | | | | | | | the main place these should be used - Executable disallows "compiled_cache" option for now which was previously being ignored [ticket:2131] - Query now passes execution options to the Connection rather than the statement so that all options are allowed including compiled cache.
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-6/+6
| | | | | | | classes to a new test.lib.fixtures module - move testing.TestBase to test.lib.fixtures - massive search and replace
* make it more explicit in tests which dialect we want to use for thingsMike Bayer2011-02-111-0/+10
|
* fix some really egregious long linesMike Bayer2011-02-101-206/+437
|
* - Added over() function, method to FunctionElementMike Bayer2011-02-101-0/+5
| | | | | | | | classes, produces the _Over() construct which in turn generates "window functions", i.e. "<window function> OVER (PARTITION BY <partition by>, ORDER BY <order by>)". [ticket:1844]
* - whitespace removal bonanzaMike Bayer2011-01-021-55/+55
|
* - sqlalchemy.test and nose plugin moves back to being entirelyMike Bayer2010-11-281-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | outside of "sqlalchemy" and under "test/". Rationale: - coverage plugin works without issue, without need for an awkward additional package install - command line for "nosetests" isn't polluted with SQLAlchemy options [ticket:1949]
| * - move sqlalchemy.test to test.libMike Bayer2010-11-151-2/+2
| |
* | - move LIMIT/OFFSET rendering to be as bind parameters, for all backendsMike Bayer2010-08-291-5/+10
|/ | | | | | | | | | which support it. This includes SQLite, MySQL, Postgresql, Firebird, Oracle (already used binds with ROW NUMBER OVER), MSSQL (when ROW NUMBER is used, not TOP). Not included are Informix, Sybase, MaxDB, Access [ticket:805] - LIMIT/OFFSET parameters need to stay as literals within SQL constructs. This because they may not be renderable as binds on some backends.
* - Fixed bug in Query whereby the usage of aliased() constructsMike Bayer2010-03-231-0/+25
| | | | | | would fail if the underlying table (but not the actual alias) were referenced inside the subquery generated by q.from_self() or q.select_from().
* - fixed internal error which would occur if calling has()Mike Bayer2010-03-111-0/+5
| | | | | or similar complex expression on a single-table inheritance relation(). [ticket:1731]
* not ready to put execution_options in the text()/select() constructors yetMike Bayer2010-01-241-3/+5
|
* statement_options -> execution_optionsMike Bayer2010-01-171-18/+18
|
* - added "statement_options()" to Query, to so options can beMike Bayer2010-01-161-0/+21
| | | | | | | | | | | | | | | | | | | | | passed to the resulting statement. Currently only Select-statements have these options, and the only option used is "stream_results", and the only dialect which knows "stream_results" is psycopg2. - Query.yield_per() will set the "stream_results" statement option automatically. - Added "statement_options()" to Selects, which set statement specific options. These enable e.g. dialect specific options such as whether to enable using server side cursors, etc. - The psycopg2 now respects the statement option "stream_results". This option overrides the connection setting "server_side_cursors". If true, server side cursors will be used for the statement. If false, they will not be used, even if "server_side_cursors" is true on the connection. [ticket:1619] - added a "frozendict" from http://code.activestate.com/recipes/414283/, adding more default collections as immutable class vars on Query, Insert, Select
* - Fixed bug preventing alias() of an alias() from beingMike Bayer2009-12-181-0/+5
| | | | | cloned or adapted (occurs frequently in ORM operations). [ticket:1641]
* merge from branches/clauseelement-nonzeroPhilip Jenvey2009-09-241-2/+2
| | | | | | adds a __nonzero__ to _BinaryExpression to avoid faulty comparisons during hash collisions (which only occur on Jython) fixes #1547
* - Fixed a bug in extract() introduced in 0.5.4 wherebyMike Bayer2009-07-171-1/+11
| | | | | | the string "field" argument was getting treated as a ClauseElement, causing various errors within more complex SQL transformations.
* - unit tests have been migrated from unittest to nose.Mike Bayer2009-06-101-0/+818
See README.unittests for information on how to run the tests. [ticket:970]