diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-04-04 21:43:12 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-04-04 21:44:49 -0400 |
commit | 6845be0927245e47c27f8e160472cf9a55a41dc4 (patch) | |
tree | cf64489de6a6f9138f39bb1e1d7ab769b7a7cfef /lib/sqlalchemy/sql/compiler.py | |
parent | 97d4d15fde7999eba29c9708b65e11d82623f686 (diff) | |
download | sqlalchemy-6845be0927245e47c27f8e160472cf9a55a41dc4.tar.gz |
Enhance documentation for string compilation use cases
- Add a web link for UnsupportedCompilationError
- Add new section to errors.rst
- add more detail and cross-linking to the FAQ
- include security caveats for parameter rendering
Fixes: #4595
Change-Id: I31ea57c18d65770cd2a51276bbe2847a9eb72bba
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 15ddd7d6f..c7fe3dc50 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -2717,10 +2717,20 @@ class SQLCompiler(Compiled): class StrSQLCompiler(SQLCompiler): - """"a compiler subclass with a few non-standard SQL features allowed. + """A :class:`.SQLCompiler` subclass which allows a small selection + of non-standard SQL features to render into a string value. - Used for stringification of SQL statements when a real dialect is not - available. + The :class:`.StrSQLCompiler` is invoked whenever a Core expression + element is directly stringified without calling upon the + :meth:`.ClauseElement.compile` method. It can render a limited set + of non-standard SQL constructs to assist in basic stringification, + however for more substantial custom or dialect-specific SQL constructs, + it will be necessary to make use of :meth:`.ClauseElement.compile` + directly. + + .. seealso:: + + :ref:`faq_sql_expression_string` """ |