summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/functions.py
Commit message (Collapse)AuthorAgeFilesLines
* - Added support for "set-aggregate" functions of the formticket_3516Mike Bayer2015-08-261-7/+152
| | | | | | | | | | | ``<function> WITHIN GROUP (ORDER BY <criteria>)``, using the method :class:`.FunctionElement.within_group`. A series of common set-aggregate functions with return types derived from the set have been added. This includes functions like :class:`.percentile_cont`, :class:`.dense_rank` and others. fixes #1370 - make sure we use func.name for all _literal_as_binds in functions.py so we get consistent naming behavior for parameters.
* - Added support for the SQL-standard function :class:`.array_agg`,Mike Bayer2015-08-261-0/+22
| | | | | | | which automatically returns an :class:`.Array` of the correct type and supports index / slice operations. As arrays are only supported on Postgresql at the moment, only actually works on Postgresql. fixes #3132
* - build out a new base type for Array, as well as new any/all operatorsMike Bayer2015-08-251-1/+11
| | | | | | - any/all work for Array as well as subqueries, accepted by MySQL - Postgresql ARRAY now subclasses Array - fixes #3516
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - changelog, migration for pr github:134Mike Bayer2014-10-041-1/+8
|
* renamed aggregatefilter to funcfilter, since it is thatIlja Everilä2014-09-111-7/+7
|
* implementation for <aggregate_fun> FILTER (WHERE ...)Ilja Everilä2014-09-101-1/+23
|
* - Added a supported :meth:`.FunctionElement.alias` method to functions,Mike Bayer2014-07-241-5/+47
| | | | | | | | | e.g. the ``func`` construct. Previously, behavior for this method was undefined. The current behavior mimics that of pre-0.9.4, which is that the function is turned into a single-column FROM clause with the given alias name, where the column itself is anonymously named. fixes #3137
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-15/+18
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - add new section Working with Raw DBAPI Connections, fixes #2218.Mike Bayer2014-06-301-0/+9
|
* Documentation fix-up: "its" vs. "it's"pr/91Matthias Urlichs2014-05-111-1/+1
| | | | | | | | | Removed ungrammatical apostrophes from documentation, replacing "it's" with "its" where appropriate (but in a few cases with "it is" when that read better). While doing that, I also fixed a couple of minor typos etc. as I noticed them.
* - Fixed regression whereby the "annotation" system used by the ORM was leakingMike Bayer2014-01-291-9/+9
| | | | | | | into the names used by standard functions in :mod:`sqlalchemy.sql.functions`, such as ``func.coalesce()`` and ``func.max()``. Using these functions in ORM attributes and thus producing annotated versions of them could corrupt the actual function name rendered in the SQL. [ticket:2927]
* - happy new yearMike Bayer2014-01-051-1/+1
|
* Perform fewer dict lookups - tiny microoptimizationpr/35Alex Gaynor2013-10-141-5/+4
|
* Replace a big loop + dict lookup in Connection.execute() with a simple visitorpr/30Alex Gaynor2013-09-251-0/+3
| | | | pattern
* - A large refactoring of the ``sqlalchemy.sql`` package has reorganizedMike Bayer2013-08-121-7/+285
| | | | | | | | | | | | | | | | | | | | | | the import structure of many core modules. ``sqlalchemy.schema`` and ``sqlalchemy.types`` remain in the top-level package, but are now just lists of names that pull from within ``sqlalchemy.sql``. Their implementations are now broken out among ``sqlalchemy.sql.type_api``, ``sqlalchemy.sql.sqltypes``, ``sqlalchemy.sql.schema`` and ``sqlalchemy.sql.ddl``, the last of which was moved from ``sqlalchemy.engine``. ``sqlalchemy.sql.expression`` is also a namespace now which pulls implementations mostly from ``sqlalchemy.sql.elements``, ``sqlalchemy.sql.selectable``, and ``sqlalchemy.sql.dml``. Most of the "factory" functions used to create SQL expression objects have been moved to classmethods or constructors, which are exposed in ``sqlalchemy.sql.expression`` using a programmatic system. Care has been taken such that all the original import namespaces remain intact and there should be no impact on any existing applications. The rationale here was to break out these very large modules into smaller ones, provide more manageable lists of function names, to greatly reduce "import cycles" and clarify the up-front importing of names, and to remove the need for redundant functions and documentation throughout the expression package.
* - implement armin's awesome metaclass adaptor, can drop the refs to MetaBase.Mike Bayer2013-05-301-8/+7
|
* import of "sqlalchemy" and "sqlalchemy.orm" works.Mike Bayer2013-04-271-8/+9
|
* - the raw 2to3 runMike Bayer2013-04-271-2/+1
| | | | - went through examples/ and cleaned out excess list() calls
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* just a pep8 pass of lib/sqlalchemy/sql/Diana Clarke2012-11-191-2/+26
|
* - [feature] The cast() and extract() constructsMike Bayer2012-09-101-3/+19
| | | | | | | | | will now be produced via the func.* accessor as well, as users naturally try to access these names from func.* they might as well do what's expected, even though the returned object is not a FunctionElement. [ticket:2562]
* - add "identifier", can differentiate between "name" rendered and ↵Mike Bayer2012-08-261-2/+20
| | | | "identifier" in func.
* - tweak the GenericFunction constructor more so that it's action in parsing theMike Bayer2012-08-261-7/+6
| | | | | arguments is easier to understand - add a test to ensure generic function can have a custom name
* - correct the argument signature for GenericFunction to be more predictableMike Bayer2012-08-241-13/+8
|
* - [feature] Enhanced GenericFunction and func.*Mike Bayer2012-08-221-19/+88
| | | | | | | to allow for user-defined GenericFunction subclasses to be available via the func.* namespace automatically by classname, optionally using a package name as well.
* -whitespace bonanza, contdMike Bayer2012-07-281-2/+2
|
* absolute imports in core, sqlMike Bayer2012-06-231-4/+4
|
* happy new yearMike Bayer2012-01-041-1/+1
|
* - Added new generic function "next_value()", acceptsMike Bayer2011-03-201-1/+25
| | | | | | | | | | | | | | | | | | | | 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]
* - whitespace removal bonanzaMike Bayer2011-01-021-1/+1
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-0/+6
| | | | | a consistent tag - AUTHORS file
* - Added a tuple_() construct, allows sets of expressionsMike Bayer2010-01-251-7/+1
| | | | | | | | | 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.
* - _CalculatedClause is goneMike Bayer2009-01-281-7/+2
| | | | | | | | - 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
* - sqlalchemy.sql.expression.Function is now a publicMike Bayer2009-01-021-2/+2
| | | | | | | 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.
* - turn __visit_name__ into an explicit member.Mike Bayer2008-12-111-4/+0
| | | | [ticket:1244]
* - merged -r5338:5429 of sphinx branch.Mike Bayer2008-12-061-1/+1
| | | | | | | | | | | | | - 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.
* - moved _FigureVisitName into visitiors.VisitorType, added Visitor base ↵Mike Bayer2008-10-251-3/+3
| | | | | | | class to reduce dependencies - implemented _generative decorator for select/update/insert/delete constructs - other minutiae
* - Added func.min(), func.max(), func.sum() as "generic functions",Mike Bayer2008-09-081-2/+15
| | | | | | | | | | which basically allows for their return type to be determined automatically. Helps with dates on SQLite, decimal types, others. [ticket:1160] - added decimal.Decimal as an "auto-detect" type; bind parameters and generic functions will set their type to Numeric when a Decimal is used.
* - func.count() with no argument emits COUNT(*)Jason Kirtland2008-07-241-1/+11
|
* - Moved to 2.4+ import syntax (w/ some experimental merge-friendly formatting)Jason Kirtland2008-07-151-2/+3
|
* factored down exportable_columns/flatten_cols/proxy_column/oid_etc_yada down ↵Mike Bayer2008-04-041-1/+0
| | | | to a single, streamlined "_populate_column_collection" method called for all selectables
* - Added generic func.random (non-standard SQL)Jason Kirtland2008-03-251-11/+23
|
* - some consolidation of tests in select.py, movedMike Bayer2008-02-011-0/+3
| | | | | | | other tests to more specific modules - added "now()" as a generic function; on SQLite and Oracle compiles as "CURRENT_TIMESTAMP"; "now()" on all others [ticket:943]
* get most oracle tests in sql working again....Mike Bayer2007-12-181-1/+4
|
* - basic framework for generic functions, [ticket:615]Mike Bayer2007-12-051-0/+78
- changed the various "literal" generation functions to use an anonymous bind parameter. not much changes here except their labels now look like ":param_1", ":param_2" instead of ":literal" - from_obj keyword argument to select() can be a scalar or a list.