summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql.py
Commit message (Collapse)AuthorAgeFilesLines
* 1. Module layout. sql.py and related move into a package called "sql".Mike Bayer2007-08-181-3484/+0
| | | | | | | | | | | | 2. compiler names changed to be less verbose, unused classes removed. 3. Methods on Dialect which return compilers, schema generators, identifier preparers have changed to direct class references, typically on the Dialect class itself or optionally as attributes on an individual Dialect instance if conditional behavior is needed. This takes away the need for Dialect subclasses to know how to instantiate these objects, and also reduces method overhead by one call for each one. 4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now). The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument. 5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py
* - fixed prefixes= argument to select()Jason Kirtland2007-08-181-795/+817
| | | | | | | - mysql can now generate DISTINCT or ALL for queries, select(..., distinct='ALL') - documented 'prefixes' arg to select() - rearranged doc order for select args to mirror that of a generated statement - went nutty and fixed wrapping and line length on most docstrings in sql.py
* - modified SQL operator functions to be module-level operators, allowingMike Bayer2007-08-181-177/+100
| | | | | | | SQL expressions to be pickleable [ticket:735] - small adjustment to mapper class.__init__ to allow for Py2.6 object.__init__() behavior
* - fix to bind param processing such that "False" values (like blank strings)Mike Bayer2007-08-161-13/+9
| | | | still get processed/encoded
* mass has_key->__contains__ migration, [ticket:738]Mike Bayer2007-08-151-2/+2
|
* - merged "fasttypes" branch. this branch changes the signatureMike Bayer2007-08-141-15/+48
| | | | | | | | | | | | | of convert_bind_param() and convert_result_value() to callable-returning bind_processor() and result_processor() methods. if no callable is returned, no pre/post processing function is called. - hooks added throughout base/sql/defaults to optimize the calling of bind param/result processors so that method call overhead is minimized. special cases added for executemany() scenarios such that unneeded "last row id" logic doesn't kick in, parameters aren't excessively traversed. - new performance tests show a combined mass-insert/mass-select test as having 68% fewer function calls than the same test run against 0.3. - general performance improvement of result set iteration is around 10-20%.
* - base_mapper() becomes a plain attributeMike Bayer2007-08-141-21/+49
| | | | | | | | - session.execute() and scalar() can search for a Table with which to bind from using the given ClauseElement - session automatically extrapolates tables from mappers with binds, also uses base_mapper so that inheritance hierarchies bind automatically - moved ClauseVisitor traversal back to inlined non-recursive
* - precompiled regexp for anonymous labelsMike Bayer2007-08-111-3/+3
| | | | - has_key()->__contains__()
* - removed _calculate_correlations() methods, removed correlation_stack, ↵Mike Bayer2007-08-111-100/+8
| | | | | | | select_stack; all are merged into a single stack thats all within ansicompiler. clause visiting cut down significantly.
* - case_sensitive=(True|False) setting removed from schema items, sinceMike Bayer2007-08-111-9/+1
| | | | | | | checking this state added a lot of method call overhead and there was no decent reason to ever set it to False. Table and column names which are all lower case will be treated as case-insenstive (yes we adjust for Oracle's UPPERCASE style too).
* removed unused method from last checkinMike Bayer2007-08-091-3/+0
|
* - decoupled all ColumnElements from also being Selectables. this meansMike Bayer2007-08-091-34/+63
| | | | | | | | that anything which is a column expression does not have a "c" or a "columns" attribute. Also works for select().as_scalar(); _ScalarSelect is a columnelement, so you can't say select().as_scalar().c.foo, which is a pretty confusing mistake to make. in the case of _ScalarSelect made an explicit raise if you try to access 'c'.
* - migrated 'desc', 'asc', and 'distinct' to be in the Operators frameworkMike Bayer2007-08-071-9/+31
| | | | - fixes to operator() method signature/calling
* - added desc() and asc() directly to CompareMixinMike Bayer2007-08-061-1/+11
|
* - docsMike Bayer2007-08-061-2/+58
| | | | | - added some convenience functions to selects, clauseelements - fixed distinct()
* - draft sqlexpression tutorialMike Bayer2007-08-061-2/+23
| | | | | - added some generative methods to exists() - got clause adapter to work with join()
* switch (simple) occurences of 'if len(x)' to 'if x': find . -name '*.py' ↵Jonathan Ellis2007-08-031-6/+6
| | | | |xargs perl -pi.bak -e 's/if len\((\S+)\):/if $1:/' && find . -name '*.bak' |xargs rm
* - added inline UPDATE/INSERT clauses, settable as regular object attributes.Mike Bayer2007-08-021-0/+4
| | | | the clause gets executed inline during a flush().
* added values() generative method to Insert/UpdateMike Bayer2007-08-021-0/+28
|
* - restored old assign_mapper monkey patched query methods but with two ↵Gaëtan de Menten2007-07-311-2/+2
| | | | | | | | differences: * added a deprecation warning * check if a method with that name already exist in the class - more foolproof deprecation warning for scalar kwarg
* add warnings for deprecated methods and optionsJonathan Ellis2007-07-301-0/+2
|
* fixed 'column_literal' to 'literal_column' [ticket:626]Mike Bayer2007-07-291-2/+2
|
* fixed pydoc bug in [ticket:564]Mike Bayer2007-07-291-1/+8
|
* fixed glitch in Select visit traversal, fixes #693Mike Bayer2007-07-271-1/+1
|
* merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to ↵Mike Bayer2007-07-271-882/+1064
| | | | maintenance branch in branches/rel_0_3.
* Merged reference fixes from r2986Jason Kirtland2007-07-191-2/+2
|
* - merged some more of the SessionTransaction connection-bound checks from 0.4Mike Bayer2007-07-181-1/+7
| | | | | - _BinaryExpression.compare() checks for a base set of "commutative" operators and checks for itself in reverse if so - added ORM-based unit test for the above, fixes [ticket:664]
* - columns can be overridden in a reflected table with a "key"Mike Bayer2007-07-151-0/+7
| | | | | | attribute different than the column's name, including for primary key columns [ticket:650] - more docs
* - improved ability to get the "correct" and most minimal set of primary keyMike Bayer2007-07-141-19/+49
| | | | | | | columns from a join, equating foreign keys and otherwise equated columns. this is also mostly to help inheritance scenarios formulate the best choice of primary key columns. [ticket:185] - added 'bind' argument to Sequence.create()/drop(), ColumnDefault.execute()
* - composite primary key is represented as a non-keyed set to allow forMike Bayer2007-07-131-1/+20
| | | | | | composite keys consisting of cols with the same name; occurs within a Join. helps inheritance scenarios formulate correct PK. - ticket #185 reopened. still need to get Join to produce a minmal PK for fk'ed columns
* - the various "engine" arguments, such as "engine", "connectable",Mike Bayer2007-07-121-38/+50
| | | | | | | | | "engine_or_url", "bind_to", etc. are all present, but deprecated. they all get replaced by the single term "bind". you also set the "bind" of MetaData using metadata.bind = <engine or connection>. this is part of 0.4 forwards compatibility where "bind" is the only keyword. [ticket:631]
* changed "_source_column" to simpler "_distance"Mike Bayer2007-07-101-15/+8
|
* more "column targeting" enhancements..columns have a "depth" from their ↵Mike Bayer2007-07-101-6/+20
| | | | ultimate source column so that corresponding_column() can find the column that is "closest" (i.e. fewest levels of proxying) to the requested column
* add missing grouping for compound selects. fixes ticket #623Ants Aasma2007-06-261-1/+6
|
* fix precedence of between (ticket #621)Ants Aasma2007-06-251-11/+5
|
* - fixed precedence of operators so that parenthesis are correctly appliedMike Bayer2007-06-251-16/+38
| | | | | | | | [ticket:620] - calling <column>.in_() (i.e. with no arguments) will return "CASE WHEN (<column> IS NULL) THEN NULL ELSE 0 END = 1)", so that NULL or False is returned in all cases, rather than throwing an error [ticket:545]
* - fixed "where"/"from" criterion of select() to accept a unicode stringMike Bayer2007-06-231-2/+2
| | | | in addition to regular string - both convert to text()
* - added standalone distinct() function in addition to column.distinct()Mike Bayer2007-06-211-1/+9
| | | | [ticket:558]
* orig_set is a Set [ticket:614]Mike Bayer2007-06-201-1/+1
|
* Multiple MSSQL fixes; see ticket #581Paul Johnston2007-06-131-0/+1
|
* extra test for corresponding column fixMike Bayer2007-06-071-0/+2
|
* - fixed bug where selectable.corresponding_column(selectable.c.col)Mike Bayer2007-06-061-1/+3
| | | | | | would not return selectable.c.col, if the selectable is a join of a table and another join involving the same table. messed up ORM decision making [ticket:593]
* another object.__init__() call with args....might need to build py2.6 to ↵Mike Bayer2007-05-261-1/+1
| | | | test this more completely....
* removed ClauseVisitor.__init__(), doesnt work with python trunkMike Bayer2007-05-261-2/+1
|
* CompoundSelect (i.e. UNION etc.) needed self_group() to provide parenthesisMike Bayer2007-05-231-0/+3
|
* restored comparison of 1-element clause list -> ClauseElement, which was ↵Mike Bayer2007-05-201-1/+3
| | | | broken in [changeset:2620]
* - removed "no group by's in a select thats part of a UNION"Mike Bayer2007-05-181-1/+0
| | | | restriction [ticket:578]
* fixed LoggingClauseVisitorMike Bayer2007-05-151-13/+19
|
* - parenthesis are applied to clauses via a new _Grouping construct.Mike Bayer2007-05-141-187/+223
| | | | | | | | uses operator precedence to more intelligently apply parenthesis to clauses, provides cleaner nesting of clauses (doesnt mutate clauses placed in other clauses, i.e. no 'parens' flag) - added 'modifier' keyword, works like func.<foo> except does not add parenthesis. e.g. select([modifier.DISTINCT(...)]) etc.
* - _Label propigates "_hide_froms()" so that scalar selectsMike Bayer2007-05-111-1/+4
| | | | behave more properly with regards to FROM clause #574