From bc91884a4125ebda230ae8ff20f2af1dbc7e63c6 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 23 May 2014 14:26:22 -0400 Subject: - document the compiler_kwargs accessor - add new FAQ for rendering SQL as a string --- lib/sqlalchemy/sql/elements.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index 9f08aea67..13cf9aa91 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -460,6 +460,26 @@ class ClauseElement(Visitable): also refer to any server-side default generation function associated with a primary key `Column`. + :param compile_kwargs: optional dictionary of additional parameters + that will be passed through to the compiler within all "visit" + methods. This allows any custom flag to be passed through to + a custom compilation construct, for example. It is also used + for the case of passing the ``literal_binds`` flag through:: + + from sqlalchemy.sql import table, column, select + + t = table('t', column('x')) + + s = select([t]).where(t.c.x == 5) + + print s.compile(compile_kwargs={"literal_binds": True}) + + .. versionadded:: 0.9.0 + + .. seealso:: + + :ref:`faq_sql_expression_string` + """ if not dialect: -- cgit v1.2.1