diff options
| author | Mario Lassnig <mario@lassnig.net> | 2013-11-14 20:18:52 +0100 |
|---|---|---|
| committer | Mario Lassnig <mario@lassnig.net> | 2013-11-14 20:18:52 +0100 |
| commit | 741da873841012d893ec08bd77a5ecc9237eaab8 (patch) | |
| tree | 98077da9bb91cbe2e10ad6f588fa2c80fdf9fe3e /lib/sqlalchemy/dialects/oracle | |
| parent | 71c45937f9adbb64482fffcda75f8fe4d063e027 (diff) | |
| download | sqlalchemy-741da873841012d893ec08bd77a5ecc9237eaab8.tar.gz | |
added ORM support
Diffstat (limited to 'lib/sqlalchemy/dialects/oracle')
| -rw-r--r-- | lib/sqlalchemy/dialects/oracle/base.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py index 1f5e05cba..74441e9a8 100644 --- a/lib/sqlalchemy/dialects/oracle/base.py +++ b/lib/sqlalchemy/dialects/oracle/base.py @@ -661,8 +661,18 @@ class OracleCompiler(compiler.SQLCompiler): def for_update_clause(self, select): if self.is_subquery(): return "" - elif select.for_update == "nowait": - return " FOR UPDATE NOWAIT" + + tmp = ' FOR UPDATE' + + if isinstance(select.for_update_of, list): + tmp += ' OF ' + ', '.join(['.'.join(of) for of in select.for_update_of]) + elif isinstance(select.for_update_of, tuple): + tmp += ' OF ' + '.'.join(select.for_update_of) + + if select.for_update == 'nowait': + return tmp + ' NOWAIT' + elif select.for_update: + return tmp else: return super(OracleCompiler, self).for_update_clause(select) |
