Skip to content
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

Important! add a test db for supabase #20

Open
devsheva opened this issue Aug 6, 2024 · 2 comments
Open

Important! add a test db for supabase #20

devsheva opened this issue Aug 6, 2024 · 2 comments
Assignees
Labels
feature New feature or request

Comments

@devsheva
Copy link
Owner

devsheva commented Aug 6, 2024

Actually the production DB is used in tests, but this is causing some problems on setup of fixtures and teardowns, so a way to use a test storage must be found.

A solution can be create a different schema (test) that replicates the production schema

Linked issue: #4

@devsheva devsheva self-assigned this Aug 6, 2024
@devsheva devsheva added bug Something isn't working help wanted Extra attention is needed feature New feature or request and removed bug Something isn't working help wanted Extra attention is needed labels Aug 6, 2024
@devsheva
Copy link
Owner Author

devsheva commented Aug 7, 2024

Problem

Cannot find a way to generate type definitions also for test schema from Supabase dashboard.
Ref. Discussion: https://github.com/orgs/supabase/discussions/28448

@devsheva devsheva pinned this issue Aug 7, 2024
@devsheva
Copy link
Owner Author

devsheva commented Aug 7, 2024

Temporary workaround

utils.ts

createClient<Database>(
  config.SUPABASE_URL,
  config.SUPABASE_KEY,
  {
    db: {
      schema: config.SUPABASE_SCHEMA as any, // FIXME: remove any when found a way to type custom schemas (#20)
    },
  },
)

devsheva added a commit that referenced this issue Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant