Skip to content

Accept native scalar values in PostgREST JSON#1495

Closed
Dame5211 wants to merge 1 commit into
supabase:mainfrom
Dame5211:codex/postgrest-json-native-scalars
Closed

Accept native scalar values in PostgREST JSON#1495
Dame5211 wants to merge 1 commit into
supabase:mainfrom
Dame5211:codex/postgrest-json-native-scalars

Conversation

@Dame5211
Copy link
Copy Markdown

Closes #1443

Summary

  • Extend the recursive PostgREST JSON type alias to accept Python native scalar values that generated Supabase types commonly include: date, datetime, time, and UUID.
  • Add coverage for nested payloads containing those values.

Verification

  • ============================= test session starts ==============================
    platform darwin -- Python 3.13.12, pytest-8.4.2, pluggy-1.6.0
    rootdir: /Users/huly64/Documents/GITHUB_ISSUE_KILLER/upstreams/supabase-py/src/postgrest
    configfile: pyproject.toml
    plugins: anyio-4.11.0, cov-6.3.0, asyncio-1.0.0, depends-1.0.1
    asyncio: mode=Mode.AUTO, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
    collected 1 item

tests/test_types.py . [100%]

============================== 1 passed in 0.11s ===============================

  • All checks passed!

Constraint: generated Supabase TypedDict inputs can include datetime and UUID values that httpx/pydantic can serialize

Rejected: loosen insert payloads to Any | would discard useful recursive JSON typing

Confidence: high

Scope-risk: narrow

Directive: Keep the JSON alias recursive and explicit when adding additional serializable scalar types

Tested: uv run --directory src/postgrest pytest tests/test_types.py

Tested: uv run --directory src/postgrest ruff check src/postgrest/types.py tests/test_types.py

Tested: git diff --check

Not-tested: full workspace test suite

Co-authored-by: OmX <omx@oh-my-codex.dev>
@Dame5211 Dame5211 requested review from a team and o-santi as code owners May 21, 2026 08:20
@o-santi
Copy link
Copy Markdown
Contributor

o-santi commented May 25, 2026

Won't work. This needs to be done in v3.

@o-santi o-santi closed this May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

insert does not expect TypedDict provided by generated types

2 participants