Am 20.04.2019 um 01:20 schrieb Justin Pryzby:
Also, caching the types of the values works
only if you have very few different values (like in your case only a
zero), but for most real-world examples with different strings or floats
this will not work.
Do you mean "..works only if you have very few different TYPES OF values" ?
Sorry, it was too late and somehow I thought you were using a mapping
from values to types. That would be a very bad idea as the range of
values is infinite and some may not even been hashable.
But of course you were using a mapping from Python types to PyGres
simple types. I've changed the code to use such a mapping for the most
frequent types, too. I'm not using a self-extending mapping like
_SimpleTypes() though, because for complex types, it would not work -
e.g. the values [1] and ['x'] have the same Python type "list" but
should map to the different PyGres simple types "int[]" and "text[]".
-- Christoph
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo/pygresql