diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-12-16 19:38:54 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-12-16 19:38:54 -0500 |
commit | 41f63f957295b758e40f6ae041cb30d7487482d7 (patch) | |
tree | 83d67abd0b360b06ad60d289f13c543510c0b745 | |
parent | 01edf0692d15d6ff7d1bda05531074ff34069b79 (diff) | |
download | sqlalchemy-41f63f957295b758e40f6ae041cb30d7487482d7.tar.gz |
updates
-rw-r--r-- | doc/build/faq/metadata_schema.rst | 12 | ||||
-rw-r--r-- | doc/build/requirements.txt | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/doc/build/faq/metadata_schema.rst b/doc/build/faq/metadata_schema.rst index 0b8937cf4..9697399dc 100644 --- a/doc/build/faq/metadata_schema.rst +++ b/doc/build/faq/metadata_schema.rst @@ -1,3 +1,4 @@ +================== MetaData / Schema ================== @@ -9,7 +10,7 @@ MetaData / Schema My program is hanging when I say ``table.drop()`` / ``metadata.drop_all()`` ----------------------------------------------------------------------------- +=========================================================================== This usually corresponds to two conditions: 1. using PostgreSQL, which is really strict about table locks, and 2. you have a connection still open which @@ -44,7 +45,8 @@ The solution is to close out all connections before emitting DROP TABLE:: mytable.drop(engine) Does SQLAlchemy support ALTER TABLE, CREATE VIEW, CREATE TRIGGER, Schema Upgrade Functionality? ------------------------------------------------------------------------------------------------ +=============================================================================================== + General ALTER support isn't present in SQLAlchemy directly. For special DDL on an ad-hoc basis, the :class:`.DDL` and related constructs can be used. @@ -54,7 +56,7 @@ A more comprehensive option is to use schema migration tools, such as Alembic or SQLAlchemy-Migrate; see :ref:`schema_migrations` for discussion on this. How can I sort Table objects in order of their dependency? ------------------------------------------------------------ +=========================================================================== This is available via the :attr:`.MetaData.sorted_tables` function:: @@ -65,7 +67,7 @@ This is available via the :attr:`.MetaData.sorted_tables` function:: print t How can I get the CREATE TABLE/ DROP TABLE output as a string? ---------------------------------------------------------------- +=========================================================================== Modern SQLAlchemy has clause constructs which represent DDL operations. These can be rendered to strings like any other SQL expression:: @@ -90,7 +92,7 @@ The `Alembic <https://bitbucket.org/zzzeek/alembic>`_ tool also supports an "offline" SQL generation mode that renders database migrations as SQL scripts. How can I subclass Table/Column to provide certain behaviors/configurations? ------------------------------------------------------------------------------- +============================================================================= :class:`.Table` and :class:`.Column` are not good targets for direct subclassing. However, there are simple ways to get on-construction behaviors using creation diff --git a/doc/build/requirements.txt b/doc/build/requirements.txt index 2c7bf0c01..3c26bea70 100644 --- a/doc/build/requirements.txt +++ b/doc/build/requirements.txt @@ -1,3 +1,3 @@ changelog>=0.3.4 sphinx-paramlinks>=0.2.2 -zzzeeksphinx +zzzeeksphinx>=1.0.1 |