also gains the same capability using native cx_Oracle or OracleDB features.
.. change::
- :tags: bug, pool
+ :tags: bug, engine
:tickets: 8523
The :class:`_pool.QueuePool` now ignores ``max_overflow`` when
that of psycopg2 or most MySQL dialects.
.. change::
- :tags: feature, types
+ :tags: feature, sql
:tickets: 7212
Added new backend-agnostic :class:`_types.Uuid` datatype generalized from
accompany the existing ``def visit_concat_op_binary()`` method.
.. change::
- :tags: feature, types
+ :tags: feature, sql
:tickets: 5465
Added :class:`.Double`, :class:`.DOUBLE`, :class:`.DOUBLE_PRECISION`
:ref:`change_7086`
.. change::
- :tags: usecase, datatypes
+ :tags: usecase, sql
:tickets: 5052
Added modified ISO-8601 rendering (i.e. ISO-8601 with the T converted to a
Previously this rendering was not implemented for dialect-specific
compilation.
+ .. seealso::
+
+ :ref:`change_5052`
+
.. change::
:tags: removed, engine
:tickets: 7258
cx_Oracle 7 is now the minimum version for cx_Oracle.
.. change::
- :tags: bug, types
+ :tags: bug, sql
:tickets: 7551
Python string values for which a SQL type is determined from the type of
:ticket:`7631`
+.. _change_5052:
+
+DATE, TIME, DATETIME datatypes now support literal rendering on all backends
+-----------------------------------------------------------------------------
+
+Literal rendering is now implemented for date and time types for backend
+specific compilation, including PostgreSQL and Oracle::
+
+ >>> import datetime
+
+ >>> from sqlalchemy import DATETIME
+ >>> from sqlalchemy import literal
+ >>> from sqlalchemy.dialects import oracle
+ >>> from sqlalchemy.dialects import postgresql
+
+ >>> date_literal = literal(datetime.datetime.now(), DATETIME)
+
+ >>> print(
+ ... date_literal.compile(
+ ... dialect=postgresql.dialect(), compile_kwargs={"literal_binds": True}
+ ... )
+ ... )
+ '2022-12-17 11:02:13.575789'
+
+ >>> print(
+ ... date_literal.compile(
+ ... dialect=oracle.dialect(), compile_kwargs={"literal_binds": True}
+ ... )
+ ... )
+ TO_TIMESTAMP('2022-12-17 11:02:13.575789', 'YYYY-MM-DD HH24:MI:SS.FF')
+
+Previously, such literal rendering only worked when stringifying statements
+without any dialect given; when attempting to render with a dialect-specific
+type, a ``NotImplementedError`` would be raised, up until
+SQLAlchemy 1.4.45 where this became a :class:`.CompileError` (part of
+:ticket:`8800`).
+
+The default rendering is modified ISO-8601 rendering (i.e. ISO-8601 with the T
+converted to a space) when using ``literal_binds`` with the SQL compilers
+provided by the PostgreSQL, MySQL, MariaDB, MSSQL, Oracle dialects. For Oracle,
+the ISO format is wrapped inside of an appropriate TO_DATE() function call.
+The rendering for SQLite is unchanged as this dialect always included string
+rendering for date values.
+
+
+
+:ticket:`5052`
.. _change_8710: