summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - added verbose activity to profiling.function_call_countMike Bayer2008-04-011-19/+1
| | | | | - simplified oracle non-ansi join generation, removed hooks from base compiler - removed join() call from _label generation, fixed repeat label gen
* - 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-301-9/+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
* - Added generic func.random (non-standard SQL)Jason Kirtland2008-03-251-0/+1
|
* 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
* - like() and ilike() take an optional keyword argumentMike Bayer2008-03-191-5/+5
| | | | | | "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/+4
|
* - postgres TIMESTAMP renders correctly [ticket:981]Mike Bayer2008-02-271-2/+2
|
* - 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
* - Fixed a couple pyflakes, cleaned up imports & whitespaceJason Kirtland2008-02-141-88/+84
|
* - 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-121-2/+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 deferrability support to constraintsJason Kirtland2008-02-081-0/+14
|
* Fix: deletes with schemas on MSSQL 2000 [ticket:967]Paul Johnston2008-02-081-5/+11
|
* - 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
* - 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-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | - 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.
* fixed NOT ILIKEMike Bayer2008-01-111-1/+1
|
* - added "ilike()" operator to column operations.Mike Bayer2008-01-111-1/+1
| | | | | compiles to ILIKE on postgres, lower(x) LIKE lower(y) on all others [ticket:727]
* redid the _for_ddl String/Text deprecation warning correctly [ticket:912]Mike Bayer2008-01-091-1/+1
|
* - changed name of TEXT to Text since its a "generic" type; TEXT name isMike Bayer2008-01-051-1/+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]
* add anonymous labels to function callsMike Bayer2008-01-041-1/+1
|
* - further fix to new TypeDecorator, so that subclasses of TypeDecorators ↵Mike Bayer2008-01-021-2/+2
| | | | | | work properly - _handle_dbapi_exception() usage changed so that unwrapped exceptions can be rethrown with the original stack trace
* happy new yearMike Bayer2008-01-011-1/+1
|
* introductory docstring bonanzaMike Bayer2007-12-181-1/+13
|
* get most oracle tests in sql working again....Mike Bayer2007-12-181-0/+1
|
* - Query.select_from() now replaces all existing FROM criterion withMike Bayer2007-12-091-1/+1
| | | | | | | | | | 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.
* - flush() refactor merged from uow_nontree branch r3871-r3885Mike Bayer2007-12-081-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - topological.py cleaned up, presents three public facing functions which return list/tuple based structures, without exposing any internals. only the third function returns the "hierarchical" structure. when results include "cycles" or "child" items, 2- or 3- tuples are used to represent results. - unitofwork uses InstanceState almost exclusively now. new and deleted lists are now dicts which ref the actual object to provide a strong ref for the duration that they're in those lists. IdentitySet is only used for the public facing versions of "new" and "deleted". - unitofwork topological sort no longer uses the "hierarchical" version of the sort for the base sort, only for the "per-object" secondary sort where it still helps to group non-dependent operations together and provides expected insert order. the default sort deals with UOWTasks in a straight list and is greatly simplified. Tests all pass but need to see if svilen's stuff still works, one block of code in _sort_cyclical_dependencies() seems to not be needed anywhere but i definitely put it there for a reason at some point; if not hopefully we can derive more test coverage from that. - the UOWEventHandler is only applied to object-storing attributes, not scalar (i.e. column-based) ones. cuts out a ton of overhead when setting non-object based attributes. - InstanceState also used throughout the flush process, i.e. dependency.py, mapper.save_obj()/delete_obj(), sync.execute() all expect InstanceState objects in most cases now. - mapper/property cascade_iterator() takes InstanceState as its argument, but still returns lists of object instances so that they are not dereferenced. - a few tricks needed when dealing with InstanceState, i.e. when loading a list of items that are possibly fresh from the DB, you *have* to get the actual objects into a strong-referencing datastructure else they fall out of scope immediately. dependency.py caches lists of dependent objects which it loads now (i.e. history collections). - AttributeHistory is gone, replaced by a function that returns a 3-tuple of added, unchanged, deleted. these collections still reference the object instances directly for the strong-referencing reasons mentiontioned, but it uses less IdentitySet logic to generate.
* changed the anonymous numbering scheme to be more appealingMike Bayer2007-12-081-5/+6
| | | | got tests running
* fix to unique bind params, you *can* use the same unique bindparam multiple ↵Mike Bayer2007-12-071-1/+1
| | | | | | | times in a statement. the collision check is strictly detecting non-unique's that happen to have the same name.
* - generation of "unique" bind parameters has been simplified to use the sameMike Bayer2007-12-061-21/+8
| | | | | | | | | | "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'})
* some more omit schemas for [ticket:890]Mike Bayer2007-12-051-2/+2
|
* - tables with schemas can still be used in sqlite, firebird,Mike Bayer2007-12-051-1/+1
| | | | schema name just gets dropped [ticket:890]
* - basic framework for generic functions, [ticket:615]Mike Bayer2007-12-051-19/+33
| | | | | | | - 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.
* - relaxed rules on column_property() expressions having labels; anyMike Bayer2007-12-041-1/+1
| | | | | | ColumnElement is accepted now, as the compiler auto-labels non-labeled ColumnElements now. a selectable, like a select() statement, still requires conversion to ColumnElement via as_scalar() or label().
* 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-62/+39
| | | | | | | | | - 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-35/+43
|
* some wide zoomark ranges...Mike Bayer2007-11-181-2/+2
|
* - anonymous column expressions are automatically labeled.Mike Bayer2007-11-101-22/+29
| | | | | | | | | | | | | | | | | | | 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]
* - fixed remainder of [ticket:853]Mike Bayer2007-11-071-3/+0
| | | | | | - bindparam 'shortname' is deprecated - fixed testing.assert_compile() to actually generate bind param dict before asserting - added bind param assertions to CRUDTest.test_update
* - fix to compiled bind parameters to not mistakenly populate NoneMike Bayer2007-11-071-3/+7
| | | | [ticket:853]
* - adjustments to oracle ROWID logic...recent oid changes mean we have toMike Bayer2007-11-051-14/+16
| | | | | | use "rowid" against the select itself (i.e. its just...'rowid', no table name). seems to work OK but not sure if issues will arise - fixes to oracle bind param stuff to account for recent removal of ClauseParameters object.
* - rewritten ClauseAdapter merged from the eager_minus_join branch; this is a ↵Mike Bayer2007-11-031-3/+6
| | | | | | | | much simpler and "correct" version which will copy all elements exactly once, except for those which were replaced with target elements. It also can match a wider variety of target elements including joins and selects on identity alone.
* - merged factor_down_bindparams branch.Mike Bayer2007-11-011-19/+10
| | | | | | - removed ClauseParameters object; compiled.params returns a regular dictionary now, as well as result.last_inserted_params()/last_updated_params(). - various code trimming, method removals.
* - fixed INSERT statements w.r.t. primary key columns that have SQL-expressionMike Bayer2007-10-281-5/+8
| | | | | | based default generators on them; SQL expression executes inline as normal but will not trigger a "postfetch" condition for the column, for those DB's who provide it via cursor.lastrowid