Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow parsing date and time types as JS Date #572

Open
soedirgo opened this issue Nov 5, 2024 · 0 comments
Open

Allow parsing date and time types as JS Date #572

soedirgo opened this issue Nov 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@soedirgo
Copy link
Member

soedirgo commented Nov 5, 2024

PostgREST returns date & time types as a JSON string (and will continue to do so, since there's no native date/time type in JSON).

However, we can modify the JSON parsing such that date & time columns are returned as JS Date for ease of use.

This will require changes in:

  • the generated types, since we need to know which columns have a date/time type - currently they're generated as string which is indistinguishable from e.g. text columns
  • this client library, since we need to actually transform these columns to Date during JSON parsing

Requested in:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant