summaryrefslogtreecommitdiff
path: root/test/sql/test_compiler.py
Commit message (Collapse)AuthorAgeFilesLines
* - the refactor of the visit_alias() method in Oracle revealedMike Bayer2014-12-041-1/+1
| | | | that quoting should be applied in %(name)s under with_hint.
* - Fixed issue where the columns from a SELECT embedded in anMike Bayer2014-11-111-0/+29
| | | | | | | | | INSERT, either through the values clause or as a "from select", would pollute the column types used in the result set produced by the RETURNING clause when columns from both statements shared the same name, leading to potential errors or mis-adaptation when retrieving the returning rows. fixes #3248
* - The :attr:`.Column.key` attribute is now used as the source ofMike Bayer2014-11-101-0/+13
| | | | | | | | | | | anonymous bound parameter names within expressions, to match the existing use of this value as the key when rendered in an INSERT or UPDATE statement. This allows :attr:`.Column.key` to be used as a "substitute" string to work around a difficult column name that doesn't translate well into a bound parameter name. Note that the paramstyle is configurable on :func:`.create_engine` in any case, and most DBAPIs today support a named and positional style. fixes #3245
* - ensure kwargs are passed for limit clause on a compound select as well,Mike Bayer2014-10-311-0/+16
| | | | further fixes for #3034
* - changelog, migration for pr github:134Mike Bayer2014-10-041-91/+0
|
* Merge remote-tracking branch 'origin/pr/134' into pr134Mike Bayer2014-10-041-0/+91
|\
| * allow windowing filtered functionsIlja Everilä2014-09-111-0/+27
| |
| * renamed aggregatefilter to funcfilter, since it is thatIlja Everilä2014-09-111-1/+1
| |
| * tests for <aggregate_fun> FILTER (WHERE ...)Ilja Everilä2014-09-101-0/+64
| |
* | - Added new method :meth:`.Select.with_statement_hint` and ORMMike Bayer2014-09-181-0/+17
|/ | | | | | method :meth:`.Query.with_statement_hint` to support statement-level hints that are not specific to a table. fixes #3206
* - rework the previous "order by" system in terms of the new one,Mike Bayer2014-09-081-0/+21
| | | | | | | | unify everything. - create a new layer of separation between the "from order bys" and "column order bys", so that an OVER doesn't ORDER BY a label in the same columns clause - identify another issue with polymorphic for ref #3148, match on label keys rather than the objects
* - ensure literal_binds works with LIMIT clause, FOR UPDATEMike Bayer2014-09-031-1/+1
|
* - The :func:`~.expression.column` and :func:`~.expression.table`Mike Bayer2014-09-011-14/+19
| | | | | | | | | | | | | | | | | | | | | 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-863/+968
| | | | - apply autopep8 + manual fixes to most of test/sql/
* - more tests, including backend testsMike Bayer2014-05-161-0/+53
| | | | - implement for SQL server, use window functions when simple limit/offset not available
* - Fixed bug where :meth:`.Table.update` and :meth:`.Table.delete`Mike Bayer2014-05-081-0/+9
| | | | | | | would produce an empty WHERE clause when an empty :func:`.and_()` or :func:`.or_()` or other blank expression were applied. This is now consistent with that of :func:`.select`. fixes #3045
* - Fixed bug where the combination of "limit" rendering asMike Bayer2014-04-301-0/+29
| | | | | | | | | "SELECT FIRST n ROWS" using a bound parameter (only firebird has both), combined with column-level subqueries which also feature "limit" as well as "positional" bound parameters (e.g. qmark style) would erroneously assign the subquery-level positions before that of the enclosing SELECT, thus returning parameters which are out of order. Fixes #3038
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-1/+1
| | | | Found using: https://github.com/intgr/topy
* - Adjusted the logic which applies names to the .c collection whenMike Bayer2014-02-261-2/+8
| | | | | | | | | a no-name :class:`.BindParameter` is received, e.g. via :func:`.sql.literal` or similar; the "key" of the bind param is used as the key within .c. rather than the rendered name. Since these binds have "anonymous" names in any case, this allows individual bound parameters to have their own name within a selectable if they are otherwise unlabeled. fixes #2974
* - Fixed bug where so-called "literal render" of :func:`.bindparam`Mike Bayer2014-02-051-0/+7
| | | | | | constructs would fail if the bind were constructed with a callable, rather than a direct value. This prevented ORM expressions from being rendered with the "literal_binds" compiler flag.
* - Fixed bug whereby SQLite compiler failed to propagate compiler argumentsMike Bayer2014-01-311-0/+6
| | | | | | | | | | such as "literal binds" into a CAST expression. - Fixed bug whereby binary type would fail in some cases if used with a "test" dialect, such as a DefaultDialect or other dialect with no DBAPI. - Fixed bug where "literal binds" wouldn't work with a bound parameter that's a binary type. A similar, but different, issue is fixed in 0.8.
* - conjunctions like and_() and or_() can now accept generators as arguments.Mike Bayer2014-01-051-0/+11
|
* - for [ticket:2651], leaving CheckConstraint alone, preferring to keepMike Bayer2013-12-161-1/+2
| | | | | | | | | 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.
* - The precedence rules for the :meth:`.ColumnOperators.collate` operatorMike Bayer2013-12-051-52/+0
| | | | | | | | | | | 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]
* - New improvements to the :func:`.text` construct, includingMike Bayer2013-11-291-166/+0
| | | | | | | | 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]
* - fix up rendering of "of"Mike Bayer2013-11-281-71/+7
| | | | | | - move out tests, dialect specific out of compiler, compiler tests use new API, legacy API tests in test_selecatble - add support for adaptation of ForUpdateArg, alias support in compilers
* - work in progress, will squashMike Bayer2013-11-281-0/+6
|
* An overhaul of expression handling for special symbols particularlyMike Bayer2013-10-231-15/+53
| | | | | | | | | | 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]
* - Removed some now unneeded version checks [ticket:2829] courtesy alex gaynorMike Bayer2013-09-221-4/+0
|
* forgot to add system to the copy() methodMike Bayer2013-08-251-0/+7
| | | | | Conflicts: lib/sqlalchemy/schema.py
* added "system=True" to Column, so that we generally don't have to botherMike Bayer2013-08-251-0/+9
| | | | with CreateColumn rules
* Fixed bug where the expression system relied upon the ``str()``Mike Bayer2013-07-121-0/+40
| | | | | | | | | | | | form of a some expressions when referring to the ``.c`` collection on a ``select()`` construct, but the ``str()`` form isn't available since the element relies on dialect-specific compilation constructs, notably the ``__getitem__()`` operator as used with a Postgresql ``ARRAY`` element. The fix also adds a new exception class :class:`.UnsupportedCompilationError` which is raised in those cases where a compiler is asked to compile something it doesn't know how to. Also in 0.8.3. [ticket:2780]
* - rework of correlation, continuing on #2668, #2746Mike Bayer2013-06-261-11/+99
| | | | | | | | | | | | | | | | | | | | | | | | - add support for correlations to propagate all the way in; because correlations require context now, need to make sure a select enclosure of any level takes effect any number of levels deep. - fix what we said correlate_except() was supposed to do when we first released #2668 - "the FROM clause is left intact if the correlated SELECT is not used in the context of an enclosing SELECT..." - it was not considering the "existing_froms" collection at all, and prohibited additional FROMs from being placed in an any() or has(). - add test for multilevel any() - lots of docs, including glossary entries as we really need to define "WHERE clause", "columns clause" etc. so that we can explain correlation better - based on the insight that a SELECT can correlate anything that ultimately came from an enclosing SELECT that links to this one via WHERE/columns/HAVING/ORDER BY, have the compiler keep track of the FROM lists that correspond in this way, link it to the asfrom flag, so that we send to _get_display_froms() the exact list of candidate FROMs to correlate. no longer need any asfrom logic in the Select() itself - preserve 0.8.1's behavior for correlation when no correlate options are given, not to mention 0.7 and prior's behavior of not propagating implicit correlation more than one level.. this is to reduce surprises/hard-to-debug situations when a user isn't trying to correlate anything.
* test tweakMike Bayer2013-06-031-1/+4
|
* Merge branch 'master' into ticket_1068Mike Bayer2013-06-031-10/+12
|\
| * - unicode literals need to just be handled differently if they have utf-8Mike Bayer2013-05-041-2/+3
| | | | | | | | | | encoded in them vs. unicode escaping. not worth figuring out how to combine these right now
| * - test_types, test_compiler, with sqlite at leastMike Bayer2013-04-281-1/+2
| |
| * - the raw 2to3 runMike Bayer2013-04-271-9/+9
| | | | | | | | - went through examples/ and cleaned out excess list() calls
* | magic accessors to the rescueMike Bayer2013-05-271-13/+0
| |
* | still not locating more nested expressions, may need to match on nameMike Bayer2013-05-271-11/+29
| |
* | attempt number one, doesn't detect though if the label in the order by is ↵Mike Bayer2013-05-271-0/+63
|/ | | | not directly present there.
* - reinstate insert returning back into test_insert.py; defaultdialectMike Bayer2013-04-011-4/+0
| | | | needs to be explicit here since tablestest sticks testing.db onto metadata.bind
* moving insert returning test back into CRUD test class until I figure out ↵Diana Clarke2013-03-301-0/+5
| | | | why moving it broke the oracle/postgres builds
* move the update tests from CRUDTest into sql/test_update.py (see #2630)Diana Clarke2013-03-301-103/+0
|
* move the insert tests from CRUDTest into sql/test_insert.py (see #2630)Diana Clarke2013-03-291-219/+1
|
* move the delete tests from CRUDTest into sql/test_delete.py (see #2630)Diana Clarke2013-03-291-46/+1
|
* merge plus fix the test spelling tooMike Bayer2013-03-181-2/+2
|
* - since correlation is now always at least semi-automatic, remove theMike Bayer2013-03-091-33/+241
| | | | | | ability for correlation to have any effect for a SELECT that's stated in the FROM. - add a new exhaustive test suite for correlation to test_compiler
* Changed behavior of Select.correlate() to ignore correlations to froms that ↵Luke Cyca2013-03-071-2/+6
| | | | don't exist in the superquery.
* #2629Mike Bayer2013-01-251-0/+8
| | | | | insert().returning() raises an informative CompileError if attempted to compile on a dialect that doesn't support RETURNING.