| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
|/ |
|
|
|
|
| |
don't exist in the superquery.
|
|
|
|
|
| |
insert().returning() raises an informative CompileError if attempted
to compile on a dialect that doesn't support RETURNING.
|
|
|
|
|
|
|
|
| |
functions, in addition to straight columns. Common modifiers
include using ``somecolumn.desc()`` for a descending index and
``func.lower(somecolumn)`` for a case-insensitive index, depending on the
capabilities of the target backend.
[ticket:695]
|
|
|
|
|
|
| |
INSERT/UPDATE bound parameters that need to be passed, so that
it's more easily identifiable when writing custom bind-handling
code. [ticket:2648]
|
| |
|
|
|
|
|
| |
an INSERT that's used in executemany() as opposed to one which has a VALUES
clause with multiple entries.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- update "not supported" messages for empty inserts, mutlivalue inserts
- rework the ValuesBase approach for multiple value sets so that stmt.parameters
does store a list for multiple values; the _has_multiple_parameters flag now indicates
which of the two modes the statement is within. it now raises exceptions if a subsequent
call to values() attempts to call a ValuesBase with one mode in the style of the other
mode; that is, you can't switch a single- or multi- valued ValuesBase to the other mode,
and also if a multiple value is passed simultaneously with a kwargs set.
Added tests for these error conditions
- Calling values() multiple times in multivalue mode now extends the parameter list to
include the new parameter sets.
- add error/test if multiple *args were passed to ValuesBase.values()
- rework the compiler approach for multivalue inserts, back to where
_get_colparams() returns the same list of (column, value) as before, thereby
maintaining the identical number of append() and other calls when multivalue
is not enabled. In the case of multivalue, it makes a last-minute switch to return
a list of lists instead of the single list. As it constructs the additional lists, the inline
defaults and other calculated default parameters of the first parameter
set are copied into the newly generated lists so that these features continue
to function for a multivalue insert. Multivalue inserts now add no additional
function calls to the compilation for regular insert constructs.
- parameter lists for multivalue inserts now includes an integer index for all
parameter sets.
- add detailed documentation for ValuesBase.values(), including careful wording
to describe the difference between multiple values and an executemany() call.
- add a test for multivalue insert + returning - it works !
- remove the very old/never used "postgresql_returning"/"firebird_returning" flags.
|
|\ |
|
| |
| |
| |
| | |
visit_NUMERIC see #2618
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
| |
separate lists
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
: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]
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"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]
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
API to better support highly specialized
systems such as the Akiban database, including
more hooks to allow an execution context to
access type processors.
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
an Index associated with a Table in a remote
schema. [ticket:2571]
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
select.apply_labels(),
label should be the column name.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
| |
and might have issues with
pks, multiple function calls
|
| |
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"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.
|
|
|
|
| |
column to Table column
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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].
|
|
|
|
|
|
|
|
| |
on each of select(), insert(), update(), delete(),
all with the same API, accepting multiple
prefix calls, as well as a "dialect name" so that
the prefix can be limited to one kind of dialect.
[ticket:2431]
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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".
|
|
|
|
|
|
|
|
| |
- [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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
| |
plain names. The old names are still defined for
backwards compatibility.
- _BindParamClause renamed to BindParameter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
which prevented referring to a CTE in a union
of itself without it being aliased.
CTEs now render uniquely
on name, rendering the outermost CTE of a given
name only - all other references are rendered
just as the name. This even includes other
CTE/SELECTs that refer to different versions
of the same CTE object, such as a SELECT
or a UNION ALL of that SELECT. We are
somewhat loosening the usual link between object
identity and lexical identity in this case.
A true name conflict between two unrelated
CTEs now raises an error.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- rework bindtemplate system of "numbered" params by applying
the numbers last, as we now need to generate these out of order
in some cases
- add positional assertion to assert_compile
- add new cte_positional collection to track bindparams generated
within cte visits; splice this onto the beginning of self.positiontup
at cte render time, [ticket:2521]
|
| |
|
|
|
|
|
|
|
| |
inside the WITH RECURSIVE clause of a
common table expression according to the
quoting rules for the originating Column.
[ticket:2512]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
| |
ForeignKeyConstraint, courtesy Ryan Kelly.
[ticket:2502]
|
|
|
|
|
|
|
| |
rendering to function correctly when the
SELECT statement contains UNION or other
compound expressions, courtesy btbuilder.
[ticket:2490]
|
|
|
|
|
|
|
|
| |
from a Column with quote=True when generating
a same-named bound parameter to the bindparam()
object, as is the case in generated INSERT and UPDATE
statements, so that unknown reserved names can
be fully supported. [ticket:2437]
|