diff options
author | Jason Kirtland <jek@discorporate.us> | 2008-03-25 16:51:29 +0000 |
---|---|---|
committer | Jason Kirtland <jek@discorporate.us> | 2008-03-25 16:51:29 +0000 |
commit | 92a5df77538069efd9f8cfc14cf83807ce43c288 (patch) | |
tree | 3e5056cfae005a54d59c3c708df7b70d67f197f3 /lib/sqlalchemy/databases/mysql.py | |
parent | df1000839ba2925031afa2e9769a482add9f404e (diff) | |
download | sqlalchemy-92a5df77538069efd9f8cfc14cf83807ce43c288.tar.gz |
- Added generic func.random (non-standard SQL)
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 314cb8dac..f2544e9b5 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -158,6 +158,7 @@ from array import array as _array from sqlalchemy import exceptions, logging, schema, sql, util from sqlalchemy.sql import operators as sql_operators +from sqlalchemy.sql import functions as sql_functions from sqlalchemy.sql import compiler from sqlalchemy.engine import base as engine_base, default @@ -1898,6 +1899,11 @@ class MySQLCompiler(compiler.DefaultCompiler): sql_operators.concat_op: lambda x, y: "concat(%s, %s)" % (x, y), sql_operators.mod: '%%' }) + functions = compiler.DefaultCompiler.functions.copy() + functions.update ({ + sql_functions.random: 'rand%(expr)s' + }) + def visit_typeclause(self, typeclause): type_ = typeclause.type.dialect_impl(self.dialect) |