From 03aeadc4ecfbd1dc0e87a0edb5610f258a5255c2 Mon Sep 17 00:00:00 2001 From: Stefan Kreutz Date: Thu, 30 Apr 2026 10:57:13 +0200 Subject: Add post temp-postgres 0.4.0 --- posts/temp-postgres-0.4.0.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 posts/temp-postgres-0.4.0.md diff --git a/posts/temp-postgres-0.4.0.md b/posts/temp-postgres-0.4.0.md new file mode 100644 index 0000000..d090d49 --- /dev/null +++ b/posts/temp-postgres-0.4.0.md @@ -0,0 +1,41 @@ +--- +title: "temp-postgres 0.4.0" +description: "A major UX upgrade for the temporary PostgreSQL server." +published: 2026-04-30 +--- + +[temp-postgres](https://git.skreutz.com/temp-postgres.git/) is a small utility to run the PostgreSQL server off a temporary directory. + +It's been almost six years since the [initial release](/posts/temporary-postgresql-server). +The new version completes a major upgrade in terms of user experience and implementation: + +* Rewritten in async Rust to improve error and signal handling +* UNIX-style command wrapper option +* Structured logging (also known as tracing) +* Graceful shutdown with configurable timeout +* Experimental Nix flake support + +Some examples from the [readme](https://git.skreutz.com/temp-postgres.git/tree/README.md), also available on [crates.io](https://crates.io/crates/temp-postgres-command) and [lib.rs](https://lib.rs/crates/temp-postgres-command): + +```sh +# Install temp-postgres using Cargo. +cargo install temp-postgres-command + +# Run temp-postgres using Nix. +nix run git+https://git.skreutz.com/temp-postgres.git -- --help + +# Optionally with a fixed PostgreSQL major version. +nix run git+https://git.skreutz.com/temp-postgres.git#temp-postgres_18 -- --help + +# Wrap the psql command for an interactive terminal. No configuration necessary. +temp-postgres -- psql + +# Run SQLx integration tests against a temporary database. +temp-postgres -- cargo test + +# Create a symbolic link to enable static configuration. +temp-postgres --symlink db +psql --host "$(realpath db)" +``` + +See the [changelog](https://git.skreutz.com/temp-postgres.git/tree/CHANGELOG.md) for details. -- cgit v1.3.1