@@ -54,16 +54,16 @@ def normalize_number(self, value: str, coltype: FractionalType) -> str:
54
54
55
55
return f"FORMAT({ value } , 'N{ coltype .precision } ')"
56
56
57
+
57
58
class Mixin_MD5 (AbstractMixin_MD5 ):
58
59
def md5_as_int (self , s : str ) -> str :
59
60
# TODO FYI
60
61
# I didn't see another way to do this
61
62
# keep in mind this also required reducing
62
63
# CHECKSUM_HEXDIGITS = 15 -> 14 due to the convert needing an even number of hex digits
63
64
# (affects all dbs)
64
- return (
65
- f"convert(bigint, convert(varbinary, '0x' + RIGHT(CONVERT(NVARCHAR(32), HashBytes('MD5', { s } ), 2), { CHECKSUM_HEXDIGITS } ), 1))"
66
- )
65
+ return f"convert(bigint, convert(varbinary, '0x' + RIGHT(CONVERT(NVARCHAR(32), HashBytes('MD5', { s } ), 2), { CHECKSUM_HEXDIGITS } ), 1))"
66
+
67
67
68
68
class Dialect (BaseDialect , Mixin_Schema , Mixin_OptimizerHints ):
69
69
name = "MsSQL"
@@ -139,11 +139,11 @@ def random(self) -> str:
139
139
def is_distinct_from (self , a : str , b : str ) -> str :
140
140
# IS (NOT) DISTINCT FROM is available only since SQLServer 2022.
141
141
# See: https://stackoverflow.com/a/18684859/857383
142
- return (
143
- f"(({ a } <>{ b } OR { a } IS NULL OR { b } IS NULL) AND NOT({ a } IS NULL AND { b } IS NULL))"
144
- )
142
+ return f"(({ a } <>{ b } OR { a } IS NULL OR { b } IS NULL) AND NOT({ a } IS NULL AND { b } IS NULL))"
145
143
146
- def offset_limit (self , offset : Optional [int ] = None , limit : Optional [int ] = None , has_order_by : Optional [bool ] = None ) -> str :
144
+ def offset_limit (
145
+ self , offset : Optional [int ] = None , limit : Optional [int ] = None , has_order_by : Optional [bool ] = None
146
+ ) -> str :
147
147
if offset :
148
148
raise NotImplementedError ("No support for OFFSET in query" )
149
149
0 commit comments