summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/operators.py
Commit message (Collapse)AuthorAgeFilesLines
* - start trying to move things into __slots__. This seems to reduce theslotsMike Bayer2015-01-041-0/+3
| | | | | size of the many per-column objects we're hitting, but somehow the overall memory is hardly being reduced at all in initial testing
* Maul the evaulate & friends typoPriit Laes2014-12-191-1/+1
|
* - The :meth:`.Operators.match` operator is now handled such that theMike Bayer2014-12-041-0/+5
| | | | | | | | | | | | | | | | return type is not strictly assumed to be boolean; it now returns a :class:`.Boolean` subclass called :class:`.MatchType`. The type will still produce boolean behavior when used in Python expressions, however the dialect can override its behavior at result time. In the case of MySQL, while the MATCH operator is typically used in a boolean context within an expression, if one actually queries for the value of a match expression, a floating point value is returned; this value is not compatible with SQLAlchemy's C-based boolean processor, so MySQL's result-set behavior now follows that of the :class:`.Float` type. A new operator object ``notmatch_op`` is also added to better allow dialects to define the negation of a match operation. fixes #3263
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-15/+19
| | | | 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 postgresql_regconfig argument to PG dialect for match() operator,jonathan vanasco2014-07-081-2/+2
| | | | implements PG's to_tsquery('regconfig', 'arg') pattern. fixes #3078
* - hyperlink all the column operators listed in the ORM tutorial common ↵Mike Bayer2014-05-241-4/+10
| | | | | | | | | filter operators section - add language to MATCH explicitly stating this operator varies by backend and is not available on SQLite, as the tutorial defaults to SQLite to start with, fix #3059 - on the actual match() documentation fix this up to be more accurate, list some example renderings for different backends. again mention SQLite not supported
* - The "primaryjoin" model has been stretched a bit further to allowMike Bayer2014-04-191-1/+1
| | | | | | | | | | a join condition that is strictly from a single column to itself, translated through some kind of SQL function or expression. This is kind of experimental, but the first proof of concept is a "materialized path" join condition where a path string is compared to itself using "like". The :meth:`.Operators.like` operator has also been added to the list of valid operators to use in a primaryjoin condition. fixes #3029
* - Added new flag :paramref:`.expression.between.symmetric`, when set to TrueMike Bayer2014-03-301-5/+11
| | | | | | | renders "BETWEEN SYMMETRIC". Also added a new negation operator "notbetween_op", which now allows an expression like ``~col.between(x, y)`` to render as "col NOT BETWEEN x AND y", rather than a parentheiszed NOT string. fixes #2990
* - Added a new parameter :paramref:`.Operators.op.is_comparison`. ThisMike Bayer2014-01-311-4/+17
| | | | | | flag allows a custom op from :meth:`.Operators.op` to be considered as a "comparison" operator, thus usable for custom :paramref:`.relationship.primaryjoin` conditions.
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - The precedence rules for the :meth:`.ColumnOperators.collate` operatorMike Bayer2013-12-051-1/+5
| | | | | | | | | | | have been modified, such that the COLLATE operator is now of lower precedence than the comparison operators. This has the effect that a COLLATE applied to a comparison will not render parenthesis around the comparison, which is not parsed by backends such as MSSQL. The change is backwards incompatible for those setups that were working around the issue by applying :meth:`.Operators.collate` to an individual element of the comparison expression, rather than the comparison expression as a whole. [ticket:2879]
* Ensure API generation and fix cross referencesVraj Mohan2013-11-131-2/+5
|
* An overhaul of expression handling for special symbols particularlyMike Bayer2013-10-231-0/+10
| | | | | | | | | | with conjunctions, e.g. ``None`` :func:`.expression.null` :func:`.expression.true` :func:`.expression.false`, including consistency in rendering NULL in conjunctions, "short-circuiting" of :func:`.and_` and :func:`.or_` expressions which contain boolean constants, and rendering of boolean constants and expressions as compared to "1" or "0" for backends that don't feature ``true``/``false`` constants. [ticket:2804]
* - remove the ``__iter__()`` with notimplemented since it interferesMike Bayer2013-06-031-5/+0
| | | | with legitimate iterable detection, [ticket:2726]
* - endless isinstance(x, str)s....Mike Bayer2013-04-281-9/+10
|
* - the raw 2to3 runMike Bayer2013-04-271-5/+5
| | | | - went through examples/ and cleaned out excess list() calls
* Fixed the consideration of the ``between()`` operatorMike Bayer2013-02-021-1/+1
| | | | | | so that it works correctly with the new relationship local/remote system. [ticket:1768]
* - add full docs for like()/ilike()Mike Bayer2013-01-281-0/+28
|
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* just a pep8 pass of lib/sqlalchemy/sql/Diana Clarke2012-11-191-5/+40
|
* Fixed a gotcha where inadvertently calling list() on aMike Bayer2012-11-181-0/+5
| | | | | | :class:`.ColumnElement` would go into an endless loop, if :meth:`.ColumnOperators.__getitem__` were implemented. A new NotImplementedError is emitted via ``__iter__()``.
* - more docsMike Bayer2012-10-261-6/+10
| | | | - it appears we can get rid of all those "XYZ_toplevel" names and use :doc:.
* Added :meth:`.ColumnOperators.notin_`,Mike Bayer2012-10-241-3/+48
| | | | | | :meth:`.ColumnOperators.notlike`, :meth:`.ColumnOperators.notilike` to :class:`.ColumnOperators`. [ticket:2580]
* - [bug] A tweak to column precedence which moves theMike Bayer2012-09-221-15/+20
| | | | | | | "concat" and "match" operators to be the same as that of "is", "like", and others; this helps with parenthesization rendering when used in conjunction with "IS". [ticket:2564]
* - [bug] Added missing operators is_(), isnot()Mike Bayer2012-09-221-0/+30
| | | | | | to the ColumnOperators base, so that these long-available operators are present as methods like all the other operators. [ticket:2544]
* `lshift` (<<) and `rshift` (>>) are also supported as optional operators.Mike Bayer2012-09-041-1/+19
|
* - [feature] Reworked the startswith(), endswith(),Mike Bayer2012-08-271-0/+9
| | | | | | | | | | | | contains() operators to do a better job with negation (NOT LIKE), and also to assemble them at compilation time so that their rendered SQL can be altered, such as in the case for Firebird STARTING WITH [ticket:2470] - [feature] firebird - The "startswith()" operator renders as "STARTING WITH", "~startswith()" renders as "NOT STARTING WITH", using FB's more efficient operator. [ticket:2470]
* - [feature] The Core oeprator system now includesMike Bayer2012-08-201-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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].
* - fix the labeled column with column_expression() issue, finishes [ticket:1534]Mike Bayer2012-08-181-5/+11
| | | | | | | | | | | - epic documentation sweep for new operator system, making ORM links consistent and complete, full documentation and examples for type/SQL expression feature - type_coerce() explicitly accepts BindParamClause objects - change UserDefinedType to coerce the other side to itself by default as this is much more likely what's desired - make coerce_compared_type() fully public on all types - have profiling run the test no matter what so that the test_zoomarks don't fail when callcounts are missing
* docs for custom ops...Mike Bayer2012-08-161-0/+17
|
* - hashableMike Bayer2012-08-131-0/+3
|
* - develop new system of applying custom operators to ColumnElement classes. ↵Mike Bayer2012-08-131-0/+4
| | | | | | resembles that of the ORM so far.
* some doc fixesMike Bayer2012-07-221-6/+7
|
* - [feature] Revised the rules used to determineMike Bayer2012-07-221-101/+129
| | | | | | | | | | | | 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]
* absolute imports in core, sqlMike Bayer2012-06-231-1/+1
|
* - [bug] Fixed bug in relationship comparisonsMike Bayer2012-04-251-3/+3
| | | | | | | whereby calling unimplemented methods like SomeClass.somerelationship.like() would produce a recursion overflow, instead of NotImplementedError.
* simplify remote annotation significantly, and alsoMike Bayer2012-02-081-0/+5
| | | | catch the actual remote columns more accurately.
* happy new yearMike Bayer2012-01-041-1/+1
|
* - Cls.column.collate("some collation") nowMike Bayer2011-10-231-6/+6
| | | | works. [ticket:1776] Also in 0.6.9
* - Fixed subtle bug that caused SQL to blowMike Bayer2011-06-271-0/+4
| | | | | | | up if: column_property() against subquery + joinedload + LIMIT + order by the column property() occurred. [ticket:2188]. Also in 0.6.9
* - move Operators and ColumnOperators into sqlalchemy.sql.operators - since thisMike Bayer2011-05-281-0/+424
| | | | | is strictly a system of routing Python operators into functions. Keep the references available in expression.py for the near future.
* - whitespace removal bonanzaMike Bayer2011-01-021-2/+2
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-0/+6
| | | | | a consistent tag - AUTHORS file
* Added NULLS FIRST and NULLS LAST support.Michael Trier2010-12-191-0/+6
| | | | | It's implemented as an extension to the asc() and desc() operators, called nullsfirst() and nullslast(). [ticket:723]
* - merge default tipMike Bayer2010-12-051-2/+9
|\
| * - Fixed operator precedence rules for multipleMike Bayer2010-11-251-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | chains of a single non-associative operator. I.e. "x - (y - z)" will compile as "x - (y - z)" and not "x - y - z". Also works with labels, i.e. "x - (y - z).label('foo')" [ticket:1984] - Single element tuple expressions inside an IN clause parenthesize correctly, also from [ticket:1984], added tests for PG - re-fix again importlater, [ticket:1983]
* | - adapt initial patch from [ticket:1917] to current tipMike Bayer2010-11-161-1/+1
|/ | | | - raise TypeError for immutability
* - Added math negation operator support, -x.Mike Bayer2010-02-051-1/+2
|
* merge 0.6 series to trunk.Mike Bayer2009-08-061-1/+9
|