MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / NUMBER

Class NUMBER

lib/sqlalchemy/dialects/oracle/types.py:64–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62
63
64class NUMBER(sqltypes.Numeric, sqltypes.Integer):
65 __visit_name__ = "NUMBER"
66
67 def __init__(self, precision=None, scale=None, asdecimal=None):
68 if asdecimal is None:
69 asdecimal = bool(scale and scale > 0)
70
71 super().__init__(precision=precision, scale=scale, asdecimal=asdecimal)
72
73 def adapt(self, impltype):
74 ret = super().adapt(impltype)
75 # leave a hint for the DBAPI handler
76 ret._is_oracle_number = True
77 return ret
78
79 @property
80 def _type_affinity(self):
81 if bool(self.scale and self.scale > 0):
82 return sqltypes.Numeric
83 else:
84 return sqltypes.Integer
85
86
87class FLOAT(sqltypes.FLOAT):

Callers 3

dictionary.pyFile · 0.85
get_multi_columnsMethod · 0.85
test_number_typesMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_number_typesMethod · 0.68