graphile / graphile/migrate

Setting DATABASE_OWNER on a supabase database

Open
#229 2 comments 0 reactions 0 assignees View on GitHub
🐛 bug
Dominant language
TypeScript
Stars
835
Forks
64
Avg merge
17m
Merged PRs (30d)
5

Description

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.