summaryrefslogtreecommitdiff
path: root/alembic/environment.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-04-04 16:23:24 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-04-04 16:23:24 -0400
commit0b316ec069a5d8fa721613373a0e5581990bb460 (patch)
tree141c376e9e04348ee201b17d77641f3a95d58d4f /alembic/environment.py
parenta41e4677e355806131ee16b97520f146c3c971a3 (diff)
downloadalembic-0b316ec069a5d8fa721613373a0e5581990bb460.tar.gz
Added ``output_encoding`` option to
:meth:`.EnvironmentContext.configure`, used with ``--sql`` mode to apply an encoding to the output stream. #90
Diffstat (limited to 'alembic/environment.py')
-rw-r--r--alembic/environment.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/alembic/environment.py b/alembic/environment.py
index 9d57a85..d6b47df 100644
--- a/alembic/environment.py
+++ b/alembic/environment.py
@@ -204,6 +204,7 @@ class EnvironmentContext(object):
dialect_name=None,
transactional_ddl=None,
output_buffer=None,
+ output_encoding=None,
starting_rev=None,
tag=None,
template_args=None,
@@ -273,6 +274,11 @@ class EnvironmentContext(object):
the :class:`.Config`
object. The value here overrides that of the :class:`.Config`
object.
+ :param output_encoding: when using ``--sql`` to generate SQL
+ scripts, apply this encoding to the string output.
+
+ .. versionadded:: 0.5.0
+
:param starting_rev: Override the "starting revision" argument
when using ``--sql`` mode.
:param tag: a string tag for usage by custom ``env.py`` scripts.
@@ -471,6 +477,8 @@ class EnvironmentContext(object):
opts["output_buffer"] = output_buffer
elif self.config.output_buffer is not None:
opts["output_buffer"] = self.config.output_buffer
+ if output_encoding is not None:
+ opts["output_encoding"] = output_encoding
if starting_rev:
opts['starting_rev'] = starting_rev
if tag: