© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•5mo ago•
2 replies
Jacob | Landscape AI

CLI type generation and UUIDs

When I run
npx supabase gen types typescript > database.types.ts
npx supabase gen types typescript > database.types.ts
, all my primary and foreign keys that are UUIDs in SQL become
string
string
in TypeScript.

Is there a way to make this a TS UUID type? (Other than redefining all columns in my TS app — not really an option given the amount of foreign keys in use).

Or are there good reasons to not want this? I guess the query itself also results in type string? Do we know if there is a specific reason for that?

The reason I ask is that the following does not give a type error, but it does give a PostgREST error:

createClient()
.from('users')
.select('*')
.eq('id', '') // ❌ gives a 400 error
createClient()
.from('users')
.select('*')
.eq('id', '') // ❌ gives a 400 error


So when I accidentally set a default value to emtpy string rather than
null
null
, my app began firing requests and throwing errors.
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

Type generation error
SupabaseSSupabase / help-and-questions
4mo ago
Type generation for Kotlin
SupabaseSSupabase / help-and-questions
6mo ago
Incorrect typescript type generation
SupabaseSSupabase / help-and-questions
13mo ago
Supabase type generation not working
SupabaseSSupabase / help-and-questions
4y ago