summaryrefslogtreecommitdiff
path: root/docs/build/api/environment.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/build/api/environment.rst')
-rw-r--r--docs/build/api/environment.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/build/api/environment.rst b/docs/build/api/environment.rst
new file mode 100644
index 0000000..5a22773
--- /dev/null
+++ b/docs/build/api/environment.rst
@@ -0,0 +1,19 @@
+.. _alembic.runtime.environment.toplevel:
+
+=======================
+The Environment Context
+=======================
+
+The :class:`.EnvironmentContext` class provides most of the
+API used within an ``env.py`` script. Within ``env.py``,
+the instantated :class:`.EnvironmentContext` is made available
+via a special *proxy module* called ``alembic.context``. That is,
+you can import ``alembic.context`` like a regular Python module,
+and each name you call upon it is ultimately routed towards the
+current :class:`.EnvironmentContext` in use.
+
+In particular, the key method used within ``env.py`` is :meth:`.EnvironmentContext.configure`,
+which establishes all the details about how the database will be accessed.
+
+.. automodule:: alembic.runtime.environment
+ :members: EnvironmentContext