summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
Commit message (Collapse)AuthorAgeFilesLines
* - fixed SQL function truncation of trailing underscoresMike Bayer2008-03-251-1/+1
| | | | [ticket:996]
* added escape kw arg to contains(), startswith(), endswith(), [ticket:791]Mike Bayer2008-03-191-12/+12
|
* - like() and ilike() take an optional keyword argumentMike Bayer2008-03-191-13/+17
| | | | | | "escape=<somestring>", which is set as the escape character using the syntax "x LIKE y ESCAPE '<somestring>'" [ticket:993]
* Added support for vendor-extended INSERT syntax like INSERT DELAYED INTOJason Kirtland2008-03-071-1/+21
|
* - Updated exception messaging for r4220Jason Kirtland2008-03-041-5/+5
|
* - added "bind" keyword argument to insert(), update(), delete();Mike Bayer2008-03-041-7/+19
| | | | .bind property is settable on those as well as select().
* - fixed bug which was preventing UNIONS from being cloneable,Mike Bayer2008-03-041-8/+11
| | | | [ticket:986]
* silliness reductionMike Bayer2008-02-241-10/+8
|
* - can again create aliases of selects against textualMike Bayer2008-02-191-0/+1
| | | | FROM clauses, [ticket:975]
* - Fixed a couple pyflakes, cleaned up imports & whitespaceJason Kirtland2008-02-141-2/+1
|
* - fixed bug introduced in r4070 where union() and other compound selects ↵Mike Bayer2008-02-121-1/+1
| | | | | | | would not get an OID column if it only contained one selectable element, due to missing return in _proxy_column() - visit_column() calls itself to render a primary key col being used as the interpretation of the oid col instead of relying upon broken partial logic
* - added generative where(<criterion>) method to delete()Mike Bayer2008-02-081-2/+33
| | | | | | | and update() constructs which return a new object with criterion joined to existing criterion via AND, just like select().where(). - compile assertions use assertEquals()
* - Some more reST docstring correctionsJason Kirtland2008-02-061-31/+30
|
* - Workaround for datetime quirk, LHS comparisons to SA expressions now work.Jason Kirtland2008-01-311-0/+3
|
* - Friendlier exception messages for unbound, implicit executionJason Kirtland2008-01-311-1/+7
| | | | - Implicit binding failures now raise UnboundExecutionError
* - added "autocommit=True" kwarg to select() and text(),Mike Bayer2008-01-311-3/+23
| | | | | | | | | as well as generative autocommit() method on select(); for statements which modify the database through some user-defined means other than the usual INSERT/UPDATE/ DELETE etc., this flag will enable "autocommit" behavior during execution if no transaction is in progress [ticket:915]
* - the startswith(), endswith(), and contains() operatorsMike Bayer2008-01-311-33/+33
| | | | | | | | | 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]
* - query.join() can also accept tuples of attributeMike Bayer2008-01-231-0/+3
| | | | | | | | | | | name/some selectable as arguments. This allows construction of joins *from* subclasses of a polymorphic relation, i.e.: query(Company).\ join( [('employees', people.join(engineer)), Engineer.name] )
* - some expression fixup:Mike Bayer2008-01-191-20/+44
| | | | | | | | | | | | | | | | | | | | | | - 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.
* finally, a really straightforward reduce() method which reduces colsMike Bayer2008-01-151-42/+11
| | | | | | | to the minimal set for every test case I can come up with, and now replaces all the cruft in Mapper._compile_pks() as well as Join.__init_primary_key(). mappers can now handle aliased selects and figure out the correct PKs pretty well [ticket:933]
* - select_table mapper turns straight join into aliased select + custom PK, ↵Mike Bayer2008-01-151-0/+8
| | | | | | | to allow joins onto select_table mappers - starting a generalized reduce_columns func
* - query.join() can now accept class-mapped attributesMike Bayer2008-01-141-2/+2
| | | | | | | | | as arguments, which can be used in place or in any combination with strings. In particular this allows construction of joins to subclasses on a polymorphic relation, i.e. query(Company).join(['employees', Engineer.name]), etc.
* - added "ilike()" operator to column operations.Mike Bayer2008-01-111-0/+4
| | | | | compiles to ILIKE on postgres, lower(x) LIKE lower(y) on all others [ticket:727]
* - Warnings are now issued as SAWarning instead of RuntimeWarning; ↵Jason Kirtland2008-01-111-4/+4
| | | | | | util.warn() wraps this up. - SADeprecationWarning has moved to exceptions. An alias remains in logging until 0.5.
* - fixed bug in union() so that select() statements which don't deriveMike Bayer2008-01-081-1/+2
| | | | from FromClause objects can be unioned
* - fixed an attribute history bug whereby assigning a new collectionMike Bayer2008-01-071-2/+2
| | | | | | | | | | | to a collection-based attribute which already had pending changes would generate incorrect history [ticket:922] - fixed delete-orphan cascade bug whereby setting the same object twice to a scalar attribute could log it as an orphan [ticket:925] - generative select.order_by(None) / group_by(None) was not managing to reset order by/group by criterion, fixed [ticket:924]
* - changed name of TEXT to Text since its a "generic" type; TEXT name isMike Bayer2008-01-051-16/+1
| | | | | | | deprecated until 0.5. The "upgrading" behavior of String to Text when no length is present is also deprecated until 0.5; will issue a warning when used for CREATE TABLE statements (String with no length for SQL expression purposes is still fine) [ticket:912]
* Experimental: modestly more informative repr() for some expressions (using ↵Jason Kirtland2008-01-051-0/+8
| | | | .description)
* Migrated a few in-function 'from x import y' to the 'global x; if x is None' ↵Jason Kirtland2008-01-051-160/+168
| | | | style.
* happy new yearMike Bayer2008-01-011-1/+1
|
* - reworked all lazy/deferred/expired callables to beMike Bayer2007-12-211-2/+3
| | | | | | | | serializable class instances, added pickling tests - cleaned up "deferred" polymorphic system so that the mapper handles it entirely - columns which are missing from a Query's select statement now get automatically deferred during load.
* a little pre-lunch decrufting and cleanupMike Bayer2007-12-181-61/+25
|
* - cleanup; lambdas removed from properties; properties mirror same-named ↵Mike Bayer2007-12-181-99/+95
| | | | | | functions (more like eventual decorator syntax); remove some old methods, factor out some "raiseerr" ugliness to outer lying functions. - corresponding_column() integrates "require_embedded" flag with other set arithmetic
* - select().as_scalar() will raise an exception if the select does not haveMike Bayer2007-12-181-7/+11
| | | | | | | | | | | | exactly one expression in its columns clause. - added "helper exception" to select.type access, generic functions raise the chance of this happening - a slight behavioral change to attributes is, del'ing an attribute does *not* cause the lazyloader of that attribute to fire off again; the "del" makes the effective value of the attribute "None". To re-trigger the "loader" for an attribute, use session.expire(instance, [attrname]). - fix ormtutorial for IS NULL
* - more fixes to the LIMIT/OFFSET aliasing applied with Query + eagerloads,Mike Bayer2007-12-161-31/+27
| | | | | | | | in this case when mapped against a select statement [ticket:904] - _hide_froms logic in expression totally localized to Join class, including search through previous clone sources - removed "stop_on" from main visitors, not used - "stop_on" in AbstractClauseProcessor part of constructor, ClauseAdapter sets it up based on given clause - fixes to is_derived_from() to take previous clone sources into account, Alias takes self + cloned sources into account. this is ultimately what the #904 bug was.
* moved hide_froms and aggregate_hide_froms to be only on FromClauseMike Bayer2007-12-161-28/+19
|
* - more query testsMike Bayer2007-12-101-7/+33
| | | | | | | | | - trying to refine some of the adaptation stuff - query.from_statement() wont allow further generative criterion - added a warning to columncollection when selectable is formed with conflicting columns (only in the col export phase) - some method rearrangement on schema/columncollection.... - property conflicting relation warning doesnt raise for concrete
* - Query.select_from() now replaces all existing FROM criterion withMike Bayer2007-12-091-5/+11
| | | | | | | | | | the given argument; the previous behavior of constructing a list of FROM clauses was generally not useful as is required filter() calls to create join criterion, and new tables introduced within filter() already add themselves to the FROM clause. The new behavior allows not just joins from the main table, but select statements as well. Filter criterion, order bys, eager load clauses will be "aliased" against the given statement.
* changed the anonymous numbering scheme to be more appealingMike Bayer2007-12-081-1/+1
| | | | got tests running
* - generation of "unique" bind parameters has been simplified to use the sameMike Bayer2007-12-061-4/+19
| | | | | | | | | | "unique identifier" mechanisms as everything else. This doesn't affect user code, except any code that might have been hardcoded against the generated names. Generated bind params now have the form "<paramname>_<num>", whereas before only the second bind of the same name would have this form. - bindparam() objects themselves can be used as keys for execute(), i.e. statement.execute({bind1:'foo', bind2:'bar'})
* - basic framework for generic functions, [ticket:615]Mike Bayer2007-12-051-13/+24
| | | | | | | - changed the various "literal" generation functions to use an anonymous bind parameter. not much changes here except their labels now look like ":param_1", ":param_2" instead of ":literal" - from_obj keyword argument to select() can be a scalar or a list.
* OrderedSet to appease the unit tests....need to find a way to get rid of thisMike Bayer2007-11-251-1/+1
|
* - named_with_column becomes an attributeMike Bayer2007-11-251-22/+12
| | | | | | | | | - cleanup within compiler visit_select(), column labeling - is_select() removed from dialects, replaced with returns_rows_text(), returns_rows_compiled() - should_autocommit() removed from dialects, replaced with should_autocommit_text() and should_autocommit_compiled() - typemap and column_labels collections removed from Compiler, replaced with single "result_map" collection. - ResultProxy uses more succinct logic in combination with result_map to target columns
* - all kinds of cleanup, tiny-to-slightly-significant speed improvementsMike Bayer2007-11-241-52/+54
|
* - added op() operator to instrumented attributes; i.e.Mike Bayer2007-11-181-1/+6
| | | | User.name.op('ilike')('%somename%') [ticket:767]
* cut down a good deal of Join construction overheadMike Bayer2007-11-181-35/+33
|
* logging fixesMike Bayer2007-11-181-6/+15
|
* - anonymous column expressions are automatically labeled.Mike Bayer2007-11-101-7/+9
| | | | | | | | | | | | | | | | | | | e.g. select([x* 5]) produces "SELECT x * 5 AS anon_1". This allows the labelname to be present in the cursor.description which can then be appropriately matched to result-column processing rules. (we can't reliably use positional tracking for result-column matches since text() expressions may represent multiple columns). - operator overloading is now controlled by TypeEngine objects - the one built-in operator overload so far is String types overloading '+' to be the string concatenation operator. User-defined types can also define their own operator overloading by overriding the adapt_operator(self, op) method. - untyped bind parameters on the right side of a binary expression will be assigned the type of the left side of the operation, to better enable the appropriate bind parameter processing to take effect [ticket:819]
* more changes to traverse-and-clone; a particular element will only be cloned ↵Mike Bayer2007-11-081-14/+25
| | | | | | | | once and is then re-used. the FROM calculation of a Select normalizes the list of hide_froms against all previous incarnations of each FROM clause, using a tag attached from cloned clause to previous.
* - identified some cases where Alias needs to be cloned; but still cant cloneMike Bayer2007-11-081-4/+13
| | | | | | when its an alias of a Table; added some test coverage for one particular case from the doctests - fixed "having" example in doctests, updated eager load example