© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
iolyd

Possible to generate precise types for postgres functions?

Using the CLI's type generation workflow, I can see the result includes some return type for postgres functions, but the generated types aren't that useful when it comes to cases of functions using
json_build_object(...)
json_build_object(...)
as it looks like it's not parsing the inner contents of the query and simply outputs a basic
Record
Record
type:

some_postgres_function: {
    Args: Record<PropertyKey, never>;
    Returns: Json;
};
some_postgres_function: {
    Args: Record<PropertyKey, never>;
    Returns: Json;
};


Is there any way to generate more precise types or do I need to manually define some interface/type and make sure to keep it in sync with the function's content?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Generate types
SupabaseSSupabase / help-and-questions
7mo ago
Cannot generate types for local setup
SupabaseSSupabase / help-and-questions
7mo ago
how to generate types in ci for branches?
SupabaseSSupabase / help-and-questions
7mo ago
Is docker required to generate types for remote projects?
SupabaseSSupabase / help-and-questions
4y ago