summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
* breakthrough, wowMike Bayer2010-04-051-1/+1
|
* merge default branchMike Bayer2010-04-041-0/+10
|\
| * - id(obj) is no longer used internally within topological.py,Mike Bayer2010-04-011-1/+2
| | | | | | | | | | as the sorting functions now require hashable objects only. [ticket:1756]
| * - Restored some bind-labeling logic from 0.5 which ensuresMike Bayer2010-03-311-0/+10
| | | | | | | | | | | | | | | | that tables with column names that overlap another column of the form "<tablename>_<columnname>" won't produce errors if column._label is used as a bind name during an UPDATE. Test coverage which wasn't present in 0.5 has been added. [ticket:1755]
* | deletes, rudimentary many-to-onesMike Bayer2010-03-311-2/+0
| |
* | really got topological going. now that we aren't putting fricking mapped ↵Mike Bayer2010-03-311-2/+5
|/ | | | | | objects into it all that id() stuff can go
* - the compiler extension now allows @compiles decoratorsMike Bayer2010-03-301-10/+11
| | | | | | on base classes that extend to child classes, @compiles decorators on child classes that aren't broken by a @compiles decorator on the base class.
* - Added with_hint() method to Query() construct. This callsMike Bayer2010-03-272-13/+84
| | | | | | | | | | directly down to select().with_hint() and also accepts entities as well as tables and aliases. See with_hint() in the SQL section below. [ticket:921] - Added with_hint() method to select() construct. Specify a table/alias, hint text, and optional dialect name, and "hints" will be rendered in the appropriate place in the statement. Works for Oracle, Sybase, MySQL. [ticket:921]
* - Fixed bug introduced in 0.6beta2 where column labels wouldMike Bayer2010-03-231-4/+7
| | | | | render inside of column expressions already assigned a label. [ticket:1747]
* - Fixed bug in Query whereby the usage of aliased() constructsMike Bayer2010-03-231-4/+6
| | | | | | would fail if the underlying table (but not the actual alias) were referenced inside the subquery generated by q.from_self() or q.select_from().
* - join() will now simulate a NATURAL JOIN by default. Meaning,Mike Bayer2010-03-192-27/+59
| | | | | | | | if the left side is a join, it will attempt to join the right side to the rightmost side of the left first, and not raise any exceptions about ambiguous join conditions if successful even if there are further join targets across the rest of the left. [ticket:1714]
* - added pyodbc for sybase driver.Mike Bayer2010-03-171-35/+106
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - generalized the "freetds" / "unicode statements" behavior of MS-SQL/pyodbc into the base Pyodbc connector, as this seems to apply to Sybase as well. - generalized the python-sybase "use autocommit for DDL" into the pyodbc connector. With pyodbc, the "autocommit" flag on connection is used, as Pyodbc seems to have more database conversation than python-sybase that can't otherwise be suppressed. - Some platforms will now interpret certain literal values as non-bind parameters, rendered literally into the SQL statement. This to support strict SQL-92 rules that are enforced by some platforms including MS-SQL and Sybase. In this model, bind parameters aren't allowed in the columns clause of a SELECT, nor are certain ambiguous expressions like "?=?". When this mode is enabled, the base compiler will render the binds as inline literals, but only across strings and numeric values. Other types such as dates will raise an error, unless the dialect subclass defines a literal rendering function for those. The bind parameter must have an embedded literal value already or an error is raised (i.e. won't work with straight bindparam('x')). Dialects can also expand upon the areas where binds are not accepted, such as within argument lists of functions (which don't work on MS-SQL when native SQL binding is used).
| * - mxodbc can use default execute() callMike Bayer2010-03-161-29/+77
|/ | | | | | | | | | | | | - modified SQLCompiler to support rendering of bind parameters as literal inline strings for specific sections, if specified by the compiler subclass, using either literal_binds=True passed to process() or any visit method, or by setting to False the "binds_in_columns_clause" flag for SQL-92 compatible columns clauses.. The compiler subclass is responsible for implementing the literal quoting function which should make use of the DBAPI's native capabilities. - SQLCompiler now passes **kw to most process() methods (should be all, ideally) so that literal_binds is propagated. - added some rudimentary tests for mxodbc.
* - The except_() method now renders as MINUS on Oracle,Mike Bayer2010-03-162-9/+27
| | | | | which is more or less equivalent on that platform. [ticket:1712]
* whitespace fixes to improve readability (shortened excessively long lines, ↵Brad Allen2010-03-151-28/+42
| | | | and one 5-space indentation block corrected to 4 spaces).
* - fixed internal error which would occur if calling has()Mike Bayer2010-03-111-1/+3
| | | | | or similar complex expression on a single-table inheritance relation(). [ticket:1731]
* fixed up docs for execution_options() across all three locations.Mike Bayer2010-03-091-1/+13
|
* base tests passMike Bayer2010-03-091-1/+1
|
* still thinking about stuff hereMike Bayer2010-03-081-3/+11
|
* working on getting operators/left hand type awareness into the "bind" ↵Mike Bayer2010-03-081-26/+29
| | | | coercion. this system has to be figured out somehow
* - adjusted the literal coercion rules to take the left side's type into ↵Mike Bayer2010-03-011-0/+2
| | | | | | | | account, if it is compatible with what was found for the right, so that things like oracle CHAR conversions work. - oracle dialect specific tests pass again.
* -remove proof of concept "cascade constraints"Mike Bayer2010-02-281-4/+1
|
* - make tuple a little more friendlyMike Bayer2010-02-281-0/+1
|
* working on pyodbc / mxodbcMike Bayer2010-02-271-0/+1
|
* - Composite PK table on InnoDB where the "autoincrement" columnMike Bayer2010-02-221-12/+16
| | | | | isn't first will emit an explicit "KEY" phrase within CREATE TABLE thereby avoiding errors, [ticket:1496]
* - A change to the solution for [ticket:1579] - an end-userMike Bayer2010-02-161-16/+27
| | | | | | | | defined bind parameter name that directly conflicts with a column-named bind generated directly from the SET or VALUES clause of an update/insert generates a compile error. This reduces call counts and eliminates some cases where undesirable name conflicts could still occur.
* tighten up conditionals a bit. this method is still doing too much, i.e. ↵Mike Bayer2010-02-161-42/+51
| | | | the whole pre-visit step is pricey.
* - Made sqlalchemy.sql.expressions.Executable part of publicMike Bayer2010-02-121-22/+32
| | | | | | | | | | | API, used for any expression construct that can be sent to execute(). FunctionElement now inherits Executable so that it gains execution_options(), which are also propagated to the select() that's generated within execute(). Executable in turn subclasses _Generative which marks any ClauseElement that supports the @_generative decorator - these may also become "public" for the benefit of the compiler extension at some point.
* - The type/expression system now does a more complete jobMike Bayer2010-02-112-131/+43
| | | | | | | | | | | | | | | | | | of determining the return type from an expression as well as the adaptation of the Python operator into a SQL operator, based on the full left/right/operator of the given expression. In particular the date/time/interval system created for Postgresql EXTRACT in [ticket:1647] has now been generalized into the type system. The previous behavior which often occured of an expression "column + literal" forcing the type of "literal" to be the same as that of "column" will now usually not occur - the type of "literal" is first derived from the Python type of the literal, assuming standard native Python types + date types, before falling back to that of the known type on the other side of the expression. Also part of [ticket:1683].
* add sql_compiler property to all Compiled subclasses for convenienceMike Bayer2010-02-071-0/+4
|
* dont reference self.statement during compilationMike Bayer2010-02-071-1/+1
|
* - FunctionElement subclasses are now directly executable theMike Bayer2010-02-071-3/+4
| | | | | | | | | | | same way any func.foo() construct is, with automatic SELECT being applied when passed to execute(). - The "type" and "bind" keyword arguments of a func.foo() construct are now local to "func." constructs and are not part of the FunctionElement base class, allowing a "type" to be handled in a custom constructor or class-level variable.
* - Added math negation operator support, -x.Mike Bayer2010-02-053-1/+9
|
* fix the kwargs scoping. mysteriously was affecting pool gcingMike Bayer2010-01-291-4/+5
|
* - inline some code and turn some instance-level defaults into class levelMike Bayer2010-01-291-3/+7
|
* - the "autocommit" flag on select() and text() as wellMike Bayer2010-01-281-19/+44
| | | | | | as select().autocommit() are deprecated - now call .execution_options(autocommit=True) on either of those constructs, also available directly on Connection and orm.Query.
* against is optionalMike Bayer2010-01-281-1/+1
|
* - allow exists(s.as_scalar()) to workMike Bayer2010-01-281-1/+1
|
* add an informative error msg for non-collection passed to select()Mike Bayer2010-01-281-2/+8
|
* - Added a tuple_() construct, allows sets of expressionsMike Bayer2010-01-253-12/+40
| | | | | | | | | to be compared to another set, typically with IN against composite primary keys or similar. Also accepts an IN with multiple columns. The "scalar select can have only one column" error message is removed - will rely upon the database to report problems with col mismatch.
* - union(), intersect(), except() and other "compound" typesMike Bayer2010-01-251-5/+1
| | | | | | | | | | | | | | | | of statements have more consistent behavior w.r.t. parenthesizing. Each compound element embedded within another will now be grouped with parenthesis - previously, the first compound element in the list would not be grouped, as SQLite doesn't like a statement to start with parenthesis. However, Postgresql in particular has precedence rules regarding INTERSECT, and it is more consistent for parenthesis to be applied equally to all sub-elements. So now, the workaround for SQLite is also what the workaround for PG was previously - when nesting compound elements, the first one usually needs ".alias().select()" called on it to wrap it inside of a subquery. [ticket:1665]
* - Connection has execution_options(), generative methodMike Bayer2010-01-241-5/+7
| | | | | | | | | which accepts keywords that affect how the statement is executed w.r.t. the DBAPI. Currently supports "stream_results", causes psycopg2 to use a server side cursor for that statement. Can also be set upon select() and text() constructs directly as well as ORM Query().
* not ready to put execution_options in the text()/select() constructors yetMike Bayer2010-01-241-9/+3
|
* - types.Binary is renamed to types.LargeBinary, it onlyMike Bayer2010-01-231-1/+7
| | | | | | | produces BLOB, BYTEA, or a similar "long binary" type. New base BINARY and VARBINARY types have been added to access these MySQL/MS-SQL specific types in an agnostic way [ticket:1664].
* fixed the illegal_initial_chars collection + unit test, [ticket:1659]Mike Bayer2010-01-211-1/+1
|
* statement_options -> execution_optionsMike Bayer2010-01-171-30/+32
|
* - added "statement_options()" to Query, to so options can beMike Bayer2010-01-161-22/+43
| | | | | | | | | | | | | | | | | | | | | passed to the resulting statement. Currently only Select-statements have these options, and the only option used is "stream_results", and the only dialect which knows "stream_results" is psycopg2. - Query.yield_per() will set the "stream_results" statement option automatically. - Added "statement_options()" to Selects, which set statement specific options. These enable e.g. dialect specific options such as whether to enable using server side cursors, etc. - The psycopg2 now respects the statement option "stream_results". This option overrides the connection setting "server_side_cursors". If true, server side cursors will be used for the statement. If false, they will not be used, even if "server_side_cursors" is true on the connection. [ticket:1619] - added a "frozendict" from http://code.activestate.com/recipes/414283/, adding more default collections as immutable class vars on Query, Insert, Select
* happy new yearMike Bayer2010-01-072-2/+2
|
* - Fixed a column arithmetic bug that affected columnMike Bayer2010-01-031-1/+2
| | | | | | | | | correspondence for cloned selectables which contain free-standing column expressions. This bug is generally only noticeable when exercising newer ORM behavior only availble in 0.6 via [ticket:1568], but is more correct at the SQL expression level as well. [ticket:1617]
* fixed DDL quoting with literal strings that have ' [ticket:1640]Mike Bayer2010-01-031-1/+8
|