| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Session.refresh() is still hardcoded to legacy lockmode,
come up with a new API so that the newer argument style
works with it.
Added new argument :paramref:`.with_for_update` to the
:meth:`.Session.refresh` method. When the :meth:`.Query.with_lockmode`
method were deprecated in favor of :meth:`.Query.with_for_update`,
the :meth:`.Session.refresh` method was never updated to reflect
the new option.
Change-Id: Ia02a653746b7024699b515451525a88d7a17d63a
Fixes: #3991
|
|
|
|
|
|
|
|
|
|
|
| |
Provide a brief example for these two methods
indicating that typically a table-bound (or other selectable)
column is appended here, then link to with_only_columns
documentation which has in-depth guidelines already including
that one should not append columns from the current select to itself.
Change-Id: I0742405a7f3c41450d337b9c633519d9cc101dfb
Fixes: #3987
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed bug where the use of an :class:`.Alias` object in a column
context would raise an argument error when it tried to group itself
into a parenthesized expression. Using :class:`.Alias` in this way
is not yet a fully supported API, however it applies to some end-user
recipes and may have a more prominent role in support of some
future Postgresql features.
Change-Id: I81717e30416e0350f08d1e022c3d84656e0a9735
Fixes: #3939
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed bug in new "schema translate" feature where the translated schema
name would be invoked in terms of an alias name when rendered along
with a column expression; occurred only when the source translate
name was "None". The "schema translate" feature now only takes
effect for :class:`.SchemaItem` and :class:`.SchemaType` subclasses,
that is, objects that correspond to a DDL-creatable structure in
a database.
Change-Id: Ie8cb35aeaba2c67efec8c8c57c219e4dd346e44a
Fixes: #3924
|
|
|
|
|
|
|
|
|
|
|
| |
Corrects some warnings and adds tox config. Adds DeprecationWarning
to the error category. Large sweep for string literals w/ backslashes
as this is common in docstrings
Co-authored-by: Andrii Soldatenko
Fixes: #3886
Change-Id: Ia7c838dfbbe70b262622ed0803d581edc736e085
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/337
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Fixed bug originally introduced in 0.9 via :ticket:`1068` where
order_by(<some Label()>) would order by the label name based on name
alone, that is, even if the labeled expression were not at all the same
expression otherwise present, implicitly or explicitly, in the
selectable. The logic that orders by label now ensures that the
labeled expression is related to the one that resolves to that name
before ordering by the label name; additionally, the name has to
resolve to an actual label explicit in the expression elsewhere, not
just a column name. This logic is carefully kept separate from the
order by(textual name) feature that has a slightly different purpose.
Change-Id: I44fc36dab34380cc238c1e79ecbe23f1628d588a
Fixes: #3882
|
|/
|
|
| |
Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Fixed bug where setting up a single-table inh subclass of a joined-table
subclass which included an extra column would corrupt the foreign keys
collection of the mapped table, thereby interfering with the
initialization of relationships.
Change-Id: I04a0cf98fd456d12d5a5b9e77a46a01246969a63
Fixes: #3797
|
|
|
|
| |
replacing it with more concrete and working example.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The TABLESAMPLE clause allows randomly selecting an approximate percentage
of rows from a table. At least DB2, Microsoft SQL Server and recent
Postgresql support this standard clause.
Fixes: #3718
Change-Id: I3fb8b9223e12a57100df30876b461884c58d72fa
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/277
|
|/
|
|
|
|
| |
Also add doc members for Lateral.
Change-Id: Ic801c296377ce84230139c6a43ecb3e93a852832
|
|
|
|
|
|
|
|
|
|
|
| |
count() here is misleading in that it not only
counts from an arbitrary column in the table, it also
does not make accommodations for DISTINCT, JOIN, etc.
as the ORM-level function does. Core should not be
attempting to provide a function like this.
Change-Id: I9916fc51ef744389a92c54660ab08e9695b8afc2
Fixes: #3724
|
|
|
|
|
|
|
|
|
| |
The CTE construct was missing a _copy_internals() method
which would handle CTE-specific structures including _cte_alias,
_restates during a clone operation.
Change-Id: I9aeac9cd24d8f7ae6b70e52650d61f7c96cb6d7e
Fixes: #3722
|
|
|
|
|
|
|
|
| |
Adds ``key_share=True`` for with_for_update().
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I74e0c3fcbc023e1dc98a1fa0c7db67b4c3693a31
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/279
|
|
|
|
|
|
|
|
| |
This adds `SELECT ... FOR UPDATE SKIP LOCKED`/
`SELECT ... FOR SHARE SKIP LOCKED` rendering.
Change-Id: Id1dc4f1cafc1de23f397a6f73d54ab2c58d5910d
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/86
|
|
|
|
|
| |
for the SQL standard LATERAL keyword, currently only supported
by Postgresql. fixes #2857
|
|
|
|
| |
Pull request courtesy Stefan Urbanek. fixes #1957
|
|
|
|
|
|
|
| |
INSERT, UPDATE, and DELETE statements to both specify their own
WITH clause, as well as for these statements themselves to be
CTE expressions when they include a RETURNING clause.
fixes #2551
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
method, and its interaction with result-row processing, now allows
the columns passed to the method to be positionally matched with the
result columns in the statement, rather than matching on name alone.
The advantage to this includes that when linking a textual SQL statement
to an ORM or Core table model, no system of labeling or de-duping of
common column names needs to occur, which also means there's no need
to worry about how label names match to ORM columns and so-forth. In
addition, the :class:`.ResultProxy` has been further enhanced to
map column and string keys to a row with greater precision in some
cases. fixes #3501
- reorganize the initialization of ResultMetaData for readability
and complexity; use the name "cursor_description", define the
task of "merging" cursor_description with compiled column information
as its own function, and also define "name extraction" as a separate task.
- fully change the name we use in the "ambiguous column" error to be the
actual name that was ambiguous, modify the C ext also
|
|
|
|
|
|
|
|
|
| |
such as :meth:`.Query.union` now handle the case where the embedded
SELECT statements need to be parenthesized due to the fact that they
include LIMIT, OFFSET and/or ORDER BY. These queries **do not work
on SQLite**, and will fail on that backend as they did before, but
should now work on all other backends.
fixes #2528
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(hence becoming two regressions); reports that
SELECT statements would GROUP BY a label name and fail was misconstrued
that certain backends such as SQL Server should not be emitting
ORDER BY or GROUP BY on a simple label name at all; when in fact,
we had forgotten that 0.9 was already emitting ORDER BY on a simple
label name for all backends, as described in :ref:`migration_1068`,
as 1.0 had rewritten this logic as part of :ticket:`2992`.
In 1.0.2, the bug is fixed both that SQL Server, Firebird and others
will again emit ORDER BY on a simple label name when passed a
:class:`.Label` construct that is expressed in the columns clause,
and no backend will emit GROUP BY on a simple label name in this case,
as even Postgresql can't reliably do GROUP BY on a simple name
in every case.
fixes #3338, fixes #3385
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
assign the proper result type of Boolean to the result mapping, and
instead would leak column types from within the query into the
result map. This issue exists in 0.9 and earlier as well, however
has less of an impact in those versions. In 1.0, due to #918
this becomes a regression in that we now rely upon the result mapping
to be very accurate, else we can assign result-type processors to
the wrong column. In all versions, this issue also has the effect
that a simple EXISTS will not apply the Boolean type handler, leading
to simple 1/0 values for backends without native boolean instead of
True/False. The fix includes that an EXISTS columns argument
will be anon-labeled like other column expressions; a similar fix is
implemented for pure-boolean expressions like ``not_(True())``.
fixes #3372
|
|
|
|
|
| |
agaisnt -> against
'a Alias' -> 'an Alias'
|
|
|
|
|
|
|
|
| |
the string label placed in the order_by() or group_by() of a statement
would place higher priority on the name as found
inside the FROM clause instead of a more locally available name
inside the columns clause.
fixes #3335
|
| |
|
| |
|
|
|
|
| |
for the slots-based __getattr__ thing getting hit
|
|
|
|
|
|
|
| |
to the aliasing syntax, as well as a new CTE feature
:meth:`.CTE.suffix_with`, which is useful for adding in special
Oracle-specific directives to the CTE.
fixes #3220
|
|
|
|
| |
fixes #3036
|
| |
|
|
|
|
|
|
| |
method :meth:`.Query.with_statement_hint` to support statement-level
hints that are not specific to a table.
fixes #3206
|
|
|
|
|
| |
on select(). improve some descriptions and add more info for limit()/
offset(), including new 1.0 functionality.
|
|
|
|
|
|
|
|
| |
unify everything.
- create a new layer of separation between the "from order bys" and "column order bys",
so that an OVER doesn't ORDER BY a label in the same columns clause
- identify another issue with polymorphic for ref #3148, match on label
keys rather than the objects
|
| |
|
|
|
|
|
| |
- replace out _columns_clause_label with a straight boolean flag to
reduce the proliferation of labels
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
stringify a _label_reference() as is.
- add .key to _label_reference(), so that when _make_proxy()
is called, we don't call str() on it anyway.
- add a test to exercise Query's behavior of adding all the order_by
expressions to the columns list of the select, assert that things
work out when we have a _label_reference there, that it gets sucked
into the columns list and spit out on the other side, it's referred
to appropriately, etc. _label_reference() could theoretically
be resolved at the point we iterate _raw_columns() but
it's better to just let things work as they already do (except
nicer, since we get "tablename.colname" instead of just "somename"
in the columns list) so that we aren't adding a ton of overhead
to _columns_plus_names in the common case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
constructs are now importable from the "from sqlalchemy" namespace,
just like every other Core construct.
- The implicit conversion of strings to :func:`.text` constructs
when passed to most builder methods of :func:`.select` as
well as :class:`.Query` now emits a warning with just the
plain string sent. The textual conversion still proceeds normally,
however. The only method that accepts a string without a warning
are the "label reference" methods like order_by(), group_by();
these functions will now at compile time attempt to resolve a single
string argument to a column or label expression present in the
selectable; if none is located, the expression still renders, but
you get the warning again. The rationale here is that the implicit
conversion from string to text is more unexpected than not these days,
and it is better that the user send more direction to the Core / ORM
when passing a raw string as to what direction should be taken.
Core/ORM tutorials have been updated to go more in depth as to how text
is handled.
fixes #2992
|
|
|
|
| |
sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
|
|
|
|
|
|
|
|
| |
as a scalar subquery such as within an IN would receive inappropriate
substitutions from the enclosing query, if the same table were present
inside the subquery as were in the enclosing query such as in a
joined inheritance scenario.
fixes #3130
|
|
|
|
| |
to get all flake8 passing
|
|
|
|
|
| |
UNION would wrap the union in an anonymous (e.g. unlabled) subquery.
fixes #3044
|
|
|
|
| |
- implement for SQL server, use window functions when simple limit/offset not available
|
|\
| |
| |
| | |
https://bitbucket.org/dobesv/sqlalchemy/branch/issue_3034 into ticket_3034
|
| | |
|
| | |
|