Skip to content

feat(postgrest): add current timestamp sentinel - #1570

Open
gabrielebnc wants to merge 1 commit into
supabase:mainfrom
gabrielebnc:feat/postgrest-current-timestamp
Open

feat(postgrest): add current timestamp sentinel#1570
gabrielebnc wants to merge 1 commit into
supabase:mainfrom
gabrielebnc:feat/postgrest-current-timestamp

Conversation

@gabrielebnc

Copy link
Copy Markdown

Summary

  • add postgrest.constants.NOW as a typed sentinel for PostgreSQL's current transaction timestamp
  • preserve the runtime "now()" value sent to PostgREST while exposing a datetime type for generated update payloads
  • add a regression test using a generated-style TypedDict datetime field

Why

Generated Python update types represent timestamp columns as datetime. Until now, setting one of those columns to PostgreSQL's current timestamp required an inline type cast or weakening the generated type. The new sentinel provides an idiomatic, reusable value without changing request serialization.

Closes #1564.

Validation

  • make postgrest.tests — 303 passed
  • PostgREST mypy checks — passed
  • ruff check . — passed
  • ruff format --check . — passed

cc @olirice @silentworks for review

@gabrielebnc
gabrielebnc marked this pull request as ready for review August 10, 2026 10:22
@gabrielebnc
gabrielebnc requested review from a team and o-santi as code owners August 10, 2026 10:22
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.

Idiom for updating column to CURRENT_TIMESTAMP

1 participant