diff --git a/postgrest/utils.py b/postgrest/utils.py index 39dc1e29..d22beae0 100644 --- a/postgrest/utils.py +++ b/postgrest/utils.py @@ -5,6 +5,9 @@ from httpx import AsyncClient # noqa: F401 from httpx import Client as BaseClient # noqa: F401 +import json + + class SyncClient(BaseClient): def aclose(self) -> None: @@ -12,7 +15,7 @@ def aclose(self) -> None: def sanitize_param(param: Any) -> str: - param_str = str(param) + param_str = json.dumps(param) reserved_chars = ",:()" if any(char in param_str for char in reserved_chars): return f'"{param_str}"'