Skip to content

Commit 40cabe3

Browse files
committed
SA14: Final adjustments to the changelog
1 parent a48c093 commit 40cabe3

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

CHANGES.txt

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ Unreleased
2222
- Added support for enabling SSL using SQLAlchemy DB URI with parameter
2323
``?ssl=true``.
2424

25-
- Add support for SQLAlchemy 1.4
25+
- Added support for SQLAlchemy 1.4
26+
27+
.. note::
28+
29+
For learning about the transition to SQLAlchemy 1.4, we recommend the
30+
corresponding documentation `What’s New in SQLAlchemy 1.4?`_.
31+
2632

2733

2834
Breaking changes
@@ -31,31 +37,26 @@ Breaking changes
3137
Textual column expressions
3238
''''''''''''''''''''''''''
3339

34-
On the update to SQLAlchemy 1.4, some test cases had to be adjusted in order
35-
to compensate for apparent additional strictness of SQLAlchemy on some details.
40+
SQLAlchemy 1.4 became stricter on some details. It requires to wrap `CrateDB
41+
system columns`_ like ``_score`` in a `SQLAlchemy literal_column`_ type.
42+
Before, it was possible to use a query like this::
3643

37-
Where it was ok to use a textual column expression in plain text beforehand,
38-
a `SQLAlchemy literal_column`_ type should be used now. Otherwise, for example
39-
when accessing `CrateDB system columns`_ like ``_score``, the engine might
40-
complain like::
41-
42-
sqlalchemy.exc.ArgumentError: Textual column expression '_score' should be
43-
explicitly declared with text('_score'), or use column('_score') for more
44-
specificity
44+
session.query(Character.name, '_score')
4545

46-
The changes to be made look like this::
46+
It must now be written like::
4747

48-
old: session.query(Character.name, '_score')
49-
new: session.query(Character.name, sa.literal_column('_score'))
48+
session.query(Character.name, sa.literal_column('_score'))
5049

51-
::
50+
Otherwise, SQLAlchemy will complain like::
5251

53-
old: .order_by(sa.desc(sa.text('_score')))
54-
new: .order_by(sa.desc(sa.literal_column('_score')))
52+
sqlalchemy.exc.ArgumentError: Textual column expression '_score' should be
53+
explicitly declared with text('_score'), or use column('_score') for more
54+
specificity
5555

5656

57-
.. _SQLAlchemy literal_column: https://docs.sqlalchemy.org/en/14/core/sqlelement.html#sqlalchemy.sql.expression.literal_column
5857
.. _CrateDB system columns: https://crate.io/docs/crate/reference/en/4.8/general/ddl/system-columns.html
58+
.. _SQLAlchemy literal_column: https://docs.sqlalchemy.org/en/14/core/sqlelement.html#sqlalchemy.sql.expression.literal_column
59+
.. _What’s New in SQLAlchemy 1.4?: https://docs.sqlalchemy.org/en/14/changelog/migration_14.html
5960

6061

6162
2020/09/28 0.26.0

0 commit comments

Comments
 (0)