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
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
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))
def _reference(self): return get_backend().reference(self.value)
def _boolean(self): return get_backend().boolean(self.value)
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)))
def _bytes(self): return get_backend().bytes(self.value)