summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2005-10-02 19:50:11 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2005-10-02 19:50:11 +0000
commit24fe959df62d960ab71674c19cd473cd128e9a5a (patch)
tree6a1dc352af6c40b496bdeb6016e0c82c4bea782f /lib/sqlalchemy/sql.py
parentbb274e941e00fc2fd0606792ca2e88a63727e611 (diff)
downloadsqlalchemy-24fe959df62d960ab71674c19cd473cd128e9a5a.tar.gz
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r--lib/sqlalchemy/sql.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py
index dfa3cdbf4..52ce5fdc9 100644
--- a/lib/sqlalchemy/sql.py
+++ b/lib/sqlalchemy/sql.py
@@ -220,12 +220,9 @@ class ClauseElement(object):
def compile(self, engine = None, bindparams = None):
"""compiles this SQL expression using its underlying SQLEngine to produce
- a Compiled object. The actual SQL statement is the Compiled object's string representation.
- bindparams is an optional dictionary representing the bind parameters to be used with
- the statement. Currently, only the compilations of INSERT and UPDATE statements
- use the bind parameters, in order to determine which
- table columns should be used in the statement."""
-
+ a Compiled object. If no engine can be found, an ansisql engine is used.
+ bindparams is a dictionary representing the default bind parameters to be used with
+ the statement. """
if engine is None:
for f in self._get_from_objects():
engine = f.engine
@@ -237,6 +234,9 @@ class ClauseElement(object):
return engine.compile(self, bindparams = bindparams)
+ def __str__(self):
+ return str(self.compile())
+
def execute(self, *multiparams, **params):
"""compiles and executes this SQL expression using its underlying SQLEngine.
the given **params are used as bind parameters when compiling and executing the expression.