summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/default.py
diff options
context:
space:
mode:
authorMichael Trier <mtrier@gmail.com>2008-12-30 06:39:33 +0000
committerMichael Trier <mtrier@gmail.com>2008-12-30 06:39:33 +0000
commitdfd80ba089c0d0637f54cbd6b21332d5f5115999 (patch)
tree425e887594530d9be218cfa274c0a938cc9a33ee /lib/sqlalchemy/engine/default.py
parent4e8a817ac24e73f3e2d3e80f6939cefa7e9b0130 (diff)
downloadsqlalchemy-dfd80ba089c0d0637f54cbd6b21332d5f5115999.tar.gz
Added a new description_encoding attribute on the dialect.
This is used for encoding the column name when processing the metadata. This usually defaults to utf-8.
Diffstat (limited to 'lib/sqlalchemy/engine/default.py')
-rw-r--r--lib/sqlalchemy/engine/default.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py
index 682ab526c..8a44bac74 100644
--- a/lib/sqlalchemy/engine/default.py
+++ b/lib/sqlalchemy/engine/default.py
@@ -40,7 +40,9 @@ class DefaultDialect(base.Dialect):
supports_default_values = False
supports_empty_insert = True
- def __init__(self, convert_unicode=False, assert_unicode=False, encoding='utf-8', paramstyle=None, dbapi=None, label_length=None, **kwargs):
+ def __init__(self, convert_unicode=False, assert_unicode=False,
+ encoding='utf-8', paramstyle=None, dbapi=None,
+ label_length=None, description_encoding='utf-8', **kwargs):
self.convert_unicode = convert_unicode
self.assert_unicode = assert_unicode
self.encoding = encoding
@@ -58,6 +60,7 @@ class DefaultDialect(base.Dialect):
if label_length and label_length > self.max_identifier_length:
raise exc.ArgumentError("Label length of %d is greater than this dialect's maximum identifier length of %d" % (label_length, self.max_identifier_length))
self.label_length = label_length
+ self.description_encoding = description_encoding
def type_descriptor(self, typeobj):
"""Provide a database-specific ``TypeEngine`` object, given
@@ -368,4 +371,4 @@ class DefaultExecutionContext(base.ExecutionContext):
self.postfetch_cols = self.compiled.postfetch
self.prefetch_cols = self.compiled.prefetch
-DefaultDialect.execution_ctx_cls = DefaultExecutionContext \ No newline at end of file
+DefaultDialect.execution_ctx_cls = DefaultExecutionContext