summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
...
| * fixing broken links (see #2625)Diana Clarke2012-12-051-2/+2
| |
| * visit_DECIMAL should include precision and scale (when provided) just like ↵Diana Clarke2012-12-031-1/+9
| | | | | | | | visit_NUMERIC see #2618
| * - BinaryExpression now keeps track of "left" and "right" as passed in,Mike Bayer2012-12-021-3/+4
| | | | | | | | | | so that they can be compared in ``__nonzero__`` prior to their self_group() step. [ticket:2621]
* | compiler: add support for multirow insertsIdan Kamara2012-12-061-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some databases support this syntax for inserts: INSERT INTO table (id, name) VALUES ('v1', 'v2'), ('v3', 'v4'); which greatly increases INSERT speed. It is now possible to pass a list of lists/tuples/dictionaries as the values param to the Insert construct. We convert it to a flat dictionary so we can continue using bind params. The above query will be converted to: INSERT INTO table (id, name) VALUES (:id, :name), (:id0, :name0); Currently only supported on postgresql, mysql and sqlite.
* | compiler: adjust _get_colparams to return the columns and parameters in ↵Idan Kamara2012-12-051-50/+49
| | | | | | | | separate lists
* | updatebase: add support for multi parametersIdan Kamara2012-12-061-9/+22
|/
* just a pep8 pass of lib/sqlalchemy/sql/Diana Clarke2012-11-197-126/+322
|
* 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__()``.
* Fixed bug in type_coerce() whereby typing informationMike Bayer2012-11-121-0/+2
| | | | | | | | could be lost if the statement were used as a subquery inside of another statement, as well as other similar situations. Among other things, would cause typing information to be lost when the Oracle/mssql dialects would apply limit/offset wrappings. [ticket:2603]
* Fixed bug whereby the ".key" of a Column wasn't beingMike Bayer2012-10-311-2/+4
| | | | | | | used when producing a "proxy" of the column against a selectable. This probably didn't occur in 0.7 since 0.7 doesn't respect the ".key" in a wider range of scenarios. [ticket:2597]
* improve some autodoc linksMike Bayer2012-10-311-4/+4
|
* - remove remote_foreign annotationMike Bayer2012-10-281-5/+26
| | | | - support annotations on Column where name isn't immediately present
* - more docsMike Bayer2012-10-261-6/+10
| | | | - it appears we can get rid of all those "XYZ_toplevel" names and use :doc:.
* - add class_ to AliasedInspMike Bayer2012-10-261-0/+17
| | | | | | - redefine inspect(Class.attrname).parent to be always an inspectable target; either Mapper or AliasedInsp - add most major features to 08 migration, document, link
* Added :meth:`.ColumnOperators.notin_`,Mike Bayer2012-10-242-3/+51
| | | | | | :meth:`.ColumnOperators.notlike`, :meth:`.ColumnOperators.notilike` to :class:`.ColumnOperators`. [ticket:2580]
* Fixed bug where keyword arguments passed toMike Bayer2012-10-241-3/+11
| | | | | | | | :meth:`.Compiler.process` wouldn't get propagated to the column expressions present in the columns clause of a SELECT statement. In particular this would come up when used by custom compilation schemes that relied upon special flags. [ticket:2593]
* The auto-correlation feature of :func:`.select`, andMike Bayer2012-10-221-1/+6
| | | | | | | | | by proxy that of :class:`.orm.Query`, will not take effect for a SELECT statement that is being rendered directly in the FROM list of the enclosing SELECT. Correlation in SQL only applies to column expressions such as those in the WHERE, ORDER BY, columns clause. [ticket:2595]
* - [feature] The Query can now load entity/scalar-mixedMike Bayer2012-10-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | "tuple" rows that contain types which aren't hashable, by setting the flag "hashable=False" on the corresponding TypeEngine object in use. Custom types that return unhashable types (typically lists) can set this flag to False. [ticket:2592] - [bug] Applying a column expression to a select statement using a label with or without other modifying constructs will no longer "target" that expression to the underlying Column; this affects ORM operations that rely upon Column targeting in order to retrieve results. That is, a query like query(User.id, User.id.label('foo')) will now track the value of each "User.id" expression separately instead of munging them together. It is not expected that any users will be impacted by this; however, a usage that uses select() in conjunction with query.from_statement() and attempts to load fully composed ORM entities may not function as expected if the select() named Column objects with arbitrary .label() names, as these will no longer target to the Column objects mapped by that entity. [ticket:2591]
* - [feature] "scalar" selects now have a WHERE methodMike Bayer2012-10-151-5/+9
| | | | | | | | | | | | | | | | | | | | to help with generative building. Also slight adjustment regarding how SS "correlates" columns; the new methodology no longer applies meaning to the underlying Table column being selected. This improves some fairly esoteric situations, and the logic that was there didn't seem to have any purpose. - [feature] Some support for auto-rendering of a relationship join condition based on the mapped attribute, with usage of core SQL constructs. E.g. select([SomeClass]).where(SomeClass.somerelationship) would render SELECT from "someclass" and use the primaryjoin of "somerelationship" as the WHERE clause. This changes the previous meaning of "SomeClass.somerelationship" when used in a core SQL context; previously, it would "resolve" to the parent selectable, which wasn't generally useful. Related to [ticket:2245].
* - [feature] Added "collation" parameter to allMike Bayer2012-10-101-9/+20
| | | | | | | | | | | String types. When present, renders as COLLATE <collation>. This to support the COLLATE keyword now supported by several databases including MySQL, SQLite, and Postgresql. [ticket:2276] - [change] The Text() type renders the length given to it, if a length was specified.
* - [feature] Various API tweaks to the "dialect"Mike Bayer2012-10-081-3/+6
| | | | | | | API to better support highly specialized systems such as the Akiban database, including more hooks to allow an execution context to access type processors.
* - fix the fixture here that wasn't creating consistentlyMike Bayer2012-10-012-3/+7
| | | | | | | - rewrite --dropfirst to be more industrial strength, includes views - fix order_by="foreign_key" to maintain the same ordering as metadata.sorted_tables. Not ideal that this was the other way throughout 0.7 but this is still a little-used method, in contrast to metadata.sorted_tables.
* spacingMike Bayer2012-09-301-5/+5
|
* - [bug] Fixed bug in over() construct wherebyMike Bayer2012-09-301-11/+11
| | | | | | | | passing an empty list for either partition_by or order_by, as opposed to None, would fail to generate correctly. Courtesy Gunnlaugur Por Briem. [ticket:2574]
* - [bug] The CreateIndex construct in OracleMike Bayer2012-09-301-5/+11
| | | | | | | | will now schema-qualify the name of the index to be that of the parent table. Previously this name was omitted which apparently creates the index in the default schema, rather than that of the table.
* - [bug] Fixed the DropIndex construct to supportMike Bayer2012-09-241-7/+17
| | | | | an Index associated with a Table in a remote schema. [ticket:2571]
* - use our new Cls.memoized_name._reset(self) method in place of all those ↵Mike Bayer2012-09-232-6/+6
| | | | | | __dict__.pop(), remove reset_memoized
* - [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]
* - aaand actually get is/isnot to be usable with None/NULLMike Bayer2012-09-221-2/+5
|
* - [bug] Added missing operators is_(), isnot()Mike Bayer2012-09-222-0/+32
| | | | | | to the ColumnOperators base, so that these long-available operators are present as methods like all the other operators. [ticket:2544]
* - [bug] CompileError is raised when VARCHAR withMike Bayer2012-09-101-1/+1
| | | | | no length is attempted to be emitted, same way as MySQL. [ticket:2505]
* - [feature] The cast() and extract() constructsMike Bayer2012-09-102-11/+31
| | | | | | | | | 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]
* - [feature] Added a hook to the system of renderingMike Bayer2012-09-091-10/+23
| | | | | | | CREATE TABLE that provides access to the render for each Column individually, by constructing a @compiles function against the new schema.CreateColumn construct. [ticket:2463]
* `lshift` (<<) and `rshift` (>>) are also supported as optional operators.Mike Bayer2012-09-042-1/+21
|
* - type expressions invoke in SQL, but are only for the benefit of columnsMike Bayer2012-09-031-8/+6
| | | | | | delivered to a result set. therefore these expressions should only be rendered for those columns that are being delivered to the result, thereby preventing the expression from stacking onto itself within nesting scenarios.
* - repair type expressions for columns when we aren't using ↵Mike Bayer2012-09-011-2/+5
| | | | | | select.apply_labels(), label should be the column name.
* - [bug] Fixed a regression since 0.6 regardingMike Bayer2012-08-311-4/+7
| | | | | | | | | | | | | | | | result-row targeting. It should be possible to use a select() statement with string based columns in it, that is select(['id', 'name']).select_from('mytable'), and have this statement be targetable by Column objects with those names; this is the mechanism by which query(MyClass).from_statement(some_statement) works. At some point the specific case of using select(['id']), which is equivalent to select([literal_column('id')]), stopped working here, so this has been re-instated and of course tested. [ticket:2558]
* - [feature] Reworked the startswith(), endswith(),Mike Bayer2012-08-273-35/+57
| | | | | | | | | | | | 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]
* call this "_proxies" since it's not really a public consumption attributeMike Bayer2012-08-271-9/+9
|
* - [feature] The "required" flag is set toMike Bayer2012-08-271-2/+23
| | | | | | | | | | True by default, if not passed explicitly, on bindparam() if the "value" or "callable" parameters are not passed. This will cause statement execution to check for the parameter being present in the final collection of bound parameters, rather than implicitly assigning None. [ticket:2556]
* - 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
* - more oracle tweaks for returning; the method here is still kind of brittle ↵Mike Bayer2012-08-251-1/+3
| | | | | | and might have issues with pks, multiple function calls
* a few oracle fixesMike Bayer2012-08-251-2/+3
|
* - correct the argument signature for GenericFunction to be more predictableMike Bayer2012-08-241-13/+8
|
* small tweaks to make insert() behavior more consistent, mostly tests, ↵Mike Bayer2012-08-231-0/+7
| | | | [ticket:2461]
* - [bug] Fixed bug whereby usage of a UNIONMike Bayer2012-08-221-7/+11
| | | | | | | | or similar inside of an embedded subquery would interfere with result-column targeting, in the case that a result-column had the same ultimate name as a name inside the embedded UNION. [ticket:2552]
* - [bug] Fixed cextension bug whereby theMike Bayer2012-08-222-30/+37
| | | | | | | | | | | | | | | | | | | "ambiguous column error" would fail to function properly if the given index were a Column object and not a string. Note there are still some column-targeting issues here which are fixed in 0.8. [ticket:2553] - find more cases where column targeting is being inaccurate, add more information to result_map to better differentiate "ambiguous" results from "present" or "not present". In particular, result_map is sensitive to dupes, even though no error is raised; the conflicting columns are added to the "obj" member of the tuple so that the two are both directly accessible in the result proxy - handwringing over the damn "name fallback" thing in results. can't really make it perfect yet - fix up oracle returning clause. not sure why its guarding against labels, remove that for now and see what the bot says.
* - [feature] Enhanced GenericFunction and func.*Mike Bayer2012-08-222-26/+126
| | | | | | | to allow for user-defined GenericFunction subclasses to be available via the func.* namespace automatically by classname, optionally using a package name as well.
* - MySQL's update does work. add some logic to compiler to convert from ORM ↵Mike Bayer2012-08-201-3/+7
| | | | column to Table column