summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-11-01 12:06:32 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-11-01 12:06:32 -0400
commitb2a28c556f10ee31605c978173f0cce62175ad61 (patch)
treee0e246ba1fc9ff11d7d0bd53637a0d054676347e /lib/sqlalchemy/sql/compiler.py
parentf5956e13d5bc456802a09a0ed89b3c596161e390 (diff)
downloadsqlalchemy-b2a28c556f10ee31605c978173f0cce62175ad61.tar.gz
Revise "literal parameters" FAQ section
based on feedback in #7271, the emphasis on TypeDecorator as a solution to this problem is not very practical. illustrate a series of quick recipes that are useful for debugging purposes to print out a repr() or simple stringify of a parameter without the need to construct custom dialects or types. Change-Id: I788ce1b5ea01d88dd0a22d03d06f35aabff5e5c8
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 5c3fbb2b1..7a2333d91 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -670,6 +670,21 @@ class SQLCompiler(Compiled):
"""
+ positiontup = None
+ """for a compiled construct that uses a positional paramstyle, will be
+ a sequence of strings, indicating the names of bound parameters in order.
+
+ This is used in order to render bound parameters in their correct order,
+ and is combined with the :attr:`_sql.Compiled.params` dictionary to
+ render parameters.
+
+ .. seealso::
+
+ :ref:`faq_sql_expression_string` - includes a usage example for
+ debugging use cases.
+
+ """
+
inline = False
def __init__(
@@ -1091,7 +1106,14 @@ class SQLCompiler(Compiled):
@property
def params(self):
"""Return the bind param dictionary embedded into this
- compiled object, for those values that are present."""
+ compiled object, for those values that are present.
+
+ .. seealso::
+
+ :ref:`faq_sql_expression_string` - includes a usage example for
+ debugging use cases.
+
+ """
return self.construct_params(_check=False)
def _process_parameters_for_postcompile(