Skip to content

feat: add ChangeSchema function to supabase.Client#18

Open
hemanth-gopi wants to merge 1 commit into
supabase-community:mainfrom
hemanth-gopi:main
Open

feat: add ChangeSchema function to supabase.Client#18
hemanth-gopi wants to merge 1 commit into
supabase-community:mainfrom
hemanth-gopi:main

Conversation

@hemanth-gopi

Copy link
Copy Markdown

Add a ChangeSchema function to supabase Client that wraps the postgrest ChangeSchema method

What kind of change does this PR introduce?

Feature: Add a function to supabase Client

What is the current behavior?

There is no way to change schema once the Client is initialised

postgrest field is private which makes it impossible to use the same client for different schemas

What is the new behavior?

Adds a ChangeSchema method that wraps the postgrest method of the same name. This makes it easy to change the schema as per the requirements of the business logic

@hemanth-gopi

Copy link
Copy Markdown
Author

Closes #17

Add a ChangeSchema function to supabase Client that wraps the postgrest ChangeSchema method
@4cecoder

Copy link
Copy Markdown

This pull request introduces a new method to the Client struct in client.go to allow changing the schema of the client. Here are the most important changes:

  • Added ChangeSchema method to the Client struct to change the schema of the client. This method wraps the ChangeSchema method from the postgrest library and updates the rest field of the Client struct accordingly.

Couldn't this PR be closed?

@zugdev

zugdev commented Mar 30, 2026

Copy link
Copy Markdown

Official clients (supabase-py, supabase-js) expose schema() as an immutable method that returns a new scoped rest client rather than mutating the existing one.

The right fix depends on resolving the replace directives in go.mod first since roja/postgrest-go fork only has ChangeSchema, not the immutable Schema(). Therefore I think this should be closed.

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.

3 participants