summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
* - case() interprets the "THEN" expressionsMike Bayer2008-04-031-9/+38
| | | | | | | | | as values by default, meaning case([(x==y, "foo")]) will interpret "foo" as a bound value, not a SQL expression. use text(expr) for literal SQL expressions in this case. For the criterion itself, these may be literal strings only if the "value" keyword is present, otherwise SA will force explicit usage of either text() or literal().
* The case() function now also takes a dictionary as its whens parameter. But ↵Ants Aasma2008-04-031-1/+6
| | | | beware that it doesn't escape literals, use the literal construct for that.
* - Got PG server side cursors back into shape, added fixedMike Bayer2008-04-021-23/+30
| | | | | | | unit tests as part of the default test suite. Added better uniqueness to the cursor ID [ticket:1001] - update().values() and insert().values() take keyword arguments.
* slight function call reductionMike Bayer2008-04-021-37/+32
|
* - added verbose activity to profiling.function_call_countMike Bayer2008-04-012-27/+13
| | | | | - 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
* - reverted previous "strings instead of tuples" change due to more specific ↵Mike Bayer2008-03-301-8/+6
| | | | | | test results showing tuples faster - changed cache decorator call on default_schema_name call to a connection.info specific one
* using concatenated strings as keys in generated_ids collection; they hash ↵Mike Bayer2008-03-301-6/+8
| | | | slightly faster than tuples
* - schema-qualified tables now will place the schemanameMike Bayer2008-03-302-10/+8
| | | | | | | | | | 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-293-64/+65
| | | | | | | | | | | | | | | | | - 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 generic func.random (non-standard SQL)Jason Kirtland2008-03-252-11/+24
|
* a few more tweaksMike Bayer2008-03-251-5/+3
|
* removed AbstractClauseProcessor, merged its copy-and-visit behavior into ↵Mike Bayer2008-03-242-132/+127
| | | | ClauseVisitor
* Undoing patch #994, for now; more testing needed. Sorry. Also modifying ↵Catherine Devlin2008-03-201-10/+10
| | | | test for query equivalence to account for underscoring of bind variables.
* adding zzzeek's patch from ticket #994, which fixed virtually all remaining ↵Catherine Devlin2008-03-201-10/+10
| | | | broken unit tests in the Oracle module
* added escape kw arg to contains(), startswith(), endswith(), [ticket:791]Mike Bayer2008-03-192-18/+18
|
* - like() and ilike() take an optional keyword argumentMike Bayer2008-03-193-24/+28
| | | | | | "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-072-2/+25
|
* - 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-042-8/+17
| | | | [ticket:986]
* - postgres TIMESTAMP renders correctly [ticket:981]Mike Bayer2008-02-271-2/+2
|
* silliness reductionMike Bayer2008-02-241-10/+8
|
* - the value of a bindparam() can be a callable, in whichMike Bayer2008-02-221-2/+11
| | | | | | | | | | | | | | | | case it's evaluated at statement execution time to get the value. - expressions used in filter(), filter_by() and others, when they make usage of a clause generated from a relation using the identity of a child object (e.g. filter(Parent.child==<somechild>)), evaluate the actual primary key value of <somechild> at execution time so that the autoflush step of the Query can complete, thereby populating the PK value of <somechild> in the case that <somechild> was pending. - cleanup of attributes.get_committed_value() to never return the NO_VALUE value; evaluates to None
* - Converted MAGICCOOKIE=object() to a little symbol implementation to ease ↵Jason Kirtland2008-02-221-5/+4
| | | | object inspection and debugging
* - 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-143-130/+123
|
* - fixed bug in result proxy where anonymously generatedMike Bayer2008-02-141-1/+1
| | | | | column labels would not be accessible using their straight string name
* - fixed bug introduced in r4070 where union() and other compound selects ↵Mike Bayer2008-02-122-3/+2
| | | | | | | 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()
* - Added deferrability support to constraintsJason Kirtland2008-02-081-0/+14
|
* Fix: deletes with schemas on MSSQL 2000 [ticket:967]Paul Johnston2008-02-081-5/+11
|
* - Some more reST docstring correctionsJason Kirtland2008-02-061-31/+30
|
* - Added free-form `DDL` statements, can be executed standalone or tied to ↵Jason Kirtland2008-02-051-0/+15
| | | | | | the DDL create/drop lifecycle of Tables and MetaData. [ticket:903] - Added DDL event hooks, triggers callables before and after create / drop.
* lock in replacing '%' with '%%'Mike Bayer2008-02-041-1/+2
|
* - add dummy column to appease older SQLite verisons in unicode.pyMike Bayer2008-02-041-2/+6
| | | | - add test "escape_literal_column" comiler method to start addressing literal '%' character
* - some consolidation of tests in select.py, movedMike Bayer2008-02-011-0/+3
| | | | | | | 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-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] )
* more capability added to reduce_columnsMike Bayer2008-01-231-3/+7
|
* factor create_row_adapter into sql.util.row_adapterMike Bayer2008-01-201-0/+41
|
* - Oracle assembles the correct columns in the result setMike Bayer2008-01-191-3/+10
| | | | | | column mapping when generating a LIMIT/OFFSET subquery, allows columns to map properly to result sets even if long-name truncation kicks in [ticket:941]
* - some expression fixup:Mike Bayer2008-01-192-22/+46
| | | | | | | | | | | | | | | | | | | | | | - 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.
* maintain the ordering of the given collection of columns when reducing so ↵Mike Bayer2008-01-151-1/+1
| | | | | | that primary key collections remain ordered the same as in the mapped table
* finally, a really straightforward reduce() method which reduces colsMike Bayer2008-01-152-54/+35
| | | | | | | 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]