summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
Commit message (Collapse)AuthorAgeFilesLines
* - [bug] Added support for using the .keyMike Bayer2012-02-051-7/+19
| | | | | | | | | | | | of a Column as a string identifier in a result set row. The .key is currently listed as an "alternate" name for a column, and is superseded by the name of a column which has that key value as its regular name. For the next major release of SQLAlchemy we may reverse this precedence so that .key takes precedence, but this is not decided on yet. [ticket:2392]
* - [bug] A significant change to how labelingMike Bayer2012-02-051-10/+10
| | | | | | | | | | | | | | is applied to columns in SELECT statements allows "truncated" labels, that is label names that are generated in Python which exceed the maximum identifier length (note this is configurable via label_length on create_engine()), to be properly referenced when rendered inside of a subquery, as well as to be present in a result set row using their original in-Python names. [ticket:2396] - apply pep8 to test_labels
* fix a few py3k bugsMike Bayer2012-01-281-0/+1
|
* - [feature] Dialect-specific compilers now raiseMike Bayer2012-01-281-13/+30
| | | | | | | | CompileException for all type/statement compilation issues, instead of InvalidRequestError or ArgumentError. The DDL for CREATE TABLE will re-raise CompileExceptions to include table/column information for the problematic column. [ticket:2361]
* - [bug] Fixed issue where the "required" exceptionMike Bayer2012-01-281-11/+22
| | | | | | would not be raised for bindparam() with required=True, if the statement were given no parameters at all. [ticket:2381]
* - [bug] Fixed bug whereby a table-bound ColumnMike Bayer2012-01-221-0/+4
| | | | | | | | | | | object named "<a>_<b>" which matched a column labeled as "<tablename>_<colname>" could match inappropriately when targeting in a result set row. [ticket:2377] - requires that we change the tuple format in RowProxy. Makes an improvement to the cases tested against an unpickled RowProxy as well though doesn't solve the problem there entirely.
* - Fixed regression from 0.6 whereby ifMike Bayer2012-01-101-7/+2
| | | | | | | "load_on_pending" relationship() flag were used where a non-"get()" lazy clause needed to be emitted on a pending object, it would fail to load.
* happy new yearMike Bayer2012-01-041-1/+1
|
* - [bug] the "name" of a column-level CHECK constraint,Mike Bayer2011-12-041-1/+5
| | | | | | if present, is now rendered in the CREATE TABLE statement using "CONSTRAINT <name> CHECK <expression>". [ticket:2305]
* also add support for onupdate as we'd like this to fire off if an UPDATE ↵Mike Bayer2011-11-221-13/+31
| | | | | | actually happens on the table
* fixes to actually get tests to passMike Bayer2011-11-221-17/+12
|
* cleanupMike Bayer2011-11-211-22/+42
|
* passes for all three, includes multi col system with mysqlMike Bayer2011-11-211-6/+32
|
* sort of muscling this out, mysql a PITAMike Bayer2011-11-211-7/+47
|
* - [feature] Added new support for remote "schemas":Mike Bayer2011-10-231-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | - MetaData() accepts "schema" and "quote_schema" arguments, which will be applied to the same-named arguments of a Table or Sequence which leaves these at their default of ``None``. - Sequence accepts "quote_schema" argument - tometadata() for Table will use the "schema" of the incoming MetaData for the new Table if the schema argument is explicitly "None" - Added CreateSchema and DropSchema DDL constructs - these accept just the string name of a schema and a "quote" flag. - When using default "schema" with MetaData, ForeignKey will also assume the "default" schema when locating remote table. This allows the "schema" argument on MetaData to be applied to any set of Table objects that otherwise don't have a "schema". - a "has_schema" method has been implemented on dialect, but only works on Postgresql so far. Courtesy Manlio Perillo, [ticket:1679]
* - Behavioral improvement: emptyMike Bayer2011-09-091-1/+1
| | | | | | | conjunctions such as and_() and or_() will be flattened in the context of an enclosing conjunction, i.e. and_(x, or_()) will produce 'X' and not 'X AND ()'. [ticket:2257].
* - It is an error to call query.get() when theMike Bayer2011-04-221-1/+1
| | | | | | | given entity is not a single, full class entity or mapper (i.e. a column). This is a deprecation warning in 0.6.8. [ticket:2144]
* - Added explicit true()/false() constructs to expressionMike Bayer2011-04-171-1/+7
| | | | | | | lib - coercion rules will intercept "False"/"True" into these constructs. In 0.6, the constructs were typically converted straight to string, which was no longer accepted in 0.7. [ticket:2117]
* - Fixed incorrect usage of "," in over() clauseMike Bayer2011-04-171-1/+1
| | | | | being placed between the "partition" and "order by" clauses. [ticket:2134]
* - REAL has been added to the core types. SupportedMike Bayer2011-04-051-0/+6
| | | | | | | by Postgresql, SQL Server, MySQL, SQLite. Note that the SQL Server and MySQL versions, which add extra arguments, are also still available from those dialects. [ticket:2081]
* - add some function examples, [ticket:2107]Mike Bayer2011-04-021-1/+1
| | | | | | - have "packagenames" be present on FunctionElement by default so that compiler.visit_function() can be called - add a test for that
* - Added new generic function "next_value()", acceptsMike Bayer2011-03-201-7/+19
| | | | | | | | | | | | | | | | | | | | a Sequence object as its argument and renders the appropriate "next value" generation string on the target platform, if supported. Also provides ".next_value()" method on Sequence itself. [ticket:2085] - added tests for all the conditions described in [ticket:2085] - postgresql dialect will exec/compile a Sequence that has "optional=True". the optional flag is now only checked specifically in the context of a Table primary key evaulation. - func.next_value() or other SQL expression can be embedded directly into an insert() construct, and if implicit or explicit "returning" is used in conjunction with a primary key column, the newly generated value will be present in result.inserted_primary_key. [ticket:2084]
* - establish an "insert" option for events to control ordering if needed (not ↵Mike Bayer2011-02-251-1/+1
| | | | | | needed yet tho) - render foreign key constraints in the order in which they were cerated
* - Added over() function, method to FunctionElementMike Bayer2011-02-101-5/+20
| | | | | | | | classes, produces the _Over() construct which in turn generates "window functions", i.e. "<window function> OVER (PARTITION BY <partition by>, ORDER BY <order by>)". [ticket:1844]
* - The compiler extension now supports overriding the defaultMike Bayer2011-02-091-13/+6
| | | | | | | compilation of expression._BindParamClause including that the auto-generated binds within the VALUES/SET clause of an insert()/update() statement will also use the new compilation rules. [ticket:2042]
* - getting slightly more consistent behavior for the edge case of pk columnsMike Bayer2011-01-151-8/+6
| | | | | | with server default - autoincrement is now false with any server_default, so these all return None, applies consistency to [ticket:2020], [ticket:2021]. if prefetch is desired a "default" should be used instead of server_default.
* - the _pk_processors/_prefetch_processors approach relied upon calling RPs ↵Mike Bayer2011-01-151-14/+0
| | | | | | | | without a cursor.description result, also generates procs that are not used in most cases. simplify the approach by passing type to _exec_default() to be used if needed by _execute_scalar(), looking for the proc on just t._autoincrement_column in post_insert().
* - A TypeDecorator of Integer can be used with a primary keyMike Bayer2011-01-111-2/+16
| | | | | | | | | | | | | | | | | | | column, and the "autoincrement" feature of various dialects as well as the "sqlite_autoincrement" flag will honor the underlying database type as being Integer-based. [ticket:2005] - Result-row processors are applied to pre-executed SQL defaults, as well as cursor.lastrowid, when determining the contents of result.inserted_primary_key. [ticket:2006] - Bind parameters present in the "columns clause" of a select are now auto-labeled like other "anonymous" clauses, which among other things allows their "type" to be meaningful when the row is fetched, as in result row processors. - TypeDecorator is present in the "sqlalchemy" import space.
* - whitespace removal bonanzaMike Bayer2011-01-021-106/+106
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-2/+2
| | | | | a consistent tag - AUTHORS file
* - another heap of inlinings and now I really have to be done with thisMike Bayer2010-12-211-56/+71
|
* - apply pep8 to compiler.pyMike Bayer2010-12-211-122/+217
| | | | | - deprecate Compiled.compile() - have __init__ do compilation if statement is present.
* more inlinesMike Bayer2010-12-191-18/+17
|
* merge tipMichael Trier2010-12-191-12/+4
|\
| * - duh, compiled is per dialectMike Bayer2010-12-191-12/+4
| |
* | Added NULLS FIRST and NULLS LAST support.Michael Trier2010-12-191-0/+2
|/ | | | | It's implemented as an extension to the asc() and desc() operators, called nullsfirst() and nullslast(). [ticket:723]
* - why type.dialect_impl(dialect).bind_processor(dialect), caching just the impl?Mike Bayer2010-12-131-2/+2
| | | | | | just call type._cached_bind_processor(dialect), cache the impl *and* the processor function. same for result sets. - use plain dict + update for defaultexecutioncontext.execution_options
* - another easy win, cache the calc of bind processors in the compiled objectMike Bayer2010-12-121-0/+19
|
* - post_process_text() is called for DDL() constructs, in particular allowingMike Bayer2010-11-281-1/+1
| | | | | '%' with only one level of escaping. Note this is backwards-incompatible with previously triple-escaped sections. [ticket:1897]
* - bindparam() gets a new option "callable", which is a lambda or defMike Bayer2010-11-201-4/+4
| | | | | | | | | | evaluated at execution time to determine the value. This replaces the implicit recognition of callables sent as the primary value of bindparam(), which was an undocumented behavior used by the ORM. The argument is separated now so that values can be passed to bindparams that are also callables without ambiguity, such as user defined objects that include a __call__() method. [ticket:1950]
* merge tipMike Bayer2010-11-141-3/+12
|\
| * - The REFERENCES clause in a CREATE TABLE that includesMike Bayer2010-11-121-1/+6
| | | | | | | | | | a remote schema name now renders the remote name without the schema clause, as required by SQLite. [ticket:1851]
| * - Added type_coerce(expr, type_) expression element.Mike Bayer2010-10-231-2/+6
| | | | | | | | | | | | Treats the given expression as the given type when evaluating expressions and processing result rows, but does not affect the generation of SQL, other than an anonymous label.
* | merge tipMike Bayer2010-09-191-0/+4
|\ \ | |/
| * - An informative error message is raised if a ColumnMike Bayer2010-09-181-0/+4
| | | | | | | | | | | | | | | | | | which has not yet been assigned a name, i.e. as in declarative, is used in a context where it is exported to the columns collection of an enclosing select() construct, or if any construct involving that column is compiled before its name is assigned. [ticket:1862]
* | - move LIMIT/OFFSET rendering to be as bind parameters, for all backendsMike Bayer2010-08-291-3/+3
|/ | | | | | | | | | which support it. This includes SQLite, MySQL, Postgresql, Firebird, Oracle (already used binds with ROW NUMBER OVER), MSSQL (when ROW NUMBER is used, not TOP). Not included are Informix, Sybase, MaxDB, Access [ticket:805] - LIMIT/OFFSET parameters need to stay as literals within SQL constructs. This because they may not be renderable as binds on some backends.
* - The generated index name also is based onMike Bayer2010-08-021-2/+4
| | | | | | | | a "max index name length" attribute which is separate from the "max identifier length" - this to appease MySQL who has a max length of 64 for index names, separate from their overall max length of 255. [ticket:1412]
* - Changed the scheme used to generate truncatedMike Bayer2010-07-211-15/+15
| | | | | | | | | | | | "auto" index names when using the "index=True" flag on Column. The truncation only takes place with the auto-generated name, not one that is user-defined (an error would be raised instead), and the truncation scheme itself is now based on a fragment of an md5 hash of the identifier name, so that multiple indexes on columns with similar names still have unique names. [ticket:1855]
* - The argument to "ESCAPE" of a LIKE operator or similarMike Bayer2010-06-241-4/+12
| | | | | | | | | | | | | | | | is passed through render_literal_value(), which may implement escaping of backslashes. [ticket:1400] - Postgresql render_literal_value() is overridden which escapes backslashes, currently applies to the ESCAPE clause of LIKE and similar expressions. Ultimately this will have to detect the value of "standard_conforming_strings" for full behavior. [ticket:1400] - MySQL render_literal_value() is overridden which escapes backslashes, currently applies to the ESCAPE clause of LIKE and similar expressions. This behavior is derived from detecting the value of NO_BACKSLASH_ESCAPES. [ticket:1400]
* - Fixed concatenation of constraints when "PRIMARY KEY"Mike Bayer2010-05-271-4/+4
| | | | | | | constraint gets moved to column level due to SQLite AUTOINCREMENT keyword being rendered. [ticket:1812] - remove some extra space in between constraint DDL - added alias() to binary comparison test, fixing pg + mysql failures