opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sqlalchemy
/
engine
/
Go to Home Directory
+
Upload
Create File
root@0UT1S:~$
Execute
By Order of Mr.0UT1S
[DIR] ..
N/A
[DIR] __pycache__
N/A
__init__.py
2.75 KB
Rename
Delete
_py_processors.py
3.66 KB
Rename
Delete
_py_row.py
3.70 KB
Rename
Delete
_py_util.py
2.43 KB
Rename
Delete
base.py
120.02 KB
Rename
Delete
characteristics.py
4.65 KB
Rename
Delete
create.py
32.44 KB
Rename
Delete
cursor.py
74.52 KB
Rename
Delete
default.py
82.72 KB
Rename
Delete
events.py
36.52 KB
Rename
Delete
interfaces.py
110.38 KB
Rename
Delete
mock.py
4.08 KB
Rename
Delete
processors.py
2.32 KB
Rename
Delete
reflection.py
73.62 KB
Rename
Delete
result.py
75.82 KB
Rename
Delete
row.py
11.75 KB
Rename
Delete
strategies.py
442 bytes
Rename
Delete
url.py
30.34 KB
Rename
Delete
util.py
5.55 KB
Rename
Delete
# engine/processors.py # Copyright (C) 2010-2025 the SQLAlchemy authors and contributors # <see AUTHORS file> # Copyright (C) 2010 Gaetan de Menten gdementen@gmail.com # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php """defines generic type conversion functions, as used in bind and result processors. They all share one common characteristic: None is passed through unchanged. """ from __future__ import annotations import typing from ._py_processors import str_to_datetime_processor_factory # noqa from ..util._has_cy import HAS_CYEXTENSION if typing.TYPE_CHECKING or not HAS_CYEXTENSION: from ._py_processors import int_to_boolean as int_to_boolean from ._py_processors import str_to_date as str_to_date from ._py_processors import str_to_datetime as str_to_datetime from ._py_processors import str_to_time as str_to_time from ._py_processors import ( to_decimal_processor_factory as to_decimal_processor_factory, ) from ._py_processors import to_float as to_float from ._py_processors import to_str as to_str else: from sqlalchemy.cyextension.processors import ( DecimalResultProcessor, ) from sqlalchemy.cyextension.processors import ( # noqa: F401 int_to_boolean as int_to_boolean, ) from sqlalchemy.cyextension.processors import ( # noqa: F401,E501 str_to_date as str_to_date, ) from sqlalchemy.cyextension.processors import ( # noqa: F401 str_to_datetime as str_to_datetime, ) from sqlalchemy.cyextension.processors import ( # noqa: F401,E501 str_to_time as str_to_time, ) from sqlalchemy.cyextension.processors import ( # noqa: F401,E501 to_float as to_float, ) from sqlalchemy.cyextension.processors import ( # noqa: F401,E501 to_str as to_str, ) def to_decimal_processor_factory(target_class, scale): # Note that the scale argument is not taken into account for integer # values in the C implementation while it is in the Python one. # For example, the Python implementation might return # Decimal('5.00000') whereas the C implementation will # return Decimal('5'). These are equivalent of course. return DecimalResultProcessor(target_class, "%%.%df" % scale).process
Save