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

feat: store deployed databases info in Supabase DB #31

Merged
merged 47 commits into from
Aug 14, 2024

Conversation

jgoux
Copy link
Contributor

@jgoux jgoux commented Aug 8, 2024

Here are the main changes:

  • Refactored sidebar.tsx into multiple components so it's more manageable
  • Created a new deployed_databases table in Supabase database to store the deployed databases infos
  • Implemented the whole database deployment workflow
  • Added alert dialogs for dangerous actions like deleting a database and re-deploying a database

@jgoux jgoux changed the base branch from main to feat/upload-db August 8, 2024 16:58
Copy link
Collaborator

@gregnr gregnr left a comment

Choose a reason for hiding this comment

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

Really great work @jgoux 🎉

apps/db-service/src/index.ts Outdated Show resolved Hide resolved
apps/db-service/src/index.ts Outdated Show resolved Hide resolved
apps/db-service/src/index.ts Outdated Show resolved Hide resolved
apps/db-service/src/index.ts Outdated Show resolved Hide resolved
apps/db-service/src/index.ts Outdated Show resolved Hide resolved
apps/postgres-new/components/code-block.tsx Show resolved Hide resolved
apps/postgres-new/components/deployed-database-fields.tsx Outdated Show resolved Hide resolved
apps/postgres-new/app/api/databases/[id]/upload/route.ts Outdated Show resolved Hide resolved
success: false,
error: "You can't deploy a database that is bigger than 100MB",
},
{ status: 413 }
)
}

const databaseId = params.id
const key = `dbs/${databaseId}.tar.gz`

const gzip = createGzip()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed that sometimes PGlite produced a non-gzipped tar file (not sure what caused this). Should we try to detect this somehow or check mime type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my case it's the opposite, I never had PGlite produce a gzipped tarball, that's why I gzip it in the route here.
Should we ping Sam about it?

apps/postgres-new/app/api/databases/[id]/upload/route.ts Outdated Show resolved Hide resolved
@jgoux jgoux merged commit 693bd73 into feat/upload-db Aug 14, 2024
1 check failed
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.

2 participants