summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/firebird
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-01-16 20:03:33 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2015-01-16 20:03:33 -0500
commitf3a892a3ef666e299107a990bf4eae7ed9a953ae (patch)
tree01c0bbb71be7b397fd2f91b406c3ae7889b2306d /lib/sqlalchemy/dialects/firebird
parent79fa69f1f37fdbc0dfec6bdea1e07f52bfe18f7b (diff)
downloadsqlalchemy-f3a892a3ef666e299107a990bf4eae7ed9a953ae.tar.gz
- Custom dialects that implement :class:`.GenericTypeCompiler` can
now be constructed such that the visit methods receive an indication of the owning expression object, if any. Any visit method that accepts keyword arguments (e.g. ``**kw``) will in most cases receive a keyword argument ``type_expression``, referring to the expression object that the type is contained within. For columns in DDL, the dialect's compiler class may need to alter its ``get_column_specification()`` method to support this as well. The ``UserDefinedType.get_col_spec()`` method will also receive ``type_expression`` if it provides ``**kw`` in its argument signature. fixes #3074
Diffstat (limited to 'lib/sqlalchemy/dialects/firebird')
-rw-r--r--lib/sqlalchemy/dialects/firebird/base.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/sqlalchemy/dialects/firebird/base.py b/lib/sqlalchemy/dialects/firebird/base.py
index 36229a105..74e8abfc2 100644
--- a/lib/sqlalchemy/dialects/firebird/base.py
+++ b/lib/sqlalchemy/dialects/firebird/base.py
@@ -180,16 +180,16 @@ ischema_names = {
# _FBDate, etc. as bind/result functionality is required)
class FBTypeCompiler(compiler.GenericTypeCompiler):
- def visit_boolean(self, type_):
- return self.visit_SMALLINT(type_)
+ def visit_boolean(self, type_, **kw):
+ return self.visit_SMALLINT(type_, **kw)
- def visit_datetime(self, type_):
- return self.visit_TIMESTAMP(type_)
+ def visit_datetime(self, type_, **kw):
+ return self.visit_TIMESTAMP(type_, **kw)
- def visit_TEXT(self, type_):
+ def visit_TEXT(self, type_, **kw):
return "BLOB SUB_TYPE 1"
- def visit_BLOB(self, type_):
+ def visit_BLOB(self, type_, **kw):
return "BLOB SUB_TYPE 0"
def _extend_string(self, type_, basic):
@@ -199,16 +199,16 @@ class FBTypeCompiler(compiler.GenericTypeCompiler):
else:
return '%s CHARACTER SET %s' % (basic, charset)
- def visit_CHAR(self, type_):
- basic = super(FBTypeCompiler, self).visit_CHAR(type_)
+ def visit_CHAR(self, type_, **kw):
+ basic = super(FBTypeCompiler, self).visit_CHAR(type_, **kw)
return self._extend_string(type_, basic)
- def visit_VARCHAR(self, type_):
+ def visit_VARCHAR(self, type_, **kw):
if not type_.length:
raise exc.CompileError(
"VARCHAR requires a length on dialect %s" %
self.dialect.name)
- basic = super(FBTypeCompiler, self).visit_VARCHAR(type_)
+ basic = super(FBTypeCompiler, self).visit_VARCHAR(type_, **kw)
return self._extend_string(type_, basic)