示例#1
0
 def on_duplicate_key_update(self, *args, **kwds):
     backend = get_backend()
     if backend.supports_on_duplicate_key_update:
         self._on_duplicate_key_update.set(*args, **kwds)
     if backend.supports_on_conflict_do_update:
         self._on_conflict_do_update.set(*args, **kwds)
     if backend.supports_replace_into:
         if args or kwds:
             raise Exception(
                 'No argument for on_duplicate_key_update for backend {} is supported'.format(
                     backend.name
                 )
             )
         self._queryparts['keyword'].replace()
     return self
示例#2
0
 def full_join(self, arg):
     backend = get_backend()
     if not backend.supports_full_join:
         raise InvalidQueryException('Backend {} does not support FULL JOIN.'.format(backend.name))
     self.last_table().join(arg, FULL_JOIN)
     return self
示例#3
0
 def _string(self):
     # Sometimes, e.g. in subselect, is needed reference to column instead of self.value.
     if get_backend().is_reference(self.value):
         return self._reference()
     return six.u("'%s'") % _escape_value(force_text(self.value))
示例#4
0
 def _reference(self):
     return get_backend().reference(self.value)
示例#5
0
 def _boolean(self):
     return get_backend().boolean(self.value)
示例#6
0
 def _boolean(self):
     return get_backend().boolean(self.value)
示例#7
0
 def _string(self):
     # Sometimes, e.g. in subselect, is needed reference to column instead of self.value.
     if get_backend().is_reference(self.value):
         return self._reference()
     return "'{}'".format(_escape_value(force_text(self.value)))
示例#8
0
 def _reference(self):
     return get_backend().reference(self.value)
示例#9
0
 def _bytes(self):
     return get_backend().bytes(self.value)
示例#10
0
 def full_join(self, arg):
     backend = get_backend()
     if not backend.supports_full_join:
         raise InvalidQueryException('Backend {} does not support FULL JOIN.'.format(backend.name))
     self.last_table().join(arg, FULL_JOIN)
     return self