summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
...
* - 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
|
* - clarify ForeignKey docs, copy operationMike Bayer2010-01-021-186/+187
| | | | - link all classes/functions in expressions
* - calling expr.in_([]), i.e. with an empty list, emits a warningMike Bayer2009-12-291-1/+9
| | | | | | | | | before issuing the usual "expr != expr" clause. The "expr != expr" can be very expensive, and it's preferred that the user not issue in_() if the list is empty, instead simply not querying, or modifying the criterion as appropriate for more complex situations. [ticket:1628]
* merge r6591, r6592 from 0.5 branch for PGInterval etc. /extractMike Bayer2009-12-291-0/+3
|
* - merge r6586 from 0.5 branch, for [ticket:1647]Mike Bayer2009-12-291-1/+85
|
* - Column() supports a keyword argument "sqlite_autoincrement", whichMike Bayer2009-12-181-1/+3
| | | | | | | | applies the SQLite keyword "AUTOINCREMENT" to columns within DDL - will prevent generation of a separate PRIMARY KEY constraint. [ticket:1016] - added docs - fixed underlines in mysql.rst
* - Fixed bug preventing alias() of an alias() from beingMike Bayer2009-12-181-1/+1
| | | | | cloned or adapted (occurs frequently in ORM operations). [ticket:1641]
* documentation patch for [ticket:1354]Mike Bayer2009-12-091-2/+8
|
* - Session.execute() now locates table- andMike Bayer2009-12-081-2/+8
| | | | | | mapper-specific binds based on a passed in expression which is an insert()/update()/delete() construct. [ticket:1054]
* - removed needless "counter" behavior with select()Mike Bayer2009-12-081-8/+0
| | | | | | | | | | labelnames that match a column name in the table, i.e. generates "tablename_id" for "id", instead of "tablename_id_1" in an attempt to avoid naming conflicts, when the table has a column actually named "tablename_id" - this is because the labeling logic is always applied to all columns so a naming conflict will never occur.
* - multi-part schema names, i.e. with dots such asMike Bayer2009-12-081-1/+1
| | | | | | | "dbo.master", are now rendered in select() labels with underscores for dots, i.e. "dbo_master_table_column". This is a "friendly" label that behaves better in result sets. [ticket:1428]
* - The "use get" behavior of many-to-one relations, i.e. that aMike Bayer2009-12-081-8/+3
| | | | | | | | | | | | | | lazy load will fallback to the possibly cached query.get() value, now works across join conditions where the two compared types are not exactly the same class, but share the same "affinity" - i.e. Integer and SmallInteger. Also allows combinations of reflected and non-reflected types to work with 0.5 style type reflection, such as PGText/Text (note 0.6 reflects types as their generic versions). [ticket:1556] - types now support an "affinity comparison" operation, i.e. that an Integer/SmallInteger are "compatible", or a Text/String, PickleType/Binary, etc. Part of [ticket:1556].
* - reworked the DDL generation of ENUM and similar to be more platform agnostic.Mike Bayer2009-12-062-21/+31
| | | | | | | Uses a straight CheckConstraint with a generic expression. Preparing for boolean constraint in [ticket:1589] - CheckConstraint now accepts SQL expressions, though support for quoting of values will be very limited. we don't want to get into formatting dates and such.
* scan for autocommit based on text() specific flag, saves isinstance() call ↵Mike Bayer2009-11-101-2/+2
| | | | on each execution.
* - subclassed Function off of new FunctionElement generic baseMike Bayer2009-11-101-51/+57
| | | | | | - removed "key" accessor of Function, Grouping - this doesn't seem to be used for anything - various formatting - documented the four "Element" classes in the compiler extension as per [ticket:1590]
* - query.get() can be used with a mapping to an outer joinMike Bayer2009-11-091-0/+18
| | | | | where one or more of the primary key values are None. [ticket:1135]
* - The "start" and "increment" attributes on Sequence nowMike Bayer2009-11-031-0/+11
| | | | | | generate "START WITH" and "INCREMENT BY" by default, on Oracle and Postgresql. Firebird doesn't support these keywords right now. [ticket:1545]
* added docs to case() illusrtating usage of `literal_column()`, can't ↵Mike Bayer2009-10-281-1/+11
| | | | implement #809 directly
* - generalized Enum to issue a CHECK constraint + VARCHAR on default platformMike Bayer2009-10-252-9/+26
| | | | - added native_enum=False flag to do the same on MySQL, PG, if desired
* - Added new ENUM type to the Postgresql dialect, which exists as a schema-levelMike Bayer2009-10-252-33/+28
| | | | | | | | | | | | | | | | | | | | | | | | | construct and extends the generic Enum type. Automatically associates itself with tables and their parent metadata to issue the appropriate CREATE TYPE/DROP TYPE commands as needed, supports unicode labels, supports reflection. [ticket:1511] - MySQL ENUM now subclasses the new generic Enum type, and also handles unicode values implicitly, if the given labelnames are unicode objects. - Added a new Enum generic type, currently supported on Postgresql and MySQL. Enum is a schema-aware object to support databases which require specific DDL in order to use enum or equivalent; in the case of PG it handles the details of `CREATE TYPE`, and on other databases without native enum support can support generation of CHECK constraints. [ticket:1109] [ticket:1511] - types documentation updates - some cleanup on schema/expression docs
* - insert() and update() constructs can now embed bindparam()Mike Bayer2009-10-231-4/+9
| | | | | | | objects using names that match the keys of columns. These bind parameters will circumvent the usual route to those keys showing up in the VALUES or SET clause of the generated SQL. [ticket:1579]
* some cleanupMike Bayer2009-10-211-11/+22
|
* merge r6418 from 0.5, dedupe expressions on clause ident, not string valueMike Bayer2009-10-201-3/+3
| | | | [ticket:1574]