diff options
author | Lele Gaifax <lele@metapensiero.it> | 2007-12-13 15:53:35 +0000 |
---|---|---|
committer | Lele Gaifax <lele@metapensiero.it> | 2007-12-13 15:53:35 +0000 |
commit | 2c3c081fb0f481f665f38435586790fc70945b97 (patch) | |
tree | 880eb79b32978fb30b62ac1173bb6054c0ebd625 /lib/sqlalchemy/databases/firebird.py | |
parent | 8128a6378affeff76b573b1b4ca1e05e7d00b021 (diff) | |
download | sqlalchemy-2c3c081fb0f481f665f38435586790fc70945b97.tar.gz |
Use the external strlen UDF for func.length() under Firebird
Diffstat (limited to 'lib/sqlalchemy/databases/firebird.py')
-rw-r--r-- | lib/sqlalchemy/databases/firebird.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/databases/firebird.py b/lib/sqlalchemy/databases/firebird.py index 59f435c92..051c8c26b 100644 --- a/lib/sqlalchemy/databases/firebird.py +++ b/lib/sqlalchemy/databases/firebird.py @@ -422,6 +422,12 @@ class FBCompiler(compiler.DefaultCompiler): """Already taken care of in the `get_select_precolumns` method.""" return "" + def function_string(self, func): + """Use the ``strlen`` UDF for the ``length`` function.""" + if func.name == 'length': + return "strlen%(expr)s" + return super(FBCompiler, self).function_string(func) + class FBSchemaGenerator(compiler.SchemaGenerator): def get_column_specification(self, column, **kwargs): |