Permalink
Browse files

add db expression wrapper

  • Loading branch information...
1 parent bfcdb4a commit 2158ad7f3374bb035491f6223768f0bf65d4126f @artnez committed May 13, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/faceoff/db.py
View
@@ -363,3 +363,15 @@ def fetchall(self):
def _log(self, *args, **kwargs):
""" Proxy all logs to the connection logger. """
self.connection._log(*args, **kwargs) # pylint: disable=E1101
+
+class Expr(object):
+ """
+ Represents a raw SQL expression. Useful when trying to differentiate user
+ input from internally generated SQL code.
+ """
+
+ def __init__(self, sql):
+ self.sql = sql
+
+ def __str__(self):
+ return self.sql

0 comments on commit 2158ad7

Please sign in to comment.