summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
Commit message (Collapse)AuthorAgeFilesLines
* - [feature] The Core oeprator system now includesMike Bayer2012-08-201-9/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the `getitem` operator, i.e. the bracket operator in Python. This is used at first to provide index and slice behavior to the Postgresql ARRAY type, and also provides a hook for end-user definition of custom __getitem__ schemes which can be applied at the type level as well as within ORM-level custom operator schemes. Note that this change has the effect that descriptor-based __getitem__ schemes used by the ORM in conjunction with synonym() or other "descriptor-wrapped" schemes will need to start using a custom comparator in order to maintain this behavior. - [feature] postgresql.ARRAY now supports indexing and slicing. The Python [] operator is available on all SQL expressions that are of type ARRAY; integer or simple slices can be passed. The slices can also be used on the assignment side in the SET clause of an UPDATE statement by passing them into Update.values(); see the docs for examples. - [feature] Added new "array literal" construct postgresql.array(). Basically a "tuple" that renders as ARRAY[1,2,3].
* - [feature] To complement [ticket:2547], typesMike Bayer2012-08-171-4/+1
| | | | | | | | | | | | | | | | can now provide "bind expressions" and "column expressions" which allow compile-time injection of SQL expressions into statements on a per-column or per-bind level. This is to suit the use case of a type which needs to augment bind- and result- behavior at the SQL level, as opposed to in the Python level. Allows for schemes like transparent encryption/ decryption, usage of Postgis functions, etc. [ticket:1534] - update postgis example fully. - still need to repair the result map propagation here to be transparent for cases like "labeled column".
* _adapt_expression() moves fully to _DefaultColumnComparator which resumesMike Bayer2012-08-161-3/+4
| | | | | | its original role as stateful, forms the basis of TypeEngine.Comparator. lots of code goes back mostly as it was just with cleaner typing behavior, such as simple flow in _binary_operate now.
* - fix concat() operator, testsMike Bayer2012-08-141-3/+3
| | | | | | | | - [feature] Custom unary operators can now be used by combining operators.custom_op() with UnaryExpression(). - clean up the operator dispatch system and make it more consistent. This does change the compiler contract for custom ops.
* more import cleanupsMike Bayer2012-08-071-4/+4
|
* - [feature] Revised the rules used to determineMike Bayer2012-07-221-101/+102
| | | | | | | | | | | | the operator precedence for the user-defined operator, i.e. that granted using the ``op()`` method. Previously, the smallest precedence was applied in all cases, now the default precedence is zero, lower than all operators except "comma" (such as, used in the argument list of a ``func`` call) and "AS", and is also customizable via the "precedence" argument on the ``op()`` method. [ticket:2537]
* - [feature] Added "MATCH" clause to ForeignKey,Mike Bayer2012-06-211-0/+23
| | | | | | | | | | | | | | ForeignKeyConstraint, courtesy Ryan Kelly. [ticket:2502] - [feature] Added support for DELETE and UPDATE from an alias of a table, which would assumedly be related to itself elsewhere in the query, courtesy Ryan Kelly. [ticket:2507] - [feature] Added support for the Postgresql ONLY keyword, which can appear corresponding to a table in a SELECT, UPDATE, or DELETE statement. The phrase is established using with_hint(). Courtesy Ryan Kelly [ticket:2506]
* - [bug] removed unnecessary table clause whenMike Bayer2012-06-161-1/+0
| | | | reflecting enums, [ticket:2510].
* Add some `Sphinx` paragraph level versions informations markups,Mike Bayer2012-06-081-6/+11
| | | | such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
* - [bug] removed unnecessary table clauseMike Bayer2012-05-041-1/+0
| | | | | when reflecting domains, [ticket:2473] also in 0.7.7
* - [feature] postgresql.ARRAY features an optionalMike Bayer2012-04-241-39/+50
| | | | | | | | "dimension" argument, will assign a specific number of dimensions to the array which will render in DDL as ARRAY[][]..., also improves performance of bind/result processing. [ticket:2441]
* - [feature] Inspector.get_primary_keys() isMike Bayer2012-04-241-15/+4
|\ | | | | | | | | | | | | | | deprecated; use Inspector.get_pk_constraint(). Courtesy Diana Clarke. [ticket:2422] - restored default get_primary_keys()/get_pk_constraint() wrapper to help maintain compatibility with third party dialects created against 0.6 or 0.7
| * deprecate inspector.get_primary_keys() in favor of inspector.get_pk_constraint()Diana Clarke2012-04-021-15/+4
| | | | | | | | - see #2422
* | - [removed] The legacy "mutable" system of theMike Bayer2012-04-231-34/+3
|/ | | | | | | | | | | | | | ORM, including the MutableType class as well as the mutable=True flag on PickleType and postgresql.ARRAY has been removed. In-place mutations are detected by the ORM using the sqlalchemy.ext.mutable extension, introduced in 0.7. The removal of MutableType and associated constructs removes a great deal of complexity from SQLAlchemy's internals. The approach performed poorly as it would incur a scan of the full contents of the Session when in use. [ticket:2442]
* - [feature] Added new for_update/with_lockmode()Mike Bayer2012-03-211-0/+4
| | | | | | | | | | options for Postgresql: for_update="read"/ with_lockmode("read"), for_update="read_nowait"/ with_lockmode("read_nowait"). These emit "FOR SHARE" and "FOR SHARE NOWAIT", respectively. Courtesy Diana Clarke [ticket:2445]
* typoes in lib/sqlalchemy/dialectsDiana Clarke2012-03-171-5/+5
|
* revert this, bad ideaMike Bayer2012-02-131-1/+0
|
* - [bug] Fixed the "render literal bind" function,Mike Bayer2012-02-131-0/+1
| | | | used by Alembic, to escape % signs with %%.
* - [feature] Added support for the "isolation_level"Mike Bayer2012-02-121-3/+12
| | | | | | | parameter to all MySQL dialects. Thanks to mu_mind for the patch here. [ticket:2394] - add documentation examples for mysql, postgresql - pep8ing
* - [feature] Dialect-specific compilers now raiseMike Bayer2012-01-281-1/+1
| | | | | | | | 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]
* happy new yearMike Bayer2012-01-041-1/+1
|
* fix a whole bunch of note:: / warning:: that were inline,Mike Bayer2011-12-251-1/+3
| | | | no longer compatible with docutils 0.8
* - [feature] Added create_type constructor argumentMike Bayer2011-11-281-1/+82
| | | | | | | | | to pg.ENUM. When False, no CREATE/DROP or checking for the type will be performed as part of a table create/drop event; only the create()/drop)() methods called directly will do this. Helps with Alembic "offline" scripts.
* - [bug] Postgresql dialect memoizes that an ENUM of aMike Bayer2011-10-291-7/+32
| | | | | | | | | particular name was processed during a create/drop sequence. This allows a create/drop sequence to work without any calls to "checkfirst", and also means with "checkfirst" turned on it only needs to check for the ENUM once. [ticket:2311]
* - [feature] Added new support for remote "schemas":Mike Bayer2011-10-231-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | - 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]
* - Fixed bug related to [ticket:2141] whereby theMike Bayer2011-10-051-6/+12
| | | | | | same modified index behavior in PG 9 affected primary key reflection on a renamed column. [ticket:2291]. Also in 0.6.9.
* - Added "postgresql_using" argument to Index(), producesMike Bayer2011-10-021-3/+24
| | | | | | USING clause to specify index implementation for PG. [ticket:2290]. Thanks to Ryan P. Kelly for the patch.
* - Reflection functions for Table, Sequence no longerMike Bayer2011-09-091-8/+8
| | | | | case insensitive. Names can be differ only in case and will be correctly distinguished. [ticket:2256]
* - Narrowed the assumption made when reflectingMike Bayer2011-08-091-8/+50
| | | | | | | | | | a foreign-key referenced table with schema in the current search path; an explicit schema will be applied to the referenced table only if it actually matches that of the referencing table, which also has an explicit schema. Previously it was assumed that "current" schema was synonymous with the full search_path. [ticket:2249]
* - Added new "postgresql_ops" argument toMike Bayer2011-07-201-9/+43
| | | | | | Index, allows specification of PostgreSQL operator classes for indexed columns. [ticket:2198] Courtesy Filip Zyzniewski.
* - Fixed bug affecting PG 9 whereby index reflectionrel_0_7_0Mike Bayer2011-05-201-7/+23
| | | | | would fail if against a column whose name had changed. [ticket:2141]. Also in 0.6.8.
* - REAL has been added to the core types. SupportedMike Bayer2011-04-051-7/+1
| | | | | | | 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]
* - Added new generic function "next_value()", acceptsMike Bayer2011-03-201-13/+6
| | | | | | | | | | | | | | | | | | | | 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]
* - Fixed the BIT type to allow a "length" parameter, "varying"Mike Bayer2011-03-161-4/+24
| | | | parameter. Reflection also fixed. [ticket:2073]
* MergeMichael Trier2011-03-151-0/+21
|\
| * Informix and postgresql reserved words changes -- almost done.Jim Phares2011-03-151-0/+21
| |
* | corrected a bunch of spelling typosDiana Clarke2011-02-281-1/+1
|/
* -adjust the fix for [ticket:2065] to not rely upon type affinity, revertMike Bayer2011-02-171-3/+3
| | | | the _type_affinity attribute of SmallInteger, BigInteger
* - Query.distinct() now accepts column expressionsMike Bayer2011-02-101-3/+2
| | | | | | | | | | | | | | | | | | | as *args, interpreted by the Postgresql dialect as DISTINCT ON (<expr>). [ticket:1069] - select.distinct() now accepts column expressions as *args, interpreted by the Postgresql dialect as DISTINCT ON (<expr>). Note this was already available via passing a list to the `distinct` keyword argument to select(). [ticket:1069] - select.prefix_with() accepts multiple expressions (i.e. *expr), 'prefix' keyword argument to select() accepts a list or tuple. - Passing a string to the `distinct` keyword argument of `select()` for the purpose of emitting special MySQL keywords (DISTINCTROW etc.) is deprecated - use `prefix_with()` for this. - put kw arguments to select() in order - restore docs for _SelectBase, renamed from _SelectBaseMixin
* - When explicit sequence execution derives the nameMike Bayer2011-02-041-5/+14
| | | | | | | | of the auto-generated sequence of a SERIAL column, which currently only occurs if implicit_returning=False, now accommodates if the table + column name is greater than 63 characters using the same logic Postgresql uses. [ticket:1083]
* - execution_options() on Connection acceptsMike Bayer2011-01-161-1/+1
| | | | | | | | | | "isolation_level" argument, sets transaction isolation level for that connection only until returned to the connection pool, for thsoe backends which support it (SQLite, Postgresql) [ticket:2001] - disallow the option on Engine (use isolation_level to create_engine()), Executable (we don't want to check/set per statement) - docs
* - factor consistent set_isolation_level(), get_isolation_level()Mike Bayer2011-01-161-6/+26
| | | | | | per-connection methods for sqlite, postgresql, psycopg2 dialects - move isolation test suite to test engines/test_transaction - preparing for [ticket:2001]
* - getting slightly more consistent behavior for the edge case of pk columnsMike Bayer2011-01-151-9/+10
| | | | | | 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-6/+6
| | | | | | | | 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-9/+10
| | | | | | | | | | | | | | | | | | | 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-57/+57
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-2/+2
| | | | | a consistent tag - AUTHORS file
* - mutable examples now move into sqlalchemy.ext.mutableMike Bayer2010-12-291-1/+5
| | | | | | | | | | | - streamline interfaces, get Mutable/MutableComposite to be as minimal in usage as possible - docs for mutable, warnings regrarding mapper events being global - move MutableType/mutable=True outwards, move orm tests to its own module, note in all documentation - still need more events/tests for correct pickling support of composites, mutables. in the case of composites its needed even without mutation. see [ticket:2009]
* Ridding the world of a few wasteful imports.Michael Trier2010-12-191-3/+1
|
* - an approach I like better, remove most adapt() methods and use a genericMike Bayer2010-12-151-26/+5
| | | | | copier - mssql reflection fix, but this will come in again from the tip merge