summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - sqlMike Bayer2009-05-291-1/+1
| | | | | | | | | | | | | | | | - Removed an obscure feature of execute() (including connection, engine, Session) whereby a bindparam() construct can be sent as a key to the params dictionary. This usage is undocumented and is at the core of an issue whereby the bindparam() object created implicitly by a text() construct may have the same hash value as a string placed in the params dictionary and may result in an inappropriate match when computing the final bind parameters. Internal checks for this condition would add significant latency to the critical task of parameter rendering, so the behavior is removed. This is a backwards incompatible change for any application that may have been using this feature, however the feature has never been documented.
* Added multi part schema name support. Closes #594 and #1341.Michael Trier2009-04-111-6/+14
|
* extract() is now dialect-sensitive and supports SQLite and others.Jason Kirtland2009-03-301-0/+22
|
* - anonymous alias names now truncate down to the max lengthMike Bayer2009-02-101-3/+7
| | | | | allowed by the dialect. More significant on DBs like Oracle with very small character limits. [ticket:1309]
* - _CalculatedClause is goneMike Bayer2009-01-281-2/+10
| | | | | | | | - Function rolls the various standalone execution functionality of CC into itself, accesses its internal state more directly - collate just uses _BinaryExpression, don't know why it didn't do this already - added new _Case construct, compiles directly - the world is a happier place
* - Further fixes to the "percent signs and spaces in column/tableMike Bayer2009-01-181-3/+3
| | | | | | | | names" functionality. [ticket:1284] - Still doesn't work for PG/MySQL, which unfortunately would require post_process_text() calls all over the place. Perhaps % escaping can be assembled into IdentifierPreparer.quote() since that's where identifier names are received.
* - Improved the methodology to handling percent signs in columnMike Bayer2009-01-141-4/+6
| | | | | | names from [ticket:1256]. Added more tests. MySQL and Postgres dialects still do not issue correct CREATE TABLE statements for identifiers with percent signs in them.
* happy new yearMike Bayer2009-01-121-1/+1
|
* NotSupportedError is a DBAPI wrapper which takes four args and is expected ↵Mike Bayer2009-01-111-1/+1
| | | | | | to originate from the DBAPI layer. Moved those error throws to CompileError/InvalidRequestError.
* - mysql, postgres: "%" signs in text() constructs are automatically escaped ↵Mike Bayer2009-01-021-1/+4
| | | | | | | to "%%". Because of the backwards incompatible nature of this change, a warning is emitted if '%%' is detected in the string. [ticket:1267]
* - sqlalchemy.sql.expression.Function is now a publicMike Bayer2009-01-021-1/+1
| | | | | | | class. It can be subclassed to provide user-defined SQL functions in an imperative style, including with pre-established behaviors. The postgis.py example illustrates one usage of this.
* - Can pass mapped attributes and column objects as keysMike Bayer2008-12-281-2/+2
| | | | | | | | | to query.update({}). [ticket:1262] - Mapped attributes passed to the values() of an expression level insert() or update() will use the keys of the mapped columns, not that of the mapped attribute.
* use new anonymize style for the public _anonymize as wellMike Bayer2008-12-231-1/+1
|
* silly negative ID numbers on linux...Mike Bayer2008-12-231-1/+1
|
* - Columns can again contain percent signs within theirMike Bayer2008-12-231-2/+3
| | | | names. [ticket:1256]
* merged -r5299:5438 of py3k warnings branch. this fixes some sqlite py2.6 ↵Mike Bayer2008-12-181-6/+7
| | | | | | | | testing issues, and also addresses a significant chunk of py3k deprecations. It's mainly expicit __hash__ methods. Additionally, most usage of sets/dicts to store columns uses util-based placeholder names.
* - merged -r5338:5429 of sphinx branch.Mike Bayer2008-12-061-4/+4
| | | | | | | | | | | | | - Documentation has been converted to Sphinx. In particular, the generated API documentation has been constructed into a full blown "API Reference" section which organizes editorial documentation combined with generated docstrings. Cross linking between sections and API docs are vastly improved, a javascript-powered search feature is provided, and a full index of all classes, functions and members is provided.
* - Removed the 'properties' attribute of theMike Bayer2008-11-091-4/+5
| | | | | Connection object, Connection.info should be used. - Method consoliation in Connection, ExecutionContext
* Global propigate -> propagate change to correct spelling. Additionally found ↵Michael Trier2008-11-091-1/+1
| | | | a couple of insures that should be ensure.
* avoid some often unnecessary method calls. i think we might have squeezed ↵Mike Bayer2008-11-071-9/+14
| | | | all we're going to squeeze out of compiler at this point.
* - Dialects can now generate label names of adjustable length.Mike Bayer2008-11-051-41/+42
| | | | | | | | | | | | | Pass in the argument "label_length=<value>" to create_engine() to adjust how many characters max will be present in dynamically generated column labels, i.e. "somecolumn AS somelabel". Any value less than 6 will result in a label of minimal size, consiting of an underscore and a numeric counter. The compiler uses the value of dialect.max_identifier_length as a default. [ticket:1211] - removed ANON_NAME regular expression, using string patterns now - _generated_label() unicode subclass is used to indicate generated names which are subject to truncation
* - moved _FigureVisitName into visitiors.VisitorType, added Visitor base ↵Mike Bayer2008-10-251-3/+2
| | | | | | | class to reduce dependencies - implemented _generative decorator for select/update/insert/delete constructs - other minutiae
* - CompileTests run without the DBAPI being usedMike Bayer2008-10-231-1/+4
| | | | - added stack logic back to visit_compound(), pared down is_subquery
* call count pinata partyMike Bayer2008-10-231-10/+24
|
* Corrected the is_subquery() check based on recent changes. Excluded the ↵Michael Trier2008-10-211-1/+1
| | | | test_in_filtering_advanced test for mssql.
* Modifications to allow the backends to control the behavior of an empty ↵Michael Trier2008-10-201-4/+11
| | | | insert. If supports_empty_insert is True then the backend specifically supports the 'insert into t1 () values ()' syntax. If supports_default_values is True then the backend supports the 'insert into t1 default values' syntax. If both are false then the backend has no support for empty inserts at all and an exception gets raised. Changes here are careful to not change current behavior except where the current behavior was failing to begin with.
* tiny tiny speed improvements....Mike Bayer2008-10-181-19/+21
|
* - 0.5.0rc3, dohMike Bayer2008-10-181-10/+2
| | | | | | | | | | | | - The internal notion of an "OID" or "ROWID" column has been removed. It's basically not used by any dialect, and the possibility of its usage with psycopg2's cursor.lastrowid is basically gone now that INSERT..RETURNING is available. - Removed "default_order_by()" method on all FromClause objects. - profile/compile/select test is 8 function calls over on buildbot 2.4 for some reason, will adjust after checking the results of this commit
* - "not equals" comparisons of simple many-to-one relationMike Bayer2008-10-181-53/+22
| | | | | | | | | | | | | | | to an instance will not drop into an EXISTS clause and will compare foreign key columns instead. - removed not-really-working use cases of comparing a collection to an iterable. Use contains() to test for collection membership. - Further simplified SELECT compilation and its relationship to result row processing. - Direct execution of a union() construct will properly set up result-row processing. [ticket:1194]
* - limit/offset no longer uses ROW NUMBER OVER to limit rows,Mike Bayer2008-09-031-1/+2
| | | | | | and instead uses subqueries in conjunction with a special Oracle optimization comment. Allows LIMIT/OFFSET to work in conjunction with DISTINCT. [ticket:536]
* - fixed a bug in declarative test which was looking for old version of historyMike Bayer2008-08-191-3/+11
| | | | | | | | | | - Added "sorted_tables" accessor to MetaData, which returns Table objects sorted in order of dependency as a list. This deprecates the MetaData.table_iterator() method. The "reverse=False" keyword argument has also been removed from util.sort_tables(); use the Python 'reversed' function to reverse the results. [ticket:1033]
* - Temporarily rolled back the "ORDER BY" enhancementMike Bayer2008-08-061-10/+6
| | | | | from [ticket:1068]. This feature is on hold pending further development.
* - compiler visit_label() checks a flag "within_order_by" and will render its ↵Mike Bayer2008-08-031-16/+23
| | | | | | | | | | | | | | | | | | | own name and not its contained expression, if the dialect reports true for supports_simple_order_by_label. the flag is not propagated forwards, meant to closely mimic the syntax Postgres expects which is that only a simple name can be in the ORDER BY, not a more complex expression or function call with the label name embedded (mysql and sqlite support more complex expressions). This further sets the standard for propigation of **kwargs within compiler, that we can't just send **kwargs along blindly to each XXX.process() call; whenever a **kwarg needs to propagate through, most methods will have to be aware of it and know when they should send it on forward and when not. This was actually already the case with result_map as well. The supports_simple_order_by dialect flag defaults to True but is conservatively explicitly set to False on all dialects except SQLite/MySQL/Postgres to start. [ticket:1068]
* - Removed 2.3 set emulations/enhancements.Jason Kirtland2008-07-151-5/+5
| | | | (sets.Set-based collections & DB-API returns still work.)
* And thus ends support for Python 2.3.Jason Kirtland2008-07-151-15/+32
|
* - Fixed a couple lingering exceptions->exc usagesJason Kirtland2008-07-151-1/+1
| | | | - Some import tidying
* - Fixed bug when calling select([literal('foo')])Mike Bayer2008-07-151-1/+1
| | | | or select([bindparam('foo')]).
* Added new basic match() operator that performs a full-text search. Supported ↵Michael Trier2008-07-131-0/+1
| | | | on PostgreSQL, SQLite, MySQL, MS-SQL, and Oracle backends.
* - re-fixed the fix to the prefixes fixMike Bayer2008-07-061-1/+1
| | | | | - removed ancient descriptor() functions from dialects; replaced with Dialect.name - removed similarly ancient sys.modules silliness in Engine.name
* - session.refresh() raises an informative error message ifMike Bayer2008-07-051-1/+1
| | | | | | | | | | | | | | the list of attributes does not include any column-based attributes. - query() raises an informative error message if no columns or mappers are specified. - lazy loaders now trigger autoflush before proceeding. This allows expire() of a collection or scalar relation to function properly in the context of autoflush. - whitespace fix to new Table prefixes option
* Added prefixes option to that accepts a list of string to insert after ↵Michael Trier2008-07-051-1/+1
| | | | CREATE in the CREATE TABLE statement. Closes #1075.
* fixed the quote() call within dropper.visit_index()Mike Bayer2008-06-221-1/+1
|
* merged r4870 from 0.4 branch, index name truncation, [ticket:820]Mike Bayer2008-06-221-6/+16
|
* - merged r4868, disallow overly long names from create/drop, from 0.4 ↵Mike Bayer2008-06-221-2/+14
| | | | branch, [ticket:571]
* Columns now have default= and server_default=. PassiveDefault fades away.Jason Kirtland2008-05-141-6/+9
|
* - LIMIT/OFFSET of zero is detected within compiler and is countedMike Bayer2008-05-131-2/+2
| | | | | | - Query.__getitem__ now returns list/scalar in all cases, not generative (#1035) - added Query.slice_() which provides the simple "limit/offset from a positive range" operation, we can rename this to range_()/section()/_something_private_because_users_shouldnt_do_this() as needed
* r4695 merged to trunk; trunk now becomes 0.5.Mike Bayer2008-05-091-53/+48
| | | | 0.4 development continues at /sqlalchemy/branches/rel_0_4
* - Support for COLLATE: collate(expr, col) and expr.collate(col)Jason Kirtland2008-04-161-1/+2
|
* - merged -r4458:4466 of query_columns branchMike Bayer2008-04-071-9/+7
| | | | | | | - this branch changes query.values() to immediately return an iterator, adds a new "aliased" construct which will be the primary method to get at aliased columns when using values() - tentative ORM versions of _join and _outerjoin are not yet public, would like to integrate with Query better (work continues in the branch) - lots of fixes to expressions regarding cloning and correlation. Some apparent ORM bug-workarounds removed. - to fix a recursion issue with anonymous identifiers, bind parameters generated against columns now just use the name of the column instead of the tablename_columnname label (plus the unique integer counter). this way expensive recursive schemes aren't needed for the anon identifier logic. This, as usual, impacted a ton of compiler unit tests which needed a search-n-replace for the new bind names.
* slight function call reductionMike Bayer2008-04-021-37/+32
|