This repository was archived by the owner on May 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 13
13
)
14
14
from data_diff.abcs.database_types import (
15
15
JSON,
16
- ColType_UUID,
17
16
NumericType,
18
17
Timestamp,
19
18
TimestampTZ,
@@ -120,13 +119,15 @@ def limit_select(
120
119
) -> str:
121
120
if offset:
122
121
raise NotImplementedError("No support for OFFSET in query")
123
-
124
122
result = ""
125
123
if not has_order_by:
126
124
result += "ORDER BY 1"
127
125
128
126
result += f" OFFSET 0 ROWS FETCH NEXT {limit} ROWS ONLY"
129
- return f"SELECT * FROM ({select_query}) AS LIMITED_SELECT {result}"
127
+
128
+ # mssql requires that subquery columns are all aliased, so
129
+ # don't wrap in an outer select
130
+ return f"{select_query} {result}"
130
131
131
132
def constant_values(self, rows) -> str:
132
133
values = ", ".join("(%s)" % ", ".join(self._constant_value(v) for v in row) for row in rows)
@@ -155,9 +156,6 @@ def md5_as_int(self, s: str) -> str:
155
156
def md5_as_hex(self, s: str) -> str:
156
157
return f"HashBytes('MD5', {s})"
157
158
158
- def normalize_uuid(self, value: str, coltype: ColType_UUID) -> str:
159
- return f"TRIM(CAST({value} AS char)) AS {value}"
160
-
161
159
162
160
@attrs.define(frozen=False, init=False, kw_only=True)
163
161
class MsSQL(ThreadedDatabase):
You can’t perform that action at this time.
0 commit comments