mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2025-07-25 15:29:50 +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:
|
||||
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):
|
||||
self._range_check(value, self.min_value, self.max_value)
|
||||
|
||||
|
@ -222,6 +227,11 @@ class BaseFloatField(Field):
|
|||
except:
|
||||
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):
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user