From 2cf83604c6ca0df3efa7033c865cbf2beb31cf71 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 25 Jan 2013 12:57:59 -0500 Subject: #2629 insert().returning() raises an informative CompileError if attempted to compile on a dialect that doesn't support RETURNING. --- lib/sqlalchemy/sql/compiler.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 152e68e34..59e46de12 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1248,6 +1248,11 @@ class SQLCompiler(engine.Compiled): else: return "" + def returning_clause(self, stmt, returning_cols): + raise exc.CompileError( + "RETURNING is not supported by this " + "dialect's statement compiler.") + def limit_clause(self, select): text = "" if select._limit is not None: -- cgit v1.2.1