mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2025-07-26 07:49:59 +03:00
Performance improvement: skip utils.escape for numeric fields
This commit is contained in:
parent
21907966b2
commit
c5a9b16eac
|
@ -154,6 +154,11 @@ class BaseIntField(Field):
|
||||||
except:
|
except:
|
||||||
raise ValueError('Invalid value for %s - %r' % (self.__class__.__name__, value))
|
raise ValueError('Invalid value for %s - %r' % (self.__class__.__name__, value))
|
||||||
|
|
||||||
|
def to_db_string(self, value, quote=True):
|
||||||
|
# There's no need to call escape since numbers do not contain
|
||||||
|
# special characters, and never need quoting
|
||||||
|
return text_type(value)
|
||||||
|
|
||||||
def validate(self, value):
|
def validate(self, value):
|
||||||
self._range_check(value, self.min_value, self.max_value)
|
self._range_check(value, self.min_value, self.max_value)
|
||||||
|
|
||||||
|
@ -222,6 +227,11 @@ class BaseFloatField(Field):
|
||||||
except:
|
except:
|
||||||
raise ValueError('Invalid value for %s - %r' % (self.__class__.__name__, value))
|
raise ValueError('Invalid value for %s - %r' % (self.__class__.__name__, value))
|
||||||
|
|
||||||
|
def to_db_string(self, value, quote=True):
|
||||||
|
# There's no need to call escape since numbers do not contain
|
||||||
|
# special characters, and never need quoting
|
||||||
|
return text_type(value)
|
||||||
|
|
||||||
|
|
||||||
class Float32Field(BaseFloatField):
|
class Float32Field(BaseFloatField):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user