Skip to content

fix(supabase): relax db schema type constraints in createClient options#2476

Open
gourabsingha1 wants to merge 1 commit into
supabase:masterfrom
gourabsingha1:bugfix/custom-schema-init-type-mismatch
Open

fix(supabase): relax db schema type constraints in createClient options#2476
gourabsingha1 wants to merge 1 commit into
supabase:masterfrom
gourabsingha1:bugfix/custom-schema-init-type-mismatch

Conversation

@gourabsingha1

Copy link
Copy Markdown

This PR fixes a bug (Issue #969) where TypeScript displays a type error when attempting to initialize a client with a custom database schema under db.schema, unless the user explicitly passes the schema as the second generic parameter to createClient. Because of the lack of partial generic inference in TypeScript, when only the first generic parameter <Database> is supplied, the second generic parameter (SchemaName) defaults to 'public', restricting the type of the db.schema option to 'public'. This PR relaxes the schema option type under db to string so that initialization compiles successfully, while preserving type-safety of database/schema queries.

@gourabsingha1
gourabsingha1 requested a review from a team as a code owner June 27, 2026 14:13
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.

1 participant