Skip to content

Commit

Permalink
add db expression wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
artnez committed May 13, 2012
1 parent bfcdb4a commit 2158ad7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/faceoff/db.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -363,3 +363,15 @@ def fetchall(self):
def _log(self, *args, **kwargs): def _log(self, *args, **kwargs):
""" Proxy all logs to the connection logger. """ """ Proxy all logs to the connection logger. """
self.connection._log(*args, **kwargs) # pylint: disable=E1101 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.