Skip to content

.schema() causes future queries to not use public schema #1108

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

Closed
2 tasks done
FFX3 opened this issue Apr 22, 2025 · 1 comment
Closed
2 tasks done

.schema() causes future queries to not use public schema #1108

FFX3 opened this issue Apr 22, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@FFX3
Copy link

FFX3 commented Apr 22, 2025

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

If the supabase instance uses a different schema previously, you need to specify .schema("public") to start using the public schema again

To Reproduce

create 2 schemas invoke an rpc from a non public schema and then try to query the public schema without using the schema method.

    #this works
    response = (
        supabase.schema('infra')
        .rpc('claim_pdf_job', { "worker_token": worker_token })
        .execute()
    )

    response = (
        supabase.schema('public').table("dzi_builder_logs")
        .insert({
            "message": 'test',
            "pdf_id": record['pdf_id']
        })
        .execute()
    )

    #this throws a 404 on the second query
        #this works
    response = (
        supabase.schema('infra')
        .rpc('claim_pdf_job', { "worker_token": worker_token })
        .execute()
    )

    response = (
        supabase.table("dzi_builder_logs")
        .insert({
            "message": 'test',
            "pdf_id": record['pdf_id']
        })
        .execute()
    )

Expected behavior

I'd expect the schema to default to public if no specified.

System information

  • OS: NixOS
  • Version of supabase-py: 2.13.0
  • Version of Node.js: v22.14.0
@FFX3 FFX3 added the bug Something isn't working label Apr 22, 2025
@silentworks
Copy link
Contributor

silentworks commented Apr 22, 2025

This was fixed in version 1.0.0 of postgrest-py which is only available from 2.15.0 of supabase-py #1074

@silentworks silentworks self-assigned this Apr 22, 2025
@grdsdev grdsdev closed this as completed Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants