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

Setting DATABASE_OWNER on a supabase database #229

Open
yesmoreandco opened this issue Nov 19, 2024 · 2 comments
Open

Setting DATABASE_OWNER on a supabase database #229

yesmoreandco opened this issue Nov 19, 2024 · 2 comments
Labels

Comments

@yesmoreandco
Copy link

yesmoreandco commented Nov 19, 2024

Summary

When using graphile-migrate with supabase, it uses the wrong DATABASE_OWNER.

Supabase has a url that looks like this

postgresql://[user].[projectId]:[password]@aws-0-us-west-1.pooler.supabase.com:6543/[db-name]

So the :DATABASE_OWNER variable is set to [user].[projectId] instead of [user]

Steps to reproduce

  1. Create a supabase project
  2. Create a database, user and password in the supabase url (default is postgres)
  3. Put the above connection url into a DATABASE_URL environment variable.
  4. Run graphile-migrate migrate

Expected results

The migration runs.

Actual results

graphile-migrate: Running migration '000001.sql'
error: syntax error at or near "."

The . is from the find and replace of [user].[projectId]

Possible Solution

Give the ability to manually override the :DATABASE_OWNER placeholder.

@yesmoreandco
Copy link
Author

looks like this is related to #75 and they propose a reasonable workaround.

@benjie
Copy link
Member

benjie commented Nov 19, 2024

What is the username inside the database, is it [user] or is it [user].[projectId]? You can find out via select user;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants