Skip to content

Rfc/dump #3

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
wants to merge 4 commits into from
Closed

Rfc/dump #3

wants to merge 4 commits into from

Conversation

kiwicopple
Copy link
Member

What kind of change does this PR introduce?

Mocks up a dump concept

We would like to create a basic CLI for Supabase. At this stage we can assume that the user won't need to create orgs/projects from the CLI, but they will need to:

- develop locally
- push database migrations to their Postgres database
Comment on lines +7 to +13
alter table "public"."users" add column
"data"
jsonb -- type
default -- default
;
comment on column "public"."users"."data" is
"";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trickiest part of making the models "clean" seems to be figuring out how to group the comments with the column.

This looks clean:

create table users (
  id           uuid primary_key,
  first_name   text,
  last_name    text
)

but then the comments have to sit below the actual table:

create table users (
  id           uuid primary_key,
  first_name   text,
  last_name    text
)
comment on column "public"."users"."firstname" is "Some comment";
comment on column "public"."users"."lastname" is "Some comment";

As a result it may be better to create all the columns in separate alter statements

Copy link
Member

@steve-chavez steve-chavez Feb 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with the ALTER COLUMNs is that they're too verbose. I think that our structure should make the point that "SQL is code". Verbosity won't aid in that goal, and instead it discourages looking into the generated SQL.

So the comments at the bottom look better to me.

@kiwicopple kiwicopple mentioned this pull request Feb 14, 2021
@soedirgo
Copy link
Member

Closing this as we're transitioning to the Go CLI.

@soedirgo soedirgo closed this Oct 13, 2021
@soedirgo soedirgo deleted the rfc/dump branch December 3, 2021 03:29
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