summaryrefslogtreecommitdiff
path: root/test/sql/select.py
Commit message (Collapse)AuthorAgeFilesLines
* - unit tests have been migrated from unittest to nose.Mike Bayer2009-06-101-1552/+0
| | | | | See README.unittests for information on how to run the tests. [ticket:970]
* - sqlMike Bayer2009-05-291-1/+15
| | | | | | | | | | | | | | | | - Removed an obscure feature of execute() (including connection, engine, Session) whereby a bindparam() construct can be sent as a key to the params dictionary. This usage is undocumented and is at the core of an issue whereby the bindparam() object created implicitly by a text() construct may have the same hash value as a string placed in the params dictionary and may result in an inappropriate match when computing the final bind parameters. Internal checks for this condition would add significant latency to the critical task of parameter rendering, so the behavior is removed. This is a backwards incompatible change for any application that may have been using this feature, however the feature has never been documented.
* extract() is now dialect-sensitive and supports SQLite and others.Jason Kirtland2009-03-301-6/+0
|
* - Lazy loader will not use get() if the "lazy load"Mike Bayer2009-03-291-0/+1
| | | | | | | | | SQL clause matches the clause used by get(), but contains some parameters hardcoded. Previously the lazy strategy would fail with the get(). Ideally get() would be used with the hardcoded parameters but this would require further development. [ticket:1357]
* - An alias() of a select() will convert to a "scalar subquery"Mike Bayer2009-03-211-0/+6
| | | | | | when used in an unambiguously scalar context, i.e. it's used in a comparison operation. This applies to the ORM when using query.subquery() as well.
* - Fixed missing _label attribute on Function object, othersMike Bayer2009-02-011-0/+24
| | | | | when used in a select() with use_labels (such as when used in an ORM column_property()). [ticket:1302]
* - _CalculatedClause is goneMike Bayer2009-01-281-10/+22
| | | | | | | | - Function rolls the various standalone execution functionality of CC into itself, accesses its internal state more directly - collate just uses _BinaryExpression, don't know why it didn't do this already - added new _Case construct, compiles directly - the world is a happier place
* - Improved the methodology to handling percent signs in columnMike Bayer2009-01-141-4/+4
| | | | | | names from [ticket:1256]. Added more tests. MySQL and Postgres dialects still do not issue correct CREATE TABLE statements for identifiers with percent signs in them.
* - Columns can again contain percent signs within theirMike Bayer2008-12-231-0/+14
| | | | names. [ticket:1256]
* - Query() can be passed a "composite" attributeMike Bayer2008-12-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | as a column expression and it will be expanded. Somewhat related to [ticket:1253]. - Query() is a little more robust when passed various column expressions such as strings, clauselists, text() constructs (which may mean it just raises an error more nicely). - select() can accept a ClauseList as a column in the same way as a Table or other selectable and the interior expressions will be used as column elements. [ticket:1253] - removed erroneous FooTest from test/orm/query -This line, and those below, will be ignored-- M test/orm/query.py M test/orm/mapper.py M test/sql/select.py M lib/sqlalchemy/orm/query.py M lib/sqlalchemy/sql/expression.py M CHANGES
* - union() and union_all() will not whackMike Bayer2008-12-061-0/+10
| | | | | | | | any order_by() that has been applied to the select()s inside. If you union() a select() with order_by() (presumably to support LIMIT/OFFSET), you should also call self_group() on it to apply parenthesis.
* docstring updatesMike Bayer2008-11-071-1/+2
|
* Slightly changed behavior of IN operator for comparing to empty collections. ↵Ants Aasma2008-10-201-1/+1
| | | | Now results in inequality comparison against self. More portable, but breaks with stored procedures that aren't pure functions.
* - 0.5.0rc3, dohMike Bayer2008-10-181-4/+0
| | | | | | | | | | | | - The internal notion of an "OID" or "ROWID" column has been removed. It's basically not used by any dialect, and the possibility of its usage with psycopg2's cursor.lastrowid is basically gone now that INSERT..RETURNING is available. - Removed "default_order_by()" method on all FromClause objects. - profile/compile/select test is 8 function calls over on buildbot 2.4 for some reason, will adjust after checking the results of this commit
* Correction of mssql schema reflection in reflectable. Still a problem since ↵Michael Trier2008-10-111-1/+0
| | | | the assumed default is dbo, whereas it could be modified by the connection. Allows SchemaTest.test_select to pass now.
* - version bumpMike Bayer2008-09-161-4/+13
| | | | | | | - turned properties in sql/expressions.py to @property - column.in_(someselect) can now be used as a columns-clause expression without the subquery bleeding into the FROM clause [ticket:1074]
* - 0.5.0rc1rel_0_5rc1Mike Bayer2008-09-111-3/+3
| | | | - removed unneeded grouping from BooleanClauseList, generated needless parens
* - Bind params now subclass ColumnElement which allows them to beMike Bayer2008-09-091-0/+1
| | | | | | | | | | | selectable by orm.query (they already had most ColumnElement semantics). - Added select_from() method to exists() construct, which becomes more and more compatible with a regular select(). - Bind parameters/literals given a True/False value will detect their type as Boolean
* - The exists() construct won't "export" its contained listMike Bayer2008-09-081-8/+29
| | | | | | | | | of elements as FROM clauses, allowing them to be used more effectively in the columns clause of a SELECT. - and_() and or_() now generate a ColumnElement, allowing boolean expressions as result columns, i.e. select([and_(1, 0)]). [ticket:798]
* - Temporarily rolled back the "ORDER BY" enhancementMike Bayer2008-08-061-47/+1
| | | | | from [ticket:1068]. This feature is on hold pending further development.
* - compiler visit_label() checks a flag "within_order_by" and will render its ↵Mike Bayer2008-08-031-0/+49
| | | | | | | | | | | | | | | | | | | own name and not its contained expression, if the dialect reports true for supports_simple_order_by_label. the flag is not propagated forwards, meant to closely mimic the syntax Postgres expects which is that only a simple name can be in the ORDER BY, not a more complex expression or function call with the label name embedded (mysql and sqlite support more complex expressions). This further sets the standard for propigation of **kwargs within compiler, that we can't just send **kwargs along blindly to each XXX.process() call; whenever a **kwarg needs to propagate through, most methods will have to be aware of it and know when they should send it on forward and when not. This was actually already the case with result_map as well. The supports_simple_order_by dialect flag defaults to True but is conservatively explicitly set to False on all dialects except SQLite/MySQL/Postgres to start. [ticket:1068]
* - Spiffed up the deprecated decorators & @flipped 'em up topJason Kirtland2008-07-161-1/+1
|
* - Fixed bug when calling select([literal('foo')])Mike Bayer2008-07-151-0/+3
| | | | or select([bindparam('foo')]).
* possible fix for MS-SQL version of match() test, but the real solution here ↵Mike Bayer2008-07-141-1/+1
| | | | may be to have the correct default paramstyle set up on the MS-SQL dialect.
* Added new basic match() operator that performs a full-text search. Supported ↵Michael Trier2008-07-131-0/+10
| | | | on PostgreSQL, SQLite, MySQL, MS-SQL, and Oracle backends.
* r4695 merged to trunk; trunk now becomes 0.5.Mike Bayer2008-05-091-25/+11
| | | | 0.4 development continues at /sqlalchemy/branches/rel_0_4
* fix order by for MySQL environmentMike Bayer2008-04-261-0/+2
|
* - improved behavior of text() expressions when used asMike Bayer2008-04-261-0/+11
| | | | | | | FROM clauses, such as select().select_from(text("sometext")) [ticket:1014] - removed _TextFromClause; _TextClause just adds necessary FromClause descriptors at the class level
* - Support for COLLATE: collate(expr, col) and expr.collate(col)Jason Kirtland2008-04-161-0/+29
|
* - merged -r4458:4466 of query_columns branchMike Bayer2008-04-071-123/+125
| | | | | | | - this branch changes query.values() to immediately return an iterator, adds a new "aliased" construct which will be the primary method to get at aliased columns when using values() - tentative ORM versions of _join and _outerjoin are not yet public, would like to integrate with Query better (work continues in the branch) - lots of fixes to expressions regarding cloning and correlation. Some apparent ORM bug-workarounds removed. - to fix a recursion issue with anonymous identifiers, bind parameters generated against columns now just use the name of the column instead of the tablename_columnname label (plus the unique integer counter). this way expensive recursive schemes aren't needed for the anon identifier logic. This, as usual, impacted a ton of compiler unit tests which needed a search-n-replace for the new bind names.
* factored down exportable_columns/flatten_cols/proxy_column/oid_etc_yada down ↵Mike Bayer2008-04-041-0/+3
| | | | to a single, streamlined "_populate_column_collection" method called for all selectables
* fixed union() bug whereby oid_column would not be available if no oid_column ↵Mike Bayer2008-04-041-0/+7
| | | | in embedded selects
* - schema-qualified tables now will place the schemanameMike Bayer2008-03-301-7/+7
| | | | | | | | | | ahead of the tablename in all column expressions as well as when generating column labels. This prevents cross- schema name collisions in all cases [ticket:999] - the "use_schema" argument to compiler.visit_column() is removed. It uses schema in all cases now. - added a new test to the PG dialect to test roundtrip insert/update/delete/select statements with full schema qualification
* - can now allow selects which correlate all FROM clausesMike Bayer2008-03-281-0/+9
| | | | | | and have no FROM themselves. These are typically used in a scalar context, i.e. SELECT x, (SELECT x WHERE y) FROM table. Requires explicit correlate() call.
* added escape kw arg to contains(), startswith(), endswith(), [ticket:791]Mike Bayer2008-03-191-1/+4
|
* - like() and ilike() take an optional keyword argumentMike Bayer2008-03-191-8/+17
| | | | | | "escape=<somestring>", which is set as the escape character using the syntax "x LIKE y ESCAPE '<somestring>'" [ticket:993]
* - can again create aliases of selects against textualMike Bayer2008-02-191-0/+5
| | | | FROM clauses, [ticket:975]
* - updated the naming scheme of the base test classes in test/testlib/testing.py;Mike Bayer2008-02-111-4/+4
| | | | | tests extend from either TestBase or ORMTest, using additional mixins for special assertion methods as needed
* - added generative where(<criterion>) method to delete()Mike Bayer2008-02-081-1/+4
| | | | | | | and update() constructs which return a new object with criterion joined to existing criterion via AND, just like select().where(). - compile assertions use assertEquals()
* lock in replacing '%' with '%%'Mike Bayer2008-02-041-11/+11
|
* - some consolidation of tests in select.py, movedMike Bayer2008-02-011-175/+75
| | | | | | | other tests to more specific modules - added "now()" as a generic function; on SQLite and Oracle compiles as "CURRENT_TIMESTAMP"; "now()" on all others [ticket:943]
* - Workaround for datetime quirk, LHS comparisons to SA expressions now work.Jason Kirtland2008-01-311-1/+4
|
* - the startswith(), endswith(), and contains() operatorsMike Bayer2008-01-311-20/+28
| | | | | | | | | now concatenate the wildcard operator with the given operand in SQL, i.e. "'%' || <bindparam>" in all cases, accept text('something') operands properly [ticket:962] - cast() accepts text('something') and other non-literal operands properly [ticket:962]
* - some expression fixup:Mike Bayer2008-01-191-68/+100
| | | | | | | | | | | | | | | | | | | | | | - the '.c.' attribute on a selectable now gets an entry for every column expression in its columns clause; previously, "unnamed" columns like functions and CASE statements weren't getting put there. Now they will, using their full string representation if no 'name' is available. - The anonymous 'label' generated for otherwise unlabeled functions and expressions now propagates outwards at compile time for expressions like select([select([func.foo()])]) - a CompositeSelect, i.e. any union(), union_all(), intersect(), etc. now asserts that each selectable contains the same number of columns. This conforms to the corresponding SQL requirement. - building on the above ideas, CompositeSelects now build up their ".c." collection based on the names present in the first selectable only; corresponding_column() now works fully for all embedded selectables.
* - testbase is gone, replaced by testenvJason Kirtland2008-01-121-3/+3
| | | | | | - Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase - testing.db has the configured db - Fixed up the perf/* scripts
* fixed NOT ILIKEMike Bayer2008-01-111-1/+5
|
* - added "ilike()" operator to column operations.Mike Bayer2008-01-111-0/+7
| | | | | compiles to ILIKE on postgres, lower(x) LIKE lower(y) on all others [ticket:727]
* Reworked r4042- undeclared deprecation warnings are now *fatal* to tests. ↵Jason Kirtland2008-01-101-5/+4
| | | | No surprises.
* test suite deprecation rampageJason Kirtland2008-01-091-13/+17
|
* - fixed bug in union() so that select() statements which don't deriveMike Bayer2008-01-081-0/+9
| | | | from FromClause objects can be unioned