summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - added verbose activity to profiling.function_call_countMike Bayer2008-04-011-8/+12
| | | | | - simplified oracle non-ansi join generation, removed hooks from base compiler - removed join() call from _label generation, fixed repeat label gen
* - merge() may actually work now, though we've heard that before...Mike Bayer2008-04-011-3/+3
| | | | | | | - merge() uses the priamry key attributes on the object if _instance_key not present. so merging works for instances that dont have an instnace_key, will still issue UPDATE for existing rows. - improved collection behavior for merge() - will remove elements from a destination collection that are not in the source. - fixed naive set-mutation issue in Select._get_display_froms - simplified fixtures.Base a bit
* - schema-qualified tables now will place the schemanameMike Bayer2008-03-301-1/+4
| | | | | | | | | | 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
* - merged with_polymorphic branch, which was merged with query_columns branchMike Bayer2008-03-291-0/+9
| | | | | | | | | | | | | | | | | - removes everything to do with select_table, which remains as a keyword argument synonymous with with_polymorphic=('*', select_table). - all "polymorphic" selectables find their way to Query by way of _set_select_from() now, so that all joins/aliasing/eager loads/etc. is handled consistently. Mapper has methods for producing polymorphic selectables so that Query and eagerloaders alike can get to them. - row aliasing simplified, so that they don't need to nest. they only need the source selectable and adapt to whatever incoming columns they get. - Query is more egalitarian about mappers/columns now. Still has a strong sense of "entity zero", but also introduces new unpublished/experimental _values() method which sets up a columns-only query. - Query.order_by() and Query.group_by() take *args now (also still take a list, will likely deprecate in 0.5). May want to do this for select() as well. - the existing "check for False discriminiator" "fix" was not working completely, added coverage - orphan detection was broken when the target object was a subclass of the mapper with the orphaned relation, fixed that too.
* - can now allow selects which correlate all FROM clausesMike Bayer2008-03-281-3/+1
| | | | | | 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.
* - 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]