Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 85ded0e

Browse files
changes related to #383
1 parent 97e3569 commit 85ded0e

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

sqeleton/abcs/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
PrecisionType,
1111
StringType,
1212
Boolean,
13+
JSONType,
1314
)
1415
from .compiler import AbstractCompiler, Compilable

sqeleton/databases/postgresql.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,7 @@ def normalize_boolean(self, value: str, _coltype: Boolean) -> str:
5151
return self.to_string(f"{value}::int")
5252

5353
def normalize_json(self, value: str, _coltype: PostgresqlJSON) -> str:
54-
"""
55-
Converts json or bjson values to its minified (most compact) string representation.
56-
57-
Removes whitespaces after json separators (':' and ',') using string replacement.
58-
'{"a": 1, "b": true, "c": "x"}' (bjson::text) -> '{"a":1,"b":true,"c":"x"}'
59-
60-
Comparisons to jsons of other db types can give false positives if they contain string
61-
values that include any of the replaced patterns, or if the items have different order.
62-
"""
63-
return f"replace(replace({value}::text, '\": ', '\":'), ', \"', ',\"')"
54+
return f"{value}::text"
6455

6556

6657
class PostgresqlDialect(BaseDialect, Mixin_Schema):

0 commit comments

Comments
 (0)