def quote(self, value): """ Returns quoted version of the specified value. """ # The pgdb._quote function is good enough for general SQL # quoting, except for array types. if isinstance(value, (list, tuple, set)): return "ARRAY[%s]" % ", ".join(map(self.quote, value)) else: return pgdb._quote(value)
def __pg_repr__(self): d = pgdb.Timestamp(self.year, self.month, self.day, self.hour, self.minute, self.second) return "timestamp %s" % pgdb._quote(d)
def pg_escape_string(string): return pgdb._quote(str(string))[1:-1]