From 466295b2b41d229827f365500569ff019eca2f27 Mon Sep 17 00:00:00 2001 From: Miguel Grillo Date: Wed, 23 Oct 2024 21:37:35 +0200 Subject: [PATCH] docs: add documentation for oracle_tablespace option Added documentation for the new table option to specify the option when creating a table in Oracle. This includes an example usage and a detailed description of the feature. Pull request courtesy of Miguel Grillo. For more details, see the discussion at https://github.com/sqlalchemy/sqlalchemy/issues/12016. --- doc/build/changelog/unreleased_20/12016.rst | 7 +++++++ lib/sqlalchemy/dialects/oracle/base.py | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 doc/build/changelog/unreleased_20/12016.rst diff --git a/doc/build/changelog/unreleased_20/12016.rst b/doc/build/changelog/unreleased_20/12016.rst new file mode 100644 index 0000000000..5fa68d0372 --- /dev/null +++ b/doc/build/changelog/unreleased_20/12016.rst @@ -0,0 +1,7 @@ +.. change:: + :tags: feature, oracle + :ticket: 12016 + + Added new table option `oracle_tablespace` to specify the `TABLESPACE` option + when creating a table in Oracle. This allows users to define the tablespace in + which the table should be created. Pull request courtesy of Miguel Grillo. diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py index 159d6eeb61..18bca4ab0b 100644 --- a/lib/sqlalchemy/dialects/oracle/base.py +++ b/lib/sqlalchemy/dialects/oracle/base.py @@ -500,6 +500,15 @@ in conjunction with the :class:`_schema.Table` construct: The ``oracle_compress`` parameter accepts either an integer compression level, or ``True`` to use the default compression level. +* ``TABLESPACE``:: + + Table('mytable', metadata, ..., + oracle_tablespace="EXAMPLE_TABLESPACE") + + The ``oracle_tablespace`` parameter specifies the tablespace in which the + table is to be created. This is useful when you want to create a table in a + tablespace other than the default tablespace of the user. + .. _oracle_index_options: Oracle Specific Index Options -- 2.47.3