dbbase.column_types.WriteOnlyColumn.compile¶
-
WriteOnlyColumn.
compile
(default, bind=None, dialect=None, **kw)¶ Compile this SQL expression.
The return value is a
Compiled
object. Callingstr()
orunicode()
on the returned value will yield a string representation of the result. TheCompiled
object also can return a dictionary of bind parameter names and values using theparams
accessor.- Parameters
bind – An
Engine
orConnection
from which aCompiled
will be acquired. This argument takes precedence over this_expression.ClauseElement
’s bound engine, if any.column_keys – Used for INSERT and UPDATE statements, a list of column names which should be present in the VALUES clause of the compiled statement. If
None
, all columns from the target table object are rendered.dialect – A
Dialect
instance from which aCompiled
will be acquired. This argument takes precedence over the bind argument as well as this_expression.ClauseElement
‘s bound engine, if any.inline – Used for INSERT statements, for a dialect which does not support inline retrieval of newly generated primary key columns, will force the expression used to create the new primary key value to be rendered inline within the INSERT statement’s VALUES clause. This typically refers to Sequence execution but may also refer to any server-side default generation function associated with a primary key Column.
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}))
New in version 0.9.0.
See also
faq_sql_expression_string