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

WIP: fast-import: change postgres database to neondb #10211

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion compute_tools/src/bin/fast_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,26 @@ pub(crate) async fn main() -> anyhow::Result<()> {
format!("host=localhost port=5432 user={superuser} dbname=postgres");
loop {
let res = tokio_postgres::connect(&restore_pg_connstring, tokio_postgres::NoTls).await;
if res.is_ok() {
if let Ok((client, connection)) = res {
info!("postgres is ready, could connect to it");

tokio::spawn(async move {
if let Err(e) = connection.await {
eprintln!("connection error: {}", e);
}
});

client
.execute("CREATE DATABASE neondb", &[])
.await
.context("create database neondb")?;

break;
}
}

let restore_pg_connstring = restore_pg_connstring.replace("dbname=postgres", "dbname=neondb");

//
// Decrypt connection string
//
Expand Down
Loading